Skip to content
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

3069: Add a note for promotions #3079

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

bahaaTuffaha
Copy link
Contributor

Short Description

We need a way to show what is went from beta to prod.

Proposed Changes

  • Created a function called isLatestReleasePreRelease to check the releases and it looks for preRelease tag for each platform
  • Added the line [The most recent beta version was promoted to production] if the last release is beta on that platform.
    Note: I can go a step further and read the body of each release to get more details if needed !

Side Effects

  • manage-metadata.ts

Testing

n/a

Resolved Issues

Fixes: #3069


tools/github-preRelease-checker.ts Outdated Show resolved Hide resolved
tools/manage-metadata.ts Outdated Show resolved Hide resolved
@steffenkleinle steffenkleinle changed the title 3069: Added a note for beta releases 3069: Add a note for beta releases Feb 12, 2025
@steffenkleinle steffenkleinle changed the title 3069: Add a note for beta releases 3069: Add a note for promotions Feb 12, 2025
Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Nice work and great solution 🚀

tools/github-promote-release.ts Outdated Show resolved Hide resolved
tools/github-promote-release.ts Outdated Show resolved Hide resolved
tools/github-promote-release.ts Outdated Show resolved Hide resolved
tools/github-promote-release.ts Outdated Show resolved Hide resolved
Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

This is currently not working yet, see comments. I added a commit to test the web promotion message. We have to revert that before merging in the end. You can see the result here: https://app.circleci.com/pipelines/github/digitalfabrik/integreat-app/12888/workflows/47e8aaa6-a3c0-4d45-ab27-b96c216a7153/jobs/68536?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary

tools/github-promote-release.ts Outdated Show resolved Hide resolved
.circleci/src/jobs/promote_web.yml Outdated Show resolved Hide resolved
Comment on lines 27 to 32
command: |
PROMOTION_MESSAGE=$(yarn github-promote-release promote --platform android --deliverino-private-key ${DELIVERINO_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME})
echo "export PROMOTION_MESSAGE='${PROMOTION_MESSAGE}'" >> $BASH_ENV
working_directory: tools
- notify:
success_message: '${PROMOTION_MESSAGE}'
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Hmm, not sure if this works just like that if there was no release promoted. Probably this will still run with a unexpected message 🤔 Guess we have to test that.

Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

This is not working yet, see the CI job:
image

This is definitely not what we want to post to our mattermost channel or at least includes way too much output from the script execution. Perhaps have a look again at the other scripts we use in the CI and how we achieve it that only one message is used.
Furthermore, we don't want to post anything if there was no release promoted.
Please comment out the update in gtihub-promote-release again until this works correctly to avoid updating the release flag to non pre-release.

@bahaaTuffaha
Copy link
Contributor Author

This is definitely not what we want to post to our mattermost channel or at least includes way too much output from the script execution. Perhaps have a look again at the other scripts we use in the CI and how we achieve it that only one message is used. Furthermore, we don't want to post anything if there was no release promoted. Please comment out the update in gtihub-promote-release again until this works correctly to avoid updating the release flag to non pre-release.

How this is possible?

try {
      const promotedRelease = await removePreRelease(options)
      if (promotedRelease) {

I'm already checking if it's null 😥

@steffenkleinle
Copy link
Member

steffenkleinle commented Feb 19, 2025

This is definitely not what we want to post to our mattermost channel or at least includes way too much output from the script execution. Perhaps have a look again at the other scripts we use in the CI and how we achieve it that only one message is used. Furthermore, we don't want to post anything if there was no release promoted. Please comment out the update in gtihub-promote-release again until this works correctly to avoid updating the release flag to non pre-release.

How this is possible?

try {
      const promotedRelease = await removePreRelease(options)
      if (promotedRelease) {

I'm already checking if it's null 😥

Still a lot of things are logged to stdout. Basically every console.log (and console.debug) posts things to stdout, while console.warn and console.error post do stderr. If you compare how you run this script to how e.g. manage-metadata or next-version scripts are run, you'll notice the --silent flag and that all purely informational messages are logged via console.warn. If you change that accordingly, everything should work as expected :)

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.

Release note for deployments to production
2 participants