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

Use CODEOWNERS in all repositories #192

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

snim2
Copy link
Contributor

@snim2 snim2 commented Sep 28, 2022

This RFC would require that all active repos make use of GitHub's code owners feature to describe who is responsible for the maintenance of the repo. This is designed to ensure that issues and PRs in shared repos do not stall.

@snim2 snim2 added the new New pull requests needing review label Sep 28, 2022
@snim2 snim2 self-assigned this Sep 28, 2022
@snim2 snim2 force-pushed the rfc/use-codeowners-in-all-repos branch from a76a276 to 07833b9 Compare September 28, 2022 15:27
@jdudley1123
Copy link
Member

Thanks Sarah! I really like the idea in principle, I have some practical questions:

  1. You recommend that code owners are GitHub teams. Currently our teams are pretty big ('Technology' is a team, 'GovPress' is a subteam, nothing more granular. Do you envisage having smaller teams 'eLinks team', 'Mind team' etc? My concern is that assigning ownership to a large team is effectively what we do at the moment, and the result is that because it's everyone's responsibility it's nobody's.
  2. If I am a code owner, how would I know? Is there someone in GitHub where I can view a list of repositories that I'm a code owner for?
  3. Is there any way that as an organisation we can see at a glance (I'm thinking a table) who is the code owner for each repo without going to the CODEOWNERS file?

@snim2 snim2 marked this pull request as ready for review September 28, 2022 16:02
@snim2
Copy link
Contributor Author

snim2 commented Sep 28, 2022

  1. You recommend that code owners are GitHub teams. Currently our teams are pretty big ('Technology' is a team, 'GovPress' is a subteam, nothing more granular. Do you envisage having smaller teams 'eLinks team', 'Mind team' etc? My concern is that assigning ownership to a large team is effectively what we do at the moment, and the result is that because it's everyone's responsibility it's nobody's.

I think client projects will probably be different to shared repos here, but we do need something more granular than the current structure. For things like the Playbook we probably want to form a new team of people from across the company.

GitHub teams can be nested, for example the GovPress team is really the dxw/Staff/Technology team/GovPress team. And we have at least two teams with no members! So, if we start using code owners, we will definitely need to tidy this up, and maybe add something in the onboarding documentation.

If you look at the settings for the playbook repo and this repo you'll get a good idea of how we're using this feature now.

  1. If I am a code owner, how would I know? Is there someone in GitHub where I can view a list of repositories that I'm a code owner for?

Not easily. You can see this information from within repositories, but there isn't a simple way to see an overview (I guess because the information is stored inside a file under version control, and not set via the GitHub UI).

However, you should get a notification when you are added to a team, and you can set this in github.com/yourusername/settings/notifcations. Also, I would expect that if you are added as a code owner to a repo, that whoever adds you would AT-you in the PR, although the RFC doesn't specify that.

  1. Is there any way that as an organisation we can see at a glance (I'm thinking a table) who is the code owner for each repo without going to the CODEOWNERS file?

No, but we can see all of our teams. So for some repos this should be simple (for example if there's a playbook-team) and for other repos it might have to be inferred.

@Floppy
Copy link
Contributor

Floppy commented Sep 29, 2022

Great idea! To respond to @jdudley1123's questions with my own thoughts...

  1. If I am a code owner, how would I know? Is there someone in GitHub where I can view a list of repositories that I'm a code owner for?
  2. Is there any way that as an organisation we can see at a glance (I'm thinking a table) who is the code owner for each repo without going to the CODEOWNERS file?

Perhaps a bit of code somewhere to generate and maintain a list of codeowners across all our repos could cover both of these (and also make sure there are no gaps).

@erbridge
Copy link
Contributor

Just to say, the memberless teams may well be for setting up scheduled reminders and are intentionally memberless. Feel free to revisit that.

Comment on lines +26 to +28
1. within the `dxw` organisation on GitHub or the equivalent on GitLab,
1. not a fork of a repository from outside the organisation; and
1. not archived.
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest this list also has 1. not wholly relating to a client. Client projects MAY use codeowners, but they're also self-managing. This might complicate things with GovPress, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I think you mean something like: 1. where the maintenance of the repository is entirely within the control of dxw, and not (for example) a client.?

Copy link
Contributor

Choose a reason for hiding this comment

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

No. I mean things that aren't client projects, because client projects are their own things that have different needs. That's a D+ need anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, that's a little more complex than I'd realised. Maybe it would be a good idea for repos who "should" conform to all of the maintenance RFCs to have a topic set, like dxw-maintenance, which would mean that any automated tools could skip things like D+ client projects?

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably easier to tag the non-dxw stuff, but yes.

@snim2
Copy link
Contributor Author

snim2 commented Sep 30, 2022

Just to say, the memberless teams may well be for setting up scheduled reminders and are intentionally memberless. Feel free to revisit that.

Is this documented somewhere?

rfc-192-use-codeowners-in-all-repos.md Outdated Show resolved Hide resolved
environment that
[assumes good faith](https://en.wikipedia.org/wiki/Wikipedia:Assume_good_faith).

Repositories SHOULD be configured to ensure that code owners review PRs before
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this should be a SHOULD without a particular need for the owner(s) to agree to a change, particularly with repos where things like minor Dependabot PRs can be confidently approved by a range of people. A MAY is worthwhile to remind people that it's an option though.

Copy link
Member

Choose a reason for hiding this comment

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

I might even go as far as removing it. The one time we had it enabled on a repo it was painful. Although its probably okay if its just the tech team as a code owner.

- [ ] Ensure all repositories have
[topics](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics)
set which identify the owner (e.g. `govpress`, `tech-ops`, etc.)
- [ ] Write a tool to generate PRs to add a default license, `CONTRIBUTING.md`
Copy link
Member

Choose a reason for hiding this comment

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

We've done this before. There was definitely interest in turning it into an internal platform which would let us quickly get an overview, which would also align with @Floppy's point about a central "who owns this code" view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've been looking through that repo. I'm beginning to think we need two things: 1) a relatively regular "audit" of the repos that highlights places where maintenance is needed, and 2) to start using that tool, or something very similar, to automatically resolve maintenance issues, like missing files.

@github-actions github-actions bot removed the new New pull requests needing review label Oct 12, 2022
@dragon-dxw
Copy link

A very, very brief summary of the above (apologies if anything missed / misunderstood)

  • Joseph: ownership: current teams too broadly distributed, should be people who’ve worked on it.


    • Sarah: yes, granular
 is good.
  • Joseph: how do I know I’m a code owner? how do I know all code owners?

    • James: we write some code?
  • F: should be “not client projects” (seems solid to me)

  • Nick: word change [accepted by me]

  • Nick: don't configure to force review (seems solid to me, bob)

There doesn't seem to be any suggestions against the substantive argument that CODEOWNERS is a useful thing?

@dragon-dxw
Copy link

An interesting view on the topic, where it didn't work out for a company:
https://www.fullstory.com/blog/taming-github-codeowners-with-bots/

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.

8 participants