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

Remove Slack notifications for CI failures #4928

Conversation

waiting-for-dev
Copy link
Contributor

@waiting-for-dev waiting-for-dev commented Feb 9, 2023

Summary

We were storing the Slack secrets on a CircleCI context. Although we were also passing them to forks, it resulted on unauthorized builds for external contributions.

We could work around the issue in two ways:

  • Having the secrets outside of any context, but that would compromise the security of the associated Slack channel for:
    • Send messages as @CircleCI notifications
    • Send messages to channels @CircleCI notifications isn't a member of
    • Upload, edit, and delete files as CircleCI notifications
  • Using CircleCI logic statements to conditionally run jobs when CIRCLECI_USERNAME or CIRCLE_PR_USERNAME env vars are in a list of allowed users. However, that would be something difficult to maintain, and there's no other way to check the user's role.

Given that we don't find those trade-offs to be acceptable, we remove the integration for now.

Closes #4902

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@waiting-for-dev waiting-for-dev requested a review from a team as a code owner February 9, 2023 12:22
@waiting-for-dev waiting-for-dev added changelog:repository Changes to the repository not within any gem type:bug Error, flaw or fault backport-v3.2 backport-v3.3 Backport this pull-request to v3.3 and removed changelog:repository Changes to the repository not within any gem labels Feb 9, 2023
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/remove_slack_notification branch from dd238e7 to 9d82893 Compare February 9, 2023 13:08
@github-actions github-actions bot removed the changelog:repository Changes to the repository not within any gem label Feb 9, 2023
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/remove_slack_notification branch from 9d82893 to 16b10a5 Compare February 9, 2023 13:08
We were storing the Slack secrets on a CircleCI context [1]. Although we
were also passing them to forks [2], it resulted on unauthorized builds
for external contributions.

We could work around the issue in two ways:

- Having the secrets outside of any context, but that would compromise
 the security of the associated Slack channel for:
  - Send messages as @circleci notifications
  - Send messages to channels @circleci notifications isn't a member of
  - Upload, edit, and delete files as CircleCI notifications
- Using CircleCI logic statements [3] to conditionally run jobs when
`CIRCLECI_USERNAME` or `CIRCLE_PR_USERNAME` env vars [4] are in a list
of allowed users. However, that would be something difficult to
maintain, and there's no other way to check the user's role.

Given that we don't find those trade-offs to be acceptable, we remove
the integration for now.

[1] - https://circleci.com/docs/contexts/
[2] - https://circleci.com/docs/oss/#pass-secrets-to-builds-from-forked-pull-requests
[3] - https://circleci.com/docs/configuration-reference/#logic-statements
[4] - https://circleci.com/docs/variables/
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/remove_slack_notification branch from 16b10a5 to 07307ea Compare February 9, 2023 13:09
@waiting-for-dev waiting-for-dev added the changelog:repository Changes to the repository not within any gem label Feb 9, 2023
@kennyadsl
Copy link
Member

@waiting-for-dev are we using the same approach on other repositories?

@waiting-for-dev waiting-for-dev removed backport-v3.2 backport-v3.3 Backport this pull-request to v3.3 labels Feb 9, 2023
@waiting-for-dev
Copy link
Contributor Author

@waiting-for-dev are we using the same approach on other repositories?

Sure! I referenced all the similar PR on the original issue: #4902 (comment)

@waiting-for-dev waiting-for-dev merged commit 32f2513 into solidusio:master Feb 10, 2023
@waiting-for-dev waiting-for-dev deleted the waiting-for-dev/remove_slack_notification branch February 10, 2023 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:repository Changes to the repository not within any gem type:bug Error, flaw or fault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix contributions from forks not being able to run CI
4 participants