PR #63

91 votes · 81 up · 10 down

View on GitHub
91
Total Votes
+81
Upvotes
-10
Downvotes
+81-10

Comments(7)

skridlevskyComment#63Add Automatic Merge

Hey @Loeffeldude, thanks for tackling this - automation is definitely the right direction.

A few things we need to get right before merging, since the voting integrity is core to what we're doing here:

Vote calculation - Currently this only counts :+1:, but our frontend uses :+1: - :-1: (see lib/github.ts:156). Without this, downvotes are meaningless and the displayed rankings won't match what actually gets merged.

Merge safety - The script should skip PRs that:

  • Have merge conflicts (check mergeable status)
  • Have failing CI checks
  • If top PR can't merge, try the next eligible one

Schedule - The cron runs weekly at 12:00 UTC Sunday, but our countdown shows daily at 19:00 UTC. Should be 0 19 * * *.

Pagination - Only fetches first 100 reactions per PR. We have PRs with a 1000+ reactions, so this would miss 90% of votes. See lib/github.ts:127-154 for how we handle this.

You mentioned wanting a single source of truth - agreed. Happy to discuss approaches if you want to pair on this.

NSPC911Comment#63Add Automatic Merge

But that's only considering the OP of the Rewrite it in rust PR doesn't fix the Merge Conflicts. If he fixed it, but the CI fails, merge will still be successful

matthewmayerComment#63Add Automatic Merge

If this gets merged as-is I think what will actually happen is:

So actually a fairly harmless outcome. The broken "Rewrite it in Rust" PR actually protects anything bad from happening.

Manual daily merges would still be the responsibility of the maintainer.

vamsi-alluriComment#63Add Automatic Merge

We should also have minimum number of votes to merge.

lens0021Comment#63Add Automatic Merge

This needs an update to only merge PRs that are passing checks. Otherwise the system will completely break.

aa66c34a80e1482c19c4ab3db87c391c

samsonvdComment#63Add Automatic Merge

This needs an update to only merge PRs that are passing checks. Otherwise the system will completely break.

openchaos-bot[bot]Comment#63Add Automatic Merge

🤖 OpenChaos Bot

Summary: This PR introduces a workflow that automatically merges the highest-voted open pull request on a weekly schedule, provided it has at least one +1 vote. It fetches open PRs, counts +1 reactions, and merges the top one.

Files changed: 1 (.github/workflows/automerge.yml)

Impact: High - Directly affects the core functionality of the repo by automating the pull request merging process based on community votes.


openchaos-bot

All Activity(100)

skridlevskyComment#63Add Automatic Merge

Hey @Loeffeldude, thanks for tackling this - automation is definitely the right direction.

A few things we need to get right before merging, since the voting integrity is core to what we're doing here:

Vote calculation - Currently this only counts :+1:, but our frontend uses :+1: - :-1: (see lib/github.ts:156). Without this, downvotes are meaningless and the displayed rankings won't match what actually gets merged.

Merge safety - The script should skip PRs that:

  • Have merge conflicts (check mergeable status)
  • Have failing CI checks
  • If top PR can't merge, try the next eligible one

Schedule - The cron runs weekly at 12:00 UTC Sunday, but our countdown shows daily at 19:00 UTC. Should be 0 19 * * *.

Pagination - Only fetches first 100 reactions per PR. We have PRs with a 1000+ reactions, so this would miss 90% of votes. See lib/github.ts:127-154 for how we handle this.

You mentioned wanting a single source of truth - agreed. Happy to discuss approaches if you want to pair on this.

NSPC911Comment#63Add Automatic Merge

But that's only considering the OP of the Rewrite it in rust PR doesn't fix the Merge Conflicts. If he fixed it, but the CI fails, merge will still be successful

matthewmayerComment#63Add Automatic Merge

If this gets merged as-is I think what will actually happen is:

So actually a fairly harmless outcome. The broken "Rewrite it in Rust" PR actually protects anything bad from happening.

Manual daily merges would still be the responsibility of the maintainer.

vamsi-alluriComment#63Add Automatic Merge

We should also have minimum number of votes to merge.

lens0021Comment#63Add Automatic Merge

This needs an update to only merge PRs that are passing checks. Otherwise the system will completely break.

aa66c34a80e1482c19c4ab3db87c391c

samsonvdComment#63Add Automatic Merge

This needs an update to only merge PRs that are passing checks. Otherwise the system will completely break.

openchaos-bot[bot]Comment#63Add Automatic Merge

🤖 OpenChaos Bot

Summary: This PR introduces a workflow that automatically merges the highest-voted open pull request on a weekly schedule, provided it has at least one +1 vote. It fetches open PRs, counts +1 reactions, and merges the top one.

Files changed: 1 (.github/workflows/automerge.yml)

Impact: High - Directly affects the core functionality of the repo by automating the pull request merging process based on community votes.


openchaos-bot

Add Automatic Merge

Currently the merge is being done manually by the repo owner which is a bit silly. This makes it so we run a github action script that does this automatically.

[!CAUTION] This is actually pretty dangerous. We should probably have an environment with configured approval rules but this would need to be configured by @skridlevsky.

This currently mirrors the logic used in the lib/github.ts file. If you have any idea how to unify this logic in a single source of truth somehow please leave a comment. I am not too well versed in NextJS but is there a way to add like a CLI command or something?