-
Notifications
You must be signed in to change notification settings - Fork 14
Enable staging
build scenario that was commented out by default
#362
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
base: master
Are you sure you want to change the base?
Conversation
MCK 1.3.0 Release NotesBug Fixes
Other Changes
|
# elif is_evg: | ||
# scenario = BuildScenario.STAGING | ||
# logger.info(f"Build scenario: {scenario} (patch_id: {patch_id})") | ||
elif is_evg: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can this work? Have we tested this? if is_evg
is true, then its always patch already, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I wrote the infer method I matched our previous code for the usage of env variables. If is_patch
is false but is_evg
is true, then we are on master.
I'm confused by the above elif
tho.
elif is_patch or is_evg
seems incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we really need a way to test those things in the ci/e2e outside of requiring to merge to master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Julien-Ben,
I was looking at the docs here https://docs.devprod.prod.corp.mongodb.com/evergreen/Reference/Comparison#whats-a-version-or-patch and here and it is not very clear that is_patch
is going to be false if the build is run from the master merge. Do you have reference to a documentation that we can use to confirm that is_patch
is false in case of builds to master merges.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to dig as much as I could in the documentation and commented everything in methods (they were moved to constants.py
)
Do the following explanations help ? That's the best I could find
def triggered_by_git_tag() -> str | None:
"""
"triggered_by_git_tag" is the name of the tag that triggered this version, if applicable. It will be None for
all patches except when tagging a commit on GitHub
:return: tag name if the build was triggered by a git tag, otherwise None.
"""
return os.getenv("triggered_by_git_tag")
def is_evg_patch() -> bool:
"""
A patch build is a version not triggered by a commit to a repository. "is_patch" is passed automatically by Evergreen.
It either runs tasks on a base commit plus some diff if submitted by the CLI or on a git branch if created by
a GitHub pull request.
:return: "true" if the running task is in a patch build, otherwise "false".
"""
return os.getenv("is_patch", "false").lower() == "true"
def is_running_in_evg() -> bool:
"""
"RUNNING_IN_EVG" is set by us in evg-private-context
:return: "true" if the script is running in Evergreen, otherwise "false".
"""
return os.getenv("RUNNING_IN_EVG", "false").lower() == "true"
def get_version_id() -> str | None:
"""
Get the version ID from the environment variable. This is typically used for patch builds in the Evergreen CI system.
It is generated automatically for each task run. For example: `6899b7e35bfaee00077db986` for a manual/PR patch,
or `mongodb_kubernetes_5c5a3accb47bb411682b8c67f225b61f7ad5a619` for a master merge
:return: version_id (patch ID) or None if not set
"""
return os.getenv("version_id")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code doesn't seem to work semantically, can we have a proof of work?
I will verify this and update. |
Summary
The
staging
build scenario was commented out by default because we have not been using it in our workflows. But after this PR gets merged we will start using the the staging build scenario for kubectl plugin to build and push it to the staging bucket. That's why this PR enables that build scenario.Proof of Work
Once the PR #320 related to kubectl plugin gets merged the goreleaser artifacts should be pushed to the
mongodb-kubernetes-staging/kubectl-mongodb/<commit-sha>
path.Checklist
skip-changelog
label if not needed