-
Notifications
You must be signed in to change notification settings - Fork 32
[CLOUDP-361632] Add functionality to upload release info to GitHub release assets #623
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
Conversation
nammn
left a comment
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.
LGTM! questions:
- automate?
- depends_on?
| run_on: | ||
| - ubuntu2404-small | ||
| allowed_requesters: ["patch", "github_tag"] | ||
| # depends_on: |
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.
this should be uncommented, right?
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.
yes
| - func: install_macos_notarization_service | ||
| - func: release_kubectl_mongodb_plugin | ||
|
|
||
| - name: add_releaseinfo_to_github_assets |
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.
do we add this to the image release? Right now its only manually run, right?
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.
yes.
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.
yes to both? So you will make a change in this PR to make it run automatically, right?
|
|
||
| def convert_to_release_info_json(build_info: BuildInfo) -> dict: | ||
| output = { | ||
| def convert_to_release_info_json(build_info: BuildInfo, version: str) -> dict: |
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.
b: version can only be used by operator related images. READINESS_PROBE_IMAGE and UPGRADE_HOOK_IMAGE have their own versions in release.json.
nit: version -> operator_version
|
|
||
| for name, image in images.items(): | ||
| output["images"][name] = { | ||
| release_info_output["images"][name] = { |
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 think it would be simpler to just iterate over images = {name: build_info.images[name] for name in RELEASE_INFO_IMAGES_ORDERED
and then go manually with OPS_MANAGER_IMAGE and AGENT_IMAGE:
# add operator related images
images = {name: build_info.images[name] for name in RELEASE_INFO_IMAGES_ORDERED
for name, image in images.items():
add_image(name, image.repositories, image.platforms, version)
# add Ops Manager image
om_image = build_info.images[OPS_MANAGER_IMAGE]
om_version = latest_om_version(release_data)
add_image(OPS_MANAGER_IMAGE, om_image.repositories, om_image.platforms, om_version)
# add Agent image
agent_image = build_info.images[AGENT_IMAGE]
agent_version = latest_agent_version(release_data)
add_image(AGENT_IMAGE, agent_image.repositories, agent_image.platforms, agent_version)|
|
||
| # add search image detail | ||
| release_info_output["images"][SEARCH_IMAGE] = { | ||
| "repositories": SEARCH_IMAGE_REPOSITORY, |
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 would rather move this information to release.json and create a proper object under supportedImages, something like:
"supportedImages": {
"mongodb-search": {
"repository": "quay.io/mongodb/mongodb-search",
"platforms": [
"linux/arm64",
"linux/amd64"
],
"version": "0.55.0"
}
}| BuildInfo, | ||
| load_build_info, | ||
| ) | ||
| from scripts.release.kubectl_mongodb.promote_kubectl_plugin import upload_assets_to_github_release |
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.
nit: upload_assets_to_github_release will not be relevant only to promote_kubectl_plugin so it should be placed somewhere else
Summary
As discussed in the base PR, customers have been asking us to provide some details that can be used to figure out the container images that they need to deploy a specific version of MCK and MongoDB instance.
This PR does that. It add the functionality to add a new file called
release_info_<release-version>.jsonto the GitHub release assets that would contain the details about MCK released images, OM, Agent, Search and the mapping between OM and agent's latest versions.This is how the file loos like
https://gist.github.com/viveksinghggits/628d93d09c186c51292a44d0c1f522d9
Proof of Work
Run the patch manually
and make sure the new file is added to the release.
Screen.Recording.2025-12-02.at.23.00.35.mov
Screen.Recording.2025-12-02.at.23.08.27.mov
Checklist
skip-changeloglabel if not needed