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

Experiment: CODENOTIFY #155440

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/codeowners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Ping maintainers

on:
pull_request_target:
types: [opened, synchronize, ready_for_review]
push:
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this action work with push events ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know. I figured that I wanted to re-run the action on every push for testing the initial setup. I guess that it'll comment on the PR after every push, but we'll have to find out

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that it'll comment on the PR after every push, but we'll have to find out

No. push is for stuff that happens outside of PRs. Can't request a review of a commit pushed to master.

Copy link
Contributor

@zowoq zowoq Jan 18, 2022

Choose a reason for hiding this comment

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

Does this action request reviews or post comments?

ofborg used to post comments and it was changed to review requests, IIRC people thought it was too spammy.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I understand. In that case, push is indeed kinda useless.

The action posts comments instead of requesting reviews (by design, see their README). There's a lot of configuring to be done, but I wanted to start simple. (Configuring as in "forking modifying the action", since it has no YAML options.)

Copy link
Contributor

@zowoq zowoq Jan 18, 2022

Choose a reason for hiding this comment

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

Posting comments may be a dealbreaker TBH.

Review requests are preferred as they can't be resent, posting/updating comments will notify every time.

IIRC there was another bot before ofborg that also posted comments, might be worthwhile checking what happened to it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that we want review requests. Since the action does not have a lot of code, this shouldn't be too hard to add. But we first need to decide whether we want this at all, or if we prefer some self-written custom solution of some sorts.

Copy link
Contributor

Choose a reason for hiding this comment

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

Having looked at it a bit more I don't think using sourcegraph/codenotify is a good idea.

https://github.com/sourcegraph/codenotify#why-use-codenotify
There can be a CODENOTIFY file in any directory.

IMHO allowing CODENOTIFY files at arbitrary places in the tree that can't be easily inspected without tooling is a negative considering the size of our tree and number of contributors.

Copy link
Member Author

Choose a reason for hiding this comment

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

We can always restrict ourselves to using only the top-level entry first and then discuss that issue later on. IMHO the experiences with large files (all-packages.nix, release notes, …) have taught that they are rather ugly to work with and distributing content from a central file to the place it actually refers to is a good idea.

Copy link
Contributor

@zowoq zowoq Jan 19, 2022

Choose a reason for hiding this comment

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

We can always restrict ourselves to using only the top-level entry first then discuss that issue later on.

How?

If it can't be restricted via tooling to the top-level file it needs to be discussed first.

IMHO the experiences with large files (all-packages.nix, release notes, …) have taught that they are rather ugly to work with and distributing content from a central file to the place it actually refers to is a good idea.

Currently maintainers could be set via meta.maintainers or CODEOWNERS. It is in a predictable position, either at the top or the bottom of the tree. It can be easily inspected manually or for meta.maintainers it can be queried it using nix.

With this approach it can be set anywhere, can't be easily inspected manually and it can only be queried via a custom tool?

types: [opened, synchronize, ready_for_review]

jobs:
codenotify:
name: codenotify
runs-on: ubuntu-latest
# Don't notify people in forks os nixpkgs
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@v2
with:
# Already include changes in the PR for pinging
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: sourcegraph/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.CODENOTIFY_GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Who is setting this token?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought I had responded to this but GitHub does not show it anymore. Did you get anything?

Copy link
Contributor

Choose a reason for hiding this comment

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

It needs to be set by an admin.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought I had responded to this but GitHub does not show it anymore. Did you get anything?

Ah, sorry I misread this. No I didn't see a response.

Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting. Anyways, I don't know what I'm doing there and why, I mostly copied some example configuration. If I understand it correctly, the token is required to be able to ping teams. So it should be able to ping individuals even without.

1 change: 1 addition & 0 deletions CODENOTIFY
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
** @mweinelt