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

ci(release): dispatch custom event to trigger notifications #13837

Merged
merged 3 commits into from Dec 28, 2021

Conversation

sdepold
Copy link
Member

@sdepold sdepold commented Dec 28, 2021

Pull Request Checklist

Please make sure to review and check all of these items:

  • Have you added new tests to prevent regressions?
  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description Of Change

The notification flow can be triggered by sending a dispatch event to API including the release's ID. This change will automatically send such and event at the end of the release process.

Copy link
Member

@WikiRik WikiRik left a comment

Choose a reason for hiding this comment

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

I have some questions about this, but I also think I'm missing some context. Why would we need this release notifier?

.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@sdepold
Copy link
Member Author

sdepold commented Dec 28, 2021

I have some questions about this, but I also think I'm missing some context. Why would we need this release notifier?

This PR will cause releases to trigger the notify.yml GitHub workflow which is announcing new releases on Twitter and Open Collective.

@sdepold
Copy link
Member Author

sdepold commented Dec 28, 2021

@sdepold
Copy link
Member Author

sdepold commented Dec 28, 2021

Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
@sdepold
Copy link
Member Author

sdepold commented Dec 28, 2021

To explain in more depths, where this PR is coming from:

Originally, we were posting releases on Twitter in the ci.yml after the release stage finished.
I wanted to separate the notifications from the CI flow, since it feels kinda mixed concerns.

Hence there is now a notify.yml flow. Yesterday, I tried to have that flow to react to releases which were made by our semantic-release script. However, it turned out that one flow cannot possibly trigger another flow unless you make use of the dispatch functionality --> https://github.community/t/github-action-trigger-on-release-not-working-if-releases-was-created-by-automation/16559/6

So, that new notify.yml is now reacting on:

name: Notify release channels
on: repository_dispatch

In addition to posting on twitter (example: https://twitter.com/SequelizeJS/status/1475798293166833666), the new notify.yml will also call a new GitHub action (https://github.com/sequelize/proxy-release-to-open-collective) that will take the release and post a corresponding update on Open Collective (example: https://opencollective.com/sequelize/updates/release-of-sequelize-v7-0-0-alpha-3).

The somewhat nice part about the dispatch approach is the fact, that you can trigger the flow by sending a certain curl request. See here: https://github.com/sequelize/sequelize/blob/main/.github/workflows/notify.yml#L1-L5

@sdepold sdepold requested a review from WikiRik December 28, 2021 18:29
@sdepold
Copy link
Member Author

sdepold commented Dec 28, 2021

btw. if that is working out find, we could change the docs generation to trigger only after a release.

@WikiRik
Copy link
Member

WikiRik commented Dec 28, 2021

btw. if that is working out find, we could change the docs generation to trigger only after a release.

That would be nice

@sdepold sdepold merged commit 115b95b into main Dec 28, 2021
@sdepold sdepold deleted the trigger-notifications branch December 28, 2021 20:03
sdepold added a commit that referenced this pull request Dec 28, 2021
* ci(release): dispatch custom event to trigger notifications

* Update .github/workflows/ci.yml

Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>

Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2022

🎉 This PR is included in version 7.0.0-alpha.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2022

🎉 This PR is included in version 7.0.0-alpha2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

aliatsis pushed a commit to creditiq/sequelize that referenced this pull request Jun 2, 2022
…e#13837)

* ci(release): dispatch custom event to trigger notifications

* Update .github/workflows/ci.yml

Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>

Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants