Skip to content

CLOUDP-114066: [MongoCLI] The json file of the download center doesn’t contain the release version #1008

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 8 commits into from
Mar 1, 2022

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Mar 1, 2022

Proposed changes

Jira ticket: CLOUDP-114066

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 are not adding the release version when generating the download center json file.

{
  "previous_releases_link": "https://github.com/mongodb/mongocli/releases",
  "release_date": "2022-02-28T17:01:01.938089Z",
  "release_notes_link": "https://docs.mongodb.com/mongocli/v/release-notes/",
  "tutorial_link": "https://docs.mongodb.com/mongocli/v/quick-start/",
  "version": "",
  "manual_link": "https://docs.mongodb.com/mongocli/v/",
  "platform": [
    {
      "arch": "x86_64",
      "os": "Linux (x86_64)",
      "packages": {
        "title": "MongoDB CLI",
        "links": [
          {
            "download_link": "https://fastdl.mongodb.org/mongocli/mongocli__linux_x86_64.tar.gz",
            "name": "tar.gz"
          }
        ]
      }
    },

New download center JSON files:

@andreaangiolillo andreaangiolillo requested a review from gssbzn March 1, 2022 12:03
@andreaangiolillo andreaangiolillo marked this pull request as ready for review March 1, 2022 12:03
@andreaangiolillo andreaangiolillo requested a review from a team March 1, 2022 12:03
VERSION=$(git describe | cut -d "v" -f 2)

go run ../internal/release/main.go "${VERSION}" "${FEED_FILE_NAME}"
go run ../internal/release/main.go --version "$(git describe | cut -d "v" -f 2)" --file "${FEED_FILE_NAME}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

git describe may not work anymore with a mono repo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looking at the JSON files generated by the package tasks it seems to work properly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have also made some tests locally and on evergreen and I haven’t found any issue with git describe

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry what I mean is that git describe will get you the latest tag, for now it works since we only release one thing, this may become flaky later

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the clarification!
I don't think this is an issue: you are right that the tag returned by git describe will be different when releasing atlascli v0.0.1 as the mongocli.json file will contain the version 0.0.1 when running the packaging tasks. However, this won't happen when running releasing tasks as the latest tag will always be the correct one. Let me know if I am missing something here. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

not missing much and why I say may become flaky, race conditions may happen if releasing both the same day

Also this leaves us in a position where master json files will always point to latest, ie, when we do 0.0.1 of atlas we'll have the mongocli json with 0.0.1 as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am going to create a ticket to see how to fix this issue. I will start working on it once I have pre-released atlascli

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@andreaangiolillo andreaangiolillo requested a review from gssbzn March 1, 2022 12:12

func Builder() *cobra.Command {
opts := Opts{}
cmd := &cobra.Command{
Copy link
Collaborator

Choose a reason for hiding this comment

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

[non-blocking] using cobra for this is an overkill if you ask me, you could've used pflags with no need to bring cobra as well

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 thanks for fixing the flags

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.

3 participants