Bug #13668

[VERSION] add a human readable version as Default

Added by Nico César about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
07/09/2018
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
1.0
Release:
Release relationship:
Auto

Description

after #13667 is done /var/www/arvados-api/current/package-build.version will be available

making simple changes to lib/app_version.rb will make use of this to display:

1.1.4-1 (ff353df24)

in the version dialog in workbench.

API server:
  • add package_version config to application.yml so sysadmin can specify/override
  • add "package_version" method to AppVersion that uses the configured package version or reads the package.version file
  • add "packageVersion" to discovery doc, alongside "source_version"
Workbench:
  • add package_version config to application.yml so sysadmin can specify/override
  • add "package_version" method to AppVersion that uses the configured package version or reads the package.version file
  • report both package version and source version in the dialog box
    • source version still links to the commit in redmine
    • ...for both apiserver and workbench versions

Subtasks

Task #13726: Review 13668-api-wb-package-versionClosedLucas Di Pentima

Associated revisions

Revision eead78e2
Added by Lucas Di Pentima about 1 year ago

Merge branch '13668-api-wb-package-version'
Closes #13668

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <>

History

#2 Updated by Nico César about 1 year ago

  • Subject changed from [VERSION] add a human readable version as efault to [VERSION] add a human readable version as Default

#3 Updated by Tom Clegg about 1 year ago

  • Description updated (diff)

#4 Updated by Tom Clegg about 1 year ago

  • Story points set to 1.0

#5 Updated by Tom Morris about 1 year ago

  • Project changed from Arvados Private to Arvados
  • Target version changed from To Be Groomed to 2018-07-18 Sprint

#6 Updated by Lucas Di Pentima about 1 year ago

  • Assigned To set to Lucas Di Pentima

#7 Updated by Lucas Di Pentima about 1 year ago

  • Status changed from New to In Progress

#8 Updated by Lucas Di Pentima about 1 year ago

Updates at 6dd60d7c7 - branch 13668-api-wb-package-version
Test run: https://ci.curoverse.com/job/developer-run-tests/792/

Added package version information on both API & Workbench.
Package versions are displayed on WB's dialogs alongside source versions (commit hashes).

Although this story is blocked by #13667, I think it can be merged without it as it defaults to package version "unknown" when the package-build.version doesn't exist.

#9 Updated by Tom Clegg about 1 year ago

In the Ruby code, package_version is right, but in the discovery doc, the key should be packageVersion, to match [all but one of] the other config keys in the discovery doc. This is probably a good time to add sourceVersion, too (with same value as source_version) -- later we can update workbench to use sourceVersion, and then eventually remove the misfit source_version.

In AppVersion.package_version, if the package-build.version file doesn't exist, set @package_version to false, and change the || @package_version test to || !@package_version.nil? -- that way, if the file doesn't exist, it won't keep retrying on every page load. (This matters less on the API side because the discovery doc itself is cached, but we should fix it anyway just so the two copies of the code remain identical.)

The rest LGTM, thanks!

#10 Updated by Lucas Di Pentima about 1 year ago

Updates at 2c87b580a
Test run: https://ci.curoverse.com/job/developer-run-tests/796/

  • Replace package_version with packageVersion on discovery document (and adding sourceVersion too).
  • Enhanced package version caching on api server & wb.

Regarding the suggestion about using

if (cached = Rails.configuration.package_version || !@package_version.nil?)
  return cached
end

...I think that won't achieve the objective of not retrying reading the file. Instead what I did is assigning "unknown" to @package_version when the file doesn't exist.

#11 Updated by Tom Clegg about 1 year ago

Yes, you're right, !x.nil? would have messed up the assignment to cached. Your working version is better. :)

LGTM, thanks

#12 Updated by Lucas Di Pentima about 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

#13 Updated by Tom Morris about 1 year ago

  • Release set to 13

Also available in: Atom PDF