Skip to content

Support "code owner" alerts #4075

@bretg

Description

@bretg

We had a request in the Prebid Slack channel to alert the maintainer when a PR has been opened that affects a bid adapter. This is a pretty reasonable request and not the first time it's come up.

The easiest way to do this would be to turn on the github "code owner" feature so updates to bid adapters and modules at least alert the team that originally wrote it. I played around with the 'code owner' feature and I think it's ok with 3 wrinkles:

  • It requires that the 'code owner' be granted write permission to the repo for specific github handles or teams. I'm not willing to do this except for Prebid.org members.
  • I dislike relying on specific github handles because engineers move around and because it's hard to track why a certain person deserves access to our repo. But we can manage this partly by mandating the use of github teams.
  • Github then requires a review from one of the 'code owners' before that PR can be merged. This could significantly slow merging a PR. But I suppose that's what a team wants if they opt into this feature.

So here's a possible workflow:

  1. Prebid.org members can request code ownership over an adapter or module by emailing prebid-server at prebid dot org. The request must contain the github handles of the people on the review team.
  2. We will create (or update) a github team containing the requested handles.
  3. The CODEOWNERS file will be updated to point to this team as owning the relevant directories.
  4. If a code owner does not respond within 2 weeks, email will be sent to the maintainer email address.
  5. If a company lets its Prebid.org membership lapse, the CODEOWNERS entries will be removed.

An alternate solution (maybe even the preferred solution) would be something similar to CODEOWNERS but that just alerted the maintainer email address with an FYI. An action like the one below could work, but we would need a file for everyone who wanted to do this and github doesn't allow directory structure under workflows. So that directory could get messy with that approach.

name: Notify on BidderA Directory Change

on:
  push:
    paths:
      - 'path/to/your/directory/**' # Specify the directory to monitor

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - name: Send Email Notification
        uses: dawidd6/action-send-mail@v3
        with:
          server_address: smtp.your-email-server.com
          server_port: 587
          username: ${{ secrets.EMAIL_USERNAME }}
          password: ${{ secrets.EMAIL_PASSWORD }}
          subject: Changes Detected in Repository
          body: |
            Changes were made to files in the specified directory:
            ${{ github.event.head_commit.message }}
          to: "recipient@example.com"

I haven't found any options out there for a CODEOWNERS-like config file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions