[ARVADOS] updated: b629c24e4dc15257ae8d70f63d037c12668a491a

git at public.curoverse.com git at public.curoverse.com
Thu Dec 4 10:51:44 EST 2014


Summary of changes:
 apps/workbench/app/helpers/version_helper.rb                 | 12 ++++++++++++
 .../app/views/application/_report_issue_popup.html.erb       |  4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

       via  b629c24e4dc15257ae8d70f63d037c12668a491a (commit)
      from  3374f67bfe90aeae87389ca323a3bfac123ac7ea (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b629c24e4dc15257ae8d70f63d037c12668a491a
Author: Tim Pierce <twp at curoverse.com>
Date:   Thu Dec 4 10:50:44 2014 -0500

    4465: added api_version_text helper.
    
    Per code review: the source_version returned in the discovery document
    may include the string "-modified" if the API server is running from a
    locally modified repository.  The api_version_link that we generate for
    this version must take that into account.

diff --git a/apps/workbench/app/helpers/version_helper.rb b/apps/workbench/app/helpers/version_helper.rb
index 0d021fa..54470ae 100644
--- a/apps/workbench/app/helpers/version_helper.rb
+++ b/apps/workbench/app/helpers/version_helper.rb
@@ -1,10 +1,22 @@
 module VersionHelper
   include ArvadosApiClientHelper
 
+  # api_version returns the git commit hash for the API server's current version.
+  # It is extracted from api_version_text, which returns the source_version provided
+  # by the discovery document and may have the word "-modified" appended to it (if
+  # the API server is running from a locally modified repository).
+
   def api_version()
+    api_version_text().sub(/[^[:xdigit:]].*/, '')
+  end
+
+  def api_version_text()
     arvados_api_client.discovery[:source_version]
   end
 
+  # wb_version and wb_version_text provide the same strings for the
+  # code version that this Workbench is currently running.
+
   def wb_version()
     Rails.configuration.source_version
   end
diff --git a/apps/workbench/app/views/application/_report_issue_popup.html.erb b/apps/workbench/app/views/application/_report_issue_popup.html.erb
index 4b25737..705ddff 100644
--- a/apps/workbench/app/views/application/_report_issue_popup.html.erb
+++ b/apps/workbench/app/views/application/_report_issue_popup.html.erb
@@ -3,7 +3,7 @@
   arvados_base = Rails.configuration.arvados_v1_base
   support_email = Rails.configuration.support_email_address
 
-  api_version_link = link_to api_version, "https://github.com/curoverse/arvados/tree/#{api_version}/services/api"
+  api_version_link = link_to api_version_text, "https://github.com/curoverse/arvados/tree/#{api_version}/services/api"
   wb_version_link = link_to wb_version_text, "https://github.com/curoverse/arvados/tree/#{wb_version}/apps/workbench"
 
   additional_info = {}
@@ -12,7 +12,7 @@
 
   additional_info_str = additional_info.map {|k,v| "#{k}=#{v}"}.join("\n")
 
-  additional_info['api_version'] = api_version
+  additional_info['api_version'] = api_version_text
   additional_info['generated_at'] = generated_at
   additional_info['workbench_version'] = wb_version_text
   additional_info['arvados_base'] = arvados_base

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list