Skip to content

Add major decision auto-approval workflow - #4162

Merged
ranshid merged 2 commits into
valkey-io:unstablefrom
sarthakaggarwal97:major-decision-auto-approve
Jul 21, 2026
Merged

Add major decision auto-approval workflow#4162
ranshid merged 2 commits into
valkey-io:unstablefrom
sarthakaggarwal97:major-decision-auto-approve

Conversation

@sarthakaggarwal97

Copy link
Copy Markdown
Contributor

Add a daily workflow that finds open issues and pull requests labeled major-decision-pending-auto-approve. Once the label has remained applied for two weeks, the workflow:

  • adds major-decision-approved
  • removes major-decision-pending, if present
  • removes major-decision-pending-auto-approve

The workflow uses issue events to determine when the auto-approval label was most recently applied, so removing and reapplying the label resets the waiting period. It also re-checks the current labels before making changes and keeps the trigger label until the other label operations succeed.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d442d11-bd97-496c-9ad0-a79135672b2e

📥 Commits

Reviewing files that changed from the base of the PR and between e7050fc and 48dde0e.

📒 Files selected for processing (1)
  • .github/workflows/major-decision-auto-approve.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/major-decision-auto-approve.yml

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow runs daily or manually to identify open issues with the auto-approve label, require that it has been present for more than 14 days, and update eligible issues to the approved state.

Changes

Major decision auto-approval

Layer / File(s) Summary
Workflow triggers and job execution
.github/workflows/major-decision-auto-approve.yml
Adds daily and manual triggers, write permissions, non-canceling concurrency, repository scoping, a runner, and a 10-minute timeout.
Issue eligibility checks
.github/workflows/major-decision-auto-approve.yml
Paginates candidate issues and label events, checks the 14-day cutoff, and revalidates each issue’s current state and labels.
Issue label updates and failure reporting
.github/workflows/major-decision-auto-approve.yml
Adds major-decision-approved, removes pending labels with tolerated 404 errors, records processing failures, and fails the workflow when errors remain.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Scheduler
  participant Workflow
  participant GitHubIssues
  participant IssueLabels
  Scheduler->>Workflow: Start daily or manual run
  Workflow->>GitHubIssues: Find open issues with auto-approve label
  GitHubIssues-->>Workflow: Return paginated candidates and label history
  Workflow->>GitHubIssues: Revalidate issue state and labels
  Workflow->>IssueLabels: Apply approved label
  Workflow->>IssueLabels: Remove pending labels
  IssueLabels-->>Workflow: Return label update results
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the workflow added in this PR.
Description check ✅ Passed The description matches the workflow’s purpose and behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sarthakaggarwal97
sarthakaggarwal97 force-pushed the major-decision-auto-approve branch from c56410a to d954378 Compare July 13, 2026 20:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/major-decision-auto-approve.yml:
- Around line 38-94: Wrap each candidate’s processing in the loop over
candidates with a try-catch, covering listEvents, issue re-read, addLabels, and
label removal. On failure, log the candidate number and error with core.warning
or core.error, then continue processing subsequent candidates; preserve the
existing handling of 404 errors in removeLabel.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2684fd09-4374-41c4-b3c6-854371d549a6

📥 Commits

Reviewing files that changed from the base of the PR and between cdf98a2 and c56410a.

📒 Files selected for processing (1)
  • .github/workflows/major-decision-auto-approve.yml

Comment thread .github/workflows/major-decision-auto-approve.yml Outdated
@valkey-review-bot

Copy link
Copy Markdown

The DCO check is failing: commit c56410a has no Signed-off-by: trailer. Since this is a single-commit branch, git commit --amend -s (or git rebase HEAD~1 --signoff) followed by a force-push resolves it.

@valkey-review-bot valkey-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The two-week eligibility logic looks correct (a remove/re-add produces a newer labeled event, so the window resets, and the trigger label is removed last so partial failures retry on the next run). One issue with the token permissions, below.

Comment thread .github/workflows/major-decision-auto-approve.yml
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.78%. Comparing base (cdf98a2) to head (48dde0e).
⚠️ Report is 10 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #4162      +/-   ##
============================================
- Coverage     76.82%   76.78%   -0.05%     
============================================
  Files           162      162              
  Lines         81433    81455      +22     
============================================
- Hits          62561    62545      -16     
- Misses        18872    18910      +38     

see 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@valkey-review-bot valkey-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The workflow logic is mostly sound, but there is one race in the eligibility revalidation that can approve an item even after the waiting period was reset during the run.

Comment thread .github/workflows/major-decision-auto-approve.yml Outdated
Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com>
@sarthakaggarwal97
sarthakaggarwal97 force-pushed the major-decision-auto-approve branch from d954378 to e7050fc Compare July 13, 2026 21:26

@ranshid ranshid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com>
@sarthakaggarwal97

Copy link
Copy Markdown
Contributor Author

@ranshid good to merge?

@ranshid

ranshid commented Jul 21, 2026

Copy link
Copy Markdown
Member

@ranshid good to merge?

yes. I approved right?

@ranshid
ranshid merged commit e9cde41 into valkey-io:unstable Jul 21, 2026
64 checks passed
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.

2 participants