[SERVER-29422] Respect version.json in Evergreen patch builds Created: 02/Jun/17  Updated: 30/Oct/23  Resolved: 15/Aug/17

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.5.12

Type: Improvement Priority: Major - P3
Reporter: Michael Cahill (Inactive) Assignee: Brian Samek
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-21977 Make evergreen patch builds have uniq... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v3.4, v3.2
Sprint: Evergreen 2017-08-15
Participants:

 Description   

To create a patch build that can be deployed with Ops Manager, it is currently necessary to update both etc/evergreen.yml to include a custom version string and create a version.json file to set the githash, which repeats (hopefully) the version string. See this patch build for an example.

I propose that we make the change ramon.fernandez suggested in SERVER-21977, and if a version.json file is included in a patch, have it be the source of truth.

Something like:

--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -76,6 +76,12 @@ variables:
       set -o errexit
       set -o verbose
 
+      # If the build supplies a version.json file, use it.
+      if [ -f version.json ]; then
+        SCONS_CACHE_MODE=${scons_cache_mode|nolinked} USE_SCONS_CACHE=${use_scons_cache|false} ${python|/opt/mongodbtoolchain/v2/bin/python2} buildscripts/generate_compile_expansions.py version.json | tee compile_expansions.yml
+        exit
+      fi
+
       # We get the raw version string (r1.2.3-45-gabcdef) from git
       MONGO_VERSION=$(git describe)
       # If this is a patch build, we add the patch version id to the version string so we know



 Comments   
Comment by Githook User [ 15/Aug/17 ]

Author:

{'username': 'bsamek', 'email': 'brian.samek@mongodb.com', 'name': 'Brian Samek'}

Message: SERVER-29422 Respect version.json in patch builds
Branch: master
https://github.com/mongodb/mongo/commit/4824a25019fda373d8d149e117c857fcfbf77ad0

Comment by Andrew Morrow (Inactive) [ 03/Jun/17 ]

I have a slightly different proposal. I think we should stop using the scons MONGO_VERSION= form in etc/evergreen.yml entirely. The fact that we re-iterate the git-describe logic there is unfortunate. SCons will already honor any version.json file, unless values are overridden on the command line, and will fall back go git-describe if neither of the above mechanisms are in play. So, if we stop setting MONGO_VERSION on the command line, adding a version.json file to your patch will just do the right thing. In the event that evergreen is running a patch build, and that patch doesn't contain a version.json file, then we can write one which injects the \${version_id} of the patch, achieving the desired effect.

Though, much as ramon.fernandez says, we could always move forward with michael.cahill's suggestion for now and then migrate to this solution later.

Generated at Thu Feb 08 04:20:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.