[SERVER-41038] The results of git describe for MONGO_VERSION vary by git version Created: 07/May/19  Updated: 29/Oct/23  Resolved: 07/May/19

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 4.0.10, 4.1.11

Type: Bug Priority: Critical - P2
Reporter: Andrew Morrow (Inactive) Assignee: Mathew Robinson (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v4.0, v3.6, v3.4, v3.2
Sprint: Dev Tools 2019-05-20
Participants:

 Description   

Newer versions of git have changed the way the number of abbrev characters are computed.

The result is that MONGO_VERSION may be computed differently in the compile expansions depending on what git version is running locally.

This manifested in the embedded builders, where the build of the SDK ran on a machine that generated a 10 character abbrev string, but a consuming task ran on a machine with an older version of git that expected only 7. Since the filenames didn't match, the consuming task failed:

There seems to be another issue as well, where even though the same machine image is used, sometimes we get a 10 digit abbrev, and sometimes 7.

On the same commit:

So this suggests that perhaps we have a gitconfig or inconsistent git versions across the macOS fleet.

In any event, we should hardcode an abbrev size in all locations where we invoke git describe.



 Comments   
Comment by Githook User [ 20/May/19 ]

Author:

{'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson', 'username': 'chasinglogic'}

Message: SERVER-41038 Add --abbrev to git describe in build.gradle

(cherry picked from commit 76a51318e3d46bae41f72bfcf88c3f1782ad093f)
Branch: v4.0
https://github.com/mongodb/mongo/commit/1abaaa8acfee22098bf357683e4b4d7d47a51350

Comment by Githook User [ 20/May/19 ]

Author:

{'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson', 'username': 'chasinglogic'}

Message: SERVER-41038 Guarantee that git describe returns the same number of digits regardless of version

(cherry picked from commit 14c4a6e66351e07b1965622b4e8fb8d5bf0a04e2)
Branch: v4.0
https://github.com/mongodb/mongo/commit/9dddfaf93ce1c63acdb9b720fd5841dde4b402c7

Comment by Githook User [ 08/May/19 ]

Author:

{'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson', 'username': 'chasinglogic'}

Message: SERVER-41038 Add --abbrev to git describe in build.gradle
Branch: master
https://github.com/mongodb/mongo/commit/76a51318e3d46bae41f72bfcf88c3f1782ad093f

Comment by Githook User [ 07/May/19 ]

Author:

{'name': 'Mathew Robinson', 'username': 'chasinglogic', 'email': 'chasinglogic@gmail.com'}

Message: SERVER-41038 Guarantee that git describe returns the same number of digits regardless of version
Branch: master
https://github.com/mongodb/mongo/commit/14c4a6e66351e07b1965622b4e8fb8d5bf0a04e2

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