[ARVADOS] updated: 3f904a5ede4a8ed57dc93b20bc61427af21c8b36

git at public.curoverse.com git at public.curoverse.com
Fri Dec 5 01:55:18 EST 2014


Summary of changes:
 apps/workbench/app/helpers/application_helper.rb   |  2 --
 apps/workbench/app/helpers/version_helper.rb       | 29 +++++++++++-----------
 .../views/application/_report_issue_popup.html.erb |  4 +--
 apps/workbench/config/application.default.yml      |  2 +-
 .../test/integration/report_issue_test.rb          | 10 +++++---
 services/api/config/application.default.yml        |  2 +-
 6 files changed, 25 insertions(+), 24 deletions(-)

       via  3f904a5ede4a8ed57dc93b20bc61427af21c8b36 (commit)
      from  bfaa0f8f3547fe8d08312f3fd08a0828faf647f5 (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 3f904a5ede4a8ed57dc93b20bc61427af21c8b36
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Dec 5 01:49:26 2014 -0500

    4465: Link to arvados.org revision history instead of github.com code view.
    
    Also, remove spurious helper inclusions, and fix 'locally modified'
    detection (it was broken because "" is truthy).
    
    refs #4465

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index e003b2c..f1502af 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -1,6 +1,4 @@
 module ApplicationHelper
-  include VersionHelper
-
   def current_user
     controller.current_user
   end
diff --git a/apps/workbench/app/helpers/version_helper.rb b/apps/workbench/app/helpers/version_helper.rb
index 54470ae..6cae78f 100644
--- a/apps/workbench/app/helpers/version_helper.rb
+++ b/apps/workbench/app/helpers/version_helper.rb
@@ -1,29 +1,30 @@
 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).
 
-  # 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:]].*/, '')
+  def api_version
+    api_version_text.sub(/[^[:xdigit:]].*/, '')
   end
 
-  def api_version_text()
+  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()
+  def wb_version
     Rails.configuration.source_version
   end
 
-  def wb_version_text()
-    wbv = wb_version
-    wbv += Rails.configuration.local_modified if Rails.configuration.local_modified
-    wbv
+  def wb_version_text
+    wb_version + (Rails.configuration.local_modified or '')
+  end
+
+  def version_link_target version
+    "https://arvados.org/projects/arvados/repository/changes?rev=#{version}"
   end
 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 705ddff..315116b 100644
--- a/apps/workbench/app/views/application/_report_issue_popup.html.erb
+++ b/apps/workbench/app/views/application/_report_issue_popup.html.erb
@@ -3,8 +3,8 @@
   arvados_base = Rails.configuration.arvados_v1_base
   support_email = Rails.configuration.support_email_address
 
-  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"
+  api_version_link = link_to api_version_text, version_link_target(api_version)
+  wb_version_link = link_to wb_version_text, version_link_target(wb_version)
 
   additional_info = {}
   additional_info['Current location'] = params[:current_location]
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 7e95bb3..b485276 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -38,7 +38,7 @@ development:
   assets.debug: true
   profiling_enabled: true
   site_name: Arvados Workbench (dev)
-  local_modified: <%= '-modified' if `git status -s` %>
+  local_modified: "<%= '-modified' if `git status -s` != '' %>"
 
   # API server configuration
   arvados_login_base: ~
diff --git a/apps/workbench/test/integration/report_issue_test.rb b/apps/workbench/test/integration/report_issue_test.rb
index 3af7f92..ac9e596 100644
--- a/apps/workbench/test/integration/report_issue_test.rb
+++ b/apps/workbench/test/integration/report_issue_test.rb
@@ -37,10 +37,12 @@ class ReportIssueTest < ActionDispatch::IntegrationTest
       assert page.has_no_text?('Describe the problem?'), 'Found text - Describe the problem'
       assert page.has_button?('Close'), 'No button - Close'
       assert page.has_no_button?('Send problem report'), 'Found button - Send problem report'
-      api_version_rgx = %r!^https://github.com/curoverse/arvados/tree/[0-9a-f]+/services/api/?$!
-      wb_version_rgx = %r!^https://github.com/curoverse/arvados/tree/[0-9a-f]+/apps/workbench/?$!
-      assert_not_empty(all("a").select { |a| a[:href] =~ wb_version_rgx })
-      assert_not_empty(all("a").select { |a| a[:href] =~ api_version_rgx })
+      history_links = all('a').select do |a|
+        a[:href] =~ %r!^https://arvados.org/projects/arvados/repository/changes\?rev=[0-9a-f]+$!
+      end
+      assert_operator(2, :<=, history_links.count,
+                      "Should have found two links to revision history " +
+                      "in #{history_links.inspect}")
       click_button 'Close'
     end
 
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 253f12a..fb94402 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -15,7 +15,7 @@ development:
   active_record.auto_explain_threshold_in_seconds: 0.5
   assets.compress: false
   assets.debug: true
-  local_modified: <%= '-modified' if `git status -s` %>
+  local_modified: "<%= '-modified' if `git status -s` != '' %>"
 
 production:
   force_ssl: true

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list