Skip to content

Conversation

viveksinghggits
Copy link
Contributor

@viveksinghggits viveksinghggits commented Oct 9, 2025

Summary

Per current process when we try to release a version of the helm chart we create a PR to the mongodb/helm-charts repo. Since this is manual task, it's time consuming and error prone.
This PR tries to automate that manual task.

Proof of Work

The successful run here created the PR on helm chart repo successfully.

[2025/10/10 11:56:53.577] INFO     2025-10-10 09:56:53,577 [create_chart_release_pr]  Command succeeded
[2025/10/10 11:56:53.577] INFO     2025-10-10 09:56:53,577 [create_chart_release_pr]  Running command: git push -u origin mck-release-x.y.z in directory /data/mci/7faac8b315a48c50db2b095e7185d1ea/tmp/tmp0nfkyg_w/helm-charts
[2025/10/10 11:56:54.444] INFO     2025-10-10 09:56:54,443 [create_chart_release_pr]  Command succeeded
[2025/10/10 11:56:54.444] INFO     2025-10-10 09:56:54,444 [create_chart_release_pr]  Creating the pull request in the helm-charts repo.
[2025/10/10 11:56:55.762] INFO     2025-10-10 09:56:55,762 [create_chart_release_pr]  Successfully created Pull Request https://github.com/mongodb/helm-charts/pull/516
[2025/10/10 11:56:55.801] Finished command 'subprocess.exec' in function 'create_chart_release_pr' (step 3.2 of 3) in 2.73136881s.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

@viveksinghggits viveksinghggits requested a review from a team as a code owner October 9, 2025 17:28
Copy link

github-actions bot commented Oct 9, 2025

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.6.0 Release Notes

New Features

  • MongoDBCommunity: Added support to configure custom cluster domain via newly introduced spec.clusterDomain resource field. If spec.clusterDomain is not set, environment variable CLUSTER_DOMAIN is used as cluster domain. If the environment variable CLUSTER_DOMAIN is also not set, operator falls back to cluster.local as default cluster domain.
  • Helm Chart: Introduced two new helm fields operator.podSecurityContext and operator.securityContext that can be used to configure securityContext for Operator deployment through Helm Chart.

Bug Fixes

  • Fixed parsing of the customEnvVars Helm value when values contain = characters.

@viveksinghggits viveksinghggits added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Oct 10, 2025
@viveksinghggits viveksinghggits changed the title Automate PR creation to release helm chart using gh helm repo [CLOUDP-350567] Automate PR creation to release helm chart using gh helm repo Oct 10, 2025
Copy link
Collaborator

@MaciejKaras MaciejKaras left a comment

Choose a reason for hiding this comment

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

Code generally looks good, but I have two general comments:

  • instead of logging error and returning the error code, it's easier to just repackage the error and raise it again:
except GithubException as e:
    raise Exception(f"ERROR: Could not create Pull Request. GitHub API returned an error: {e.status}, details: {e.data}, original error: {e}")
  • the main method does a little too much. It should only handle flags parsing and validation. After that call nested method with validated args that does the hard work.

@viveksinghggits
Copy link
Contributor Author

Hi @MaciejKaras,
Can you please have another look into this PR.

Copy link
Collaborator

@MaciejKaras MaciejKaras left a comment

Choose a reason for hiding this comment

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

LGMT! Nice work, great to see this automated eventually! 💪

@viveksinghggits
Copy link
Contributor Author

Hi @m1kola @Julien-Ben ,
Can you please have a look into the PR as well.

1. Change info to debug
2. Specify types of arguments in run_command
Copy link
Collaborator

@Julien-Ben Julien-Ben left a comment

Choose a reason for hiding this comment

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

Left a few nit, but it's so great to have this automation ! Well done 👏

@viveksinghggits viveksinghggits merged commit 67fe13f into master Oct 16, 2025
6 of 7 checks passed
@viveksinghggits viveksinghggits deleted the automate-helm-release-pr branch October 16, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants