Skip to content

feat: adding a workflow for the PR lifecycle#296

Open
0xisk wants to merge 10 commits intomainfrom
feat/pr-lifecycle-workflow
Open

feat: adding a workflow for the PR lifecycle#296
0xisk wants to merge 10 commits intomainfrom
feat/pr-lifecycle-workflow

Conversation

@0xisk
Copy link
Copy Markdown
Member

@0xisk 0xisk commented Feb 24, 2026

Types of changes

What types of changes does your code introduce to OpenZeppelin Midnight Contracts?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Fixes #295

PR Checklist

  • I have read the Contributing Guide
  • I have added tests that prove my fix is effective or that my feature works
  • I have added documentation of new methods and any new behavior or changes to existing behavior
  • CI Workflows Are Passing

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Summary by CodeRabbit

  • Chores
    • Added automated pull request tracking in GitHub Projects with status updates synchronized to lifecycle events (opened, draft, ready for review, closed).

@0xisk 0xisk requested review from a team as code owners February 24, 2026 08:17
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 24, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bbce636c-03db-482e-9605-f511574e0b0f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Adds a GitHub Actions workflow that automatically manages PR lifecycle by updating GitHub Project V2 status fields based on PR events (opened, converted to draft, ready for review, closed), mapping them to corresponding project statuses.

Changes

Cohort / File(s) Summary
PR Lifecycle Workflow
.github/workflows/pr-lifecycle.yml
New workflow that triggers on PR events and updates GitHub Project V2 status. Maps PR actions to project statuses: opened/ready_for_review → "Needs Review", converted_to_draft → "In Progress", closed → "Closed". Uses github-script to add PR to project and update status field via GitHub API.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 A workflow hops into the night,
PR statuses now gleaming bright,
From draft to review, from close to rest,
Project management put to the test! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a GitHub Actions workflow for PR lifecycle management.
Linked Issues check ✅ Passed The implementation fulfills the PR lifecycle requirements by automatically mapping Draft/Open/Closed PR states to appropriate project status values.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the PR lifecycle workflow feature requested in issue #295; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/pr-lifecycle-workflow

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

Signed-off-by: 0xisk <iskander.andrews@openzeppelin.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pr-lifecycle.yml:
- Around line 30-55: Validate required environment variables (PROJECT_ID,
STATUS_FIELD_ID and STATUS_OPTIONS entries STATUS_OPTION_IN_PROGRESS,
STATUS_OPTION_NEEDS_REVIEW, STATUS_OPTION_CLOSED) at the start of the workflow
logic and fail fast with a clear error when any is missing; specifically check
the constants PROJECT_ID, STATUS_FIELD_ID and each STATUS_OPTIONS property
before computing targetStatus (using context.payload.action / pull_request), and
throw or call a failure helper so the action stops with a descriptive message
instead of silently no-op or producing unclear GraphQL errors.
- Around line 3-6: The workflow trigger is missing the pull_request "reopened"
type and the job-level/action condition only checks for "opened", so add
"reopened" to the pull_request types array and update any condition that
currently compares github.event.action == 'opened' (or similar) to also allow
'reopened' (e.g., github.event.action == 'opened' || github.event.action ==
'reopened' or use contains(['opened','reopened'], github.event.action)); update
both the on.pull_request.types list and every conditional that gates
draft/status handling to include reopened so reopened PRs run the same lifecycle
logic as opened PRs.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60ad96a and 944db9c.

📒 Files selected for processing (1)
  • .github/workflows/pr-lifecycle.yml

@0xisk 0xisk moved this from Backlog to In progress in OZ Development for Midnight Feb 24, 2026
@0xisk 0xisk moved this from In progress to Needs Review in OZ Development for Midnight Feb 24, 2026
@0xisk 0xisk self-assigned this Feb 24, 2026
Copy link
Copy Markdown
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

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

Looks good @0xisk! Just left a question

I also wonder if there's a way to leverage a reusable workflow so we don't have to repeat ourselves in each repo

Signed-off-by: 0xisk <iskander.andrews@openzeppelin.com>
Signed-off-by: 0xisk <iskander.andrews@openzeppelin.com>
Copy link
Copy Markdown
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

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

LGTM!

@0xisk 0xisk requested a review from andrew-fleming February 25, 2026 08:21
Co-authored-by: Andrew Fleming <fleming.andrew@protonmail.com>
Signed-off-by: 0xisk <0xisk@proton.me>
@0xisk 0xisk requested a review from andrew-fleming February 25, 2026 13:23
Copy link
Copy Markdown
Contributor

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

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

LGTM!

…ed and pin template version

Signed-off-by: 0xisk <iskander.andrews@openzeppelin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

PR Lifecycle workflow

5 participants