Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

ci: add owners awareness to deployment-notifier #33968

Closed
wants to merge 1 commit into from

Conversation

jhchabran
Copy link
Contributor

@jhchabran jhchabran commented Apr 15, 2022

Adds an additional flag to deployment-notifier to compute the owners for each PR and mentions them posting on Slack.

I haven't touched yet on how to handle team notifications, it's something that the teammateResolver can't handle for now.

Depends on: sourcegraph/codenotify#17

Closes https://github.com/sourcegraph/sourcegraph/issues/33923

Test plan

@jhchabran jhchabran added dx Issues and PRs related to developer experience concerns ci dx-announce Tag PRs with this label to include it in the monthly DX email update team/devx labels Apr 15, 2022
@jhchabran jhchabran requested review from davejrt and bobheadxi April 15, 2022 14:32
@cla-bot cla-bot bot added the cla-signed label Apr 15, 2022
}
for _, path := range paths {
fs := codenotify.NewGitFS(g.clonePath, ref)
ownersList, err := codenotify.Subscribers(fs, path, "CODENOTIFY")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

temp thing, because there aren't much OWNERS files, so this makes testing easier.

Comment on lines +27 to +29
{{- if .Owners }}
- Owners: {{- range .Owners}}{{ . }}{{" "}}{{- end}}
{{- end }}
Copy link
Member

Choose a reason for hiding this comment

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

This makes me nervous because there is no opt-out, and with staggered deploys this can be several pings a day

Copy link
Contributor Author

@jhchabran jhchabran Apr 21, 2022

Choose a reason for hiding this comment

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

@bobheadxi What do you think about adding in the handbook's data the following additional fields for each team member?

- Corgi MacDog 
  github: "woofwoof"
  notifications:
    deployments: 
      preprod: 
        author: true
        codeowners: false 
      cloud:
        author: true
        codeowners: true

With the following defaults, that could be overridden by the GitHub labels on PRs?

  notifications:
    deployments: 
      preprod: 
        author: false
        codeowners: false 
      cloud:
        author: true
        codeowners: true

Side note: presently, there are very few codeowners file in the repo and the team aliases do not ping, therefore they would ping even less.

Copy link
Member

Choose a reason for hiding this comment

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

That might overload the intent of team.yaml 🤔

Copy link
Member

@bobheadxi bobheadxi Apr 21, 2022

Choose a reason for hiding this comment

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

For now, can we only notify OWNERS if we have notify-on-deploy set? That would make the opt-in explicit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, but right now I don't see an immediate solution other than this :/ Maybe another file possibly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, can we only notify OWNERS if we have notify-on-deploy set? That would make the opt-in explicit

This would defeat the purpose of giving more visibility to what happens in Cloud, that was mentioned over Slack (https://sourcegraph.slack.com/archives/C89KCDK5J/p1649869394862269).

If we were to decide to revert the changes to the team.yml that's a rather easy fix though. And if we start to see many PRs dropping the notifications, that would also be a strong factual signal that we're too noisy as well.

I also want to run a spike on guessing how a given PR changed the services, that would make the signal VS noise much higher and notifications would be much more useful.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I missed that discussion!

Copy link
Member

Choose a reason for hiding this comment

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

Let's try this then, and see how it goes. I wonder if that means we should revert notify-on-deploy as well, as well as the service-based notifications

Copy link
Member

Choose a reason for hiding this comment

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

or introduce the team.yaml field you propose like so:

  notifications:
    deployments:
       opt_in: true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ci cla-signed dx Issues and PRs related to developer experience concerns dx-announce Tag PRs with this label to include it in the monthly DX email update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deployment notifications pings are triggered based on CODEOWNERS
3 participants