[ARVADOS] created: 3374f67bfe90aeae87389ca323a3bfac123ac7ea

git at public.curoverse.com git at public.curoverse.com
Wed Dec 3 12:00:42 EST 2014


        at  3374f67bfe90aeae87389ca323a3bfac123ac7ea (commit)


commit 3374f67bfe90aeae87389ca323a3bfac123ac7ea
Author: Tim Pierce <twp at curoverse.com>
Date:   Wed Dec 3 11:56:08 2014 -0500

    4465: add API/Workbench Github links to help modal
    
    Updated the help modal dialog to use the following links for API version
    and Workbench version:
    
    https://github.com/curoverse/arvados/tree/#{api_version}/services/api
    https://github.com/curoverse/arvados/tree/#{wb_version}/apps/workbench
    
    Refactored some code into a VersionHelper to simplify testing.
    
    Also updated the Rails.configuration.source_version settings for both
    API server and Workbench to strip trailing newlines (which were
    screwing up the URLs).

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index c8c4ccc..bc828c4 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -1,4 +1,6 @@
 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
new file mode 100644
index 0000000..0d021fa
--- /dev/null
+++ b/apps/workbench/app/helpers/version_helper.rb
@@ -0,0 +1,17 @@
+module VersionHelper
+  include ArvadosApiClientHelper
+
+  def api_version()
+    arvados_api_client.discovery[:source_version]
+  end
+
+  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
+  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 fe47fb0..4b25737 100644
--- a/apps/workbench/app/views/application/_report_issue_popup.html.erb
+++ b/apps/workbench/app/views/application/_report_issue_popup.html.erb
@@ -1,11 +1,11 @@
 <%
-  api_version = arvados_api_client.discovery[:source_version]
   generated_at = arvados_api_client.discovery[:generatedAt]
-  wb_version = Rails.configuration.source_version
-  wb_version += Rails.configuration.local_modified if Rails.configuration.local_modified
   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"
+  wb_version_link = link_to wb_version_text, "https://github.com/curoverse/arvados/tree/#{wb_version}/apps/workbench"
+
   additional_info = {}
   additional_info['Current location'] = params[:current_location]
   additional_info['User UUID'] = current_user.uuid if current_user
@@ -14,7 +14,7 @@
 
   additional_info['api_version'] = api_version
   additional_info['generated_at'] = generated_at
-  additional_info['workbench_version'] = wb_version
+  additional_info['workbench_version'] = wb_version_text
   additional_info['arvados_base'] = arvados_base
   additional_info['support_email'] = support_email
   additional_info['error_message'] = params[:error_message] if params[:error_message]
@@ -71,14 +71,14 @@
         <div class="form-group">
           <label for="wb_version" class="col-sm-4 control-label"> Workbench version </label>
           <div class="col-sm-8">
-            <p class="form-control-static" name="wb_version"><%=wb_version%></p>
+            <p class="form-control-static" name="wb_version"><%= wb_version_link %></p>
           </div>
         </div>
 
         <div class="form-group">
           <label for="server_version" class="col-sm-4 control-label"> API version </label>
           <div class="col-sm-8">
-            <p class="form-control-static" name="server_version"><%=api_version%></p>
+            <p class="form-control-static" name="server_version"><%= api_version_link %></p>
           </div>
         </div>
 
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 8d5c616..7e95bb3 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -170,7 +170,7 @@ common:
   user_profile_form_message: Welcome to Arvados. All <span style="color:red">required fields</span> must be completed before you can proceed.
 
   # source_version
-  source_version: "<%= `git log -n 1 --format=%h` %>"
+  source_version: "<%= `git log -n 1 --format=%h`.strip %>"
   local_modified: false
 
   # report notification to and from addresses
diff --git a/apps/workbench/test/integration/report_issue_test.rb b/apps/workbench/test/integration/report_issue_test.rb
index 4bf7d57..7eb65a2 100644
--- a/apps/workbench/test/integration/report_issue_test.rb
+++ b/apps/workbench/test/integration/report_issue_test.rb
@@ -1,8 +1,11 @@
 require 'integration_helper'
 require 'selenium-webdriver'
 require 'headless'
+require_relative '../../app/helpers/version_helper'
 
 class ReportIssueTest < ActionDispatch::IntegrationTest
+  include VersionHelper
+
   setup do
     headless = Headless.new
     headless.start
@@ -35,6 +38,8 @@ class ReportIssueTest < ActionDispatch::IntegrationTest
       assert page.has_text?('Version / debugging info'), 'No text - Version / debugging info'
       assert page.has_no_text?('Report a problem'), 'Found text - Report a problem'
       assert page.has_no_text?('Describe the problem?'), 'Found text - Describe the problem'
+      assert page.has_link?(api_version), 'No link for API version'
+      assert page.has_link?(wb_version_text), 'No link for Workbench version'
       assert page.has_button?('Close'), 'No button - Close'
       assert page.has_no_button?('Send problem report'), 'Found button - Send problem report'
       click_button 'Close'
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index cc46d04..253f12a 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -236,7 +236,7 @@ common:
   auto_setup_name_blacklist: [arvados, git, gitolite, gitolite-admin, root, syslog]
 
   # source_version
-  source_version: "<%= `git log -n 1 --format=%h` %>"
+  source_version: "<%= `git log -n 1 --format=%h`.strip %>"
   local_modified: false
 
   # Default lifetime for ephemeral collections: 2 weeks.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list