Skip to content

CLOUDP-114080: [Mongocli] Investigate how to get the correct git tag version in evergreen #1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 4, 2022

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Mar 3, 2022

Proposed changes

Jira ticket: CLOUDP-114080

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
  • I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
  • I have updated e2e/E2E-TESTS.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

Issue: We have several evergreen tasks that are using git describe to get the latest tag version available. Git describe will get you the latest tag, for now it works since we only release one thing, this may become flaky later. This PR address this comment #1008 (comment)

Nre Version format for non-production binaries: vX.Y.Z-next.

make build
==> Building mongocli binary
go build -ldflags "-s -w -X github.com/mongodb/mongocli/internal/version.GitCommit=cf0d9451ce3aec441493053a48c9d18286b12bd2 -X github.com/mongodb/mongocli/internal/config.ToolName=mongocli -X github.com/mongodb/mongocli/internal/version.Version=1.23.0-next" -o ./bin/mongocli ./cmd/mongocli
./bin/mongocli --version
mongocli version: 1.23.0-next
git version: cf0d9451ce3aec441493053a48c9d18286b12bd2
Go version: go1.17
   os: darwin
   arch: amd64
   compiler: gc

We use git describe if the tag is not found.

make build-atlascli
==> Building atlas binary
go build -ldflags "-s -w -X github.com/mongodb/mongocli/internal/version.GitCommit=11f126fcf02994e500b73bfa4a9b437fff8c7415 -X github.com/mongodb/mongocli/internal/config.ToolName=atlascli -X github.com/mongodb/mongocli/internal/version.Version=1.23.0-24-g11f126fc" -o ./bin/atlas ./cmd/atlas
➜  ~/workspace/mongocli git:(CLOUDP-114080) ./bin/atlas --version
atlascli version: 1.23.0-24-g11f126fc
git version: 11f126fcf02994e500b73bfa4a9b437fff8c7415
Go version: go1.17
   os: darwin
   arch: amd64
   compiler: gc

I have tested my fix using this fork https://github.com/andreaangiolillo/mongocli-test/releases which contains atlascli tags

@andreaangiolillo andreaangiolillo requested a review from gssbzn March 4, 2022 08:34
@andreaangiolillo andreaangiolillo marked this pull request as ready for review March 4, 2022 08:34
@andreaangiolillo andreaangiolillo requested a review from a team March 4, 2022 08:34
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing this one https://github.com/mongodb/mongocli/blob/master/build/package/generate-msi.sh

probably a good idea to do a search/grep for git describe in the whole repo to make sure we don't miss one

@andreaangiolillo andreaangiolillo requested a review from gssbzn March 4, 2022 11:23
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and godspeed with your first atlas alpha

@andreaangiolillo andreaangiolillo merged commit 5db0fa1 into master Mar 4, 2022
@andreaangiolillo andreaangiolillo deleted the CLOUDP-114080 branch March 4, 2022 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants