Skip to content

ci: add GHA to add PRs to project board when marked ready for review#4380

Merged
lzchen merged 5 commits intoopen-telemetry:mainfrom
honeycombio:mike/add-to-project-ready-for-review
May 6, 2026
Merged

ci: add GHA to add PRs to project board when marked ready for review#4380
lzchen merged 5 commits intoopen-telemetry:mainfrom
honeycombio:mike/add-to-project-ready-for-review

Conversation

@MikeGoldsmith
Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith commented Mar 31, 2026

Description

The Python PR digest board uses a built-in GitHub project workflow to auto-add PRs. However, that workflow only fires on PR `opened` and `reopened` events — it does not fire when a draft PR is converted to ready for review.

This means any PR opened as a draft and later marked ready for review is silently skipped and never added to the board.

This GHA covers the gap by triggering on `opened`, `reopened`, and `ready_for_review`, while skipping drafts. Since it uses `actions/add-to-project` (which is idempotent), PRs opened as non-drafts are safe — they'll just be a no-op on the second trigger.

Mirrors: open-telemetry/opentelemetry-python#5026

Security: `pull_request_target` trigger

This workflow uses `pull_request_target` rather than `pull_request`. This is intentional: `pull_request` does not have access to repository secrets for fork PRs (`Secret source: None`), so the otelbot token would never resolve. `pull_request_target` runs in the base repo context and can access secrets.

The workflow contains no `actions/checkout` step — it never executes any code from the fork, only uses the PR node ID to make a single GitHub API call. See open-telemetry/opentelemetry-python#4955 for the full security discussion.

Prerequisites for org admins

Before this workflow will function after merge, an org admin must grant otelbot the Projects permission:

The board's built-in auto-add workflow only fires on PR open/reopen,
not when a draft is converted to ready for review. This GHA covers
that gap by triggering on opened, reopened, and ready_for_review,
skipping drafts.

Assisted-by: Claude Sonnet 4.6
@MikeGoldsmith
Copy link
Copy Markdown
Member Author

Please add the skip-changelog label.

@tammy-baylis-swi tammy-baylis-swi added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Mar 31, 2026
@tammy-baylis-swi tammy-baylis-swi moved this to Ready for review in Python PR digest Mar 31, 2026
Copy link
Copy Markdown
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

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

Sgtm, I fit into this use case. 🙂 Also fine with me that contrib and core PRs are on the same board.

…kflow

pull_request trigger cannot access secrets for fork PRs (Secret source: None).
pull_request_target runs in base repo context and can access secrets.

Use otelbot app token (same pattern as backport.yml) instead of a PAT.
No checkout step — intentional, see open-telemetry/opentelemetry-python#4955.

Assisted-by: Claude Sonnet 4.6
@MikeGoldsmith MikeGoldsmith moved this from Ready for review to Approved PRs in Python PR digest Mar 31, 2026
@MikeGoldsmith
Copy link
Copy Markdown
Member Author

FYI we're waiting on the following issue to make sure the credentials the action runs as has the correct access:

@github-actions
Copy link
Copy Markdown

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

Switch from generic OTELBOT_APP_ID/OTELBOT_PRIVATE_KEY to the new
Python-specific OTELBOT_PYTHON_APP_ID/OTELBOT_PYTHON_PRIVATE_KEY
which has Projects read/write permission.

See open-telemetry/community#3351

Assisted-by: Claude Opus 4.6
@MikeGoldsmith MikeGoldsmith moved this from Approved PRs to Ready for merge in Python PR digest May 6, 2026
@MikeGoldsmith
Copy link
Copy Markdown
Member Author

Updated with new credentials from community issue - this is ready to merge now 🎉

@github-project-automation github-project-automation Bot moved this from Ready for merge to Approved PRs in Python PR digest May 6, 2026
@lzchen lzchen merged commit 0293197 into open-telemetry:main May 6, 2026
751 checks passed
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Python PR digest May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants