You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "justinmclean (via GitHub)" <gi...@apache.org> on 2026/10/08 12:05:15 UTC
[PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
justinmclean opened a new pull request, #4455:
URL: https://github.com/apache/iggy/pull/4455
## Which issue does this PR address?
Closes #4449
## Rationale
ASF Infra bars pull_request_target on workflows that hold a token and disables it for ASF repositories from November 2026. Two of our workflows use it with a write token.
## What changed?
PR lifecycle labels, the welcome comment and push-driven stale unmark ran on pull_request_target with a write token.
pr-triage-collect.yml now also collects the pull_request lifecycle events with its read-only token. pr-triage-apply.yml runs on workflow_run only, checks the artifact's action against a fixed list and acts on the PR's live state from the API. stale-prs-unmark-on-activity.yml handles synchronize, reopened and ready_for_review, and stale-prs-unmark.yml is removed.
## Local Execution
- Passed: YAML parses, the embedded bash passes bash -n and shellcheck, the github-script passes node --check, and the new resolve branches were run against fake payloads with a stubbed gh (lifecycle actions resolve, other actions skip, a commit outside the PR is rejected). workflow_run only fires from the default branch, so the full flow runs only after merge.
- Pre-commit hooks ran
## AI Usage
1. Claude (Claude Code).
2. Read the existing triage workflows, designed the change and wrote it.
3. The syntax checks and stubbed runs above, and a line-by-line review of the diff.
4. Yes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "github-actions[bot] (via GitHub) via commits" <co...@iggy.apache.org>.
github-actions[bot] commented on PR #4455:
URL: https://github.com/apache/iggy/pull/4455#issuecomment-6810866202
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.
If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either `@core` on Discord or by mentioning them directly here on the PR.
Thank you for your contribution!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "justinmclean (via GitHub) via commits" <co...@iggy.apache.org>.
justinmclean commented on PR #4455:
URL: https://github.com/apache/iggy/pull/4455#issuecomment-6813968918
Merged the default branch and fixed the review findings.
Review replay: the resolve step now also requires the head SHA of the collect run to be the reviewed commit or the current PR head. A forked copy of collect only runs on a commit of its own PR, so it can no longer carry a review of another PR. Apply also skips a review when its author or a committer has given a later command on the PR, so a rerun cannot undo a reversal.
/ready
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #4455:
URL: https://github.com/apache/iggy/pull/4455#issuecomment-6061457713
## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/4455?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 88.47%. Comparing base ([`af706e6`](https://app.codecov.io/gh/apache/iggy/commit/af706e68ec3f2f37200e52ddc9ba98f5910f8025?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`37ea817`](https://app.codecov.io/gh/apache/iggy/commit/37ea81750a615b4aeaa3ec56336fb431aff6a004?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 2 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #4455 +/- ##
============================================
+ Coverage 87.82% 88.47% +0.64%
Complexity 1607 1607
============================================
Files 1302 1302
Lines 251971 251971
Branches 212264 212266 +2
============================================
+ Hits 221299 222928 +1629
+ Misses 25386 23678 -1708
- Partials 5286 5365 +79
```
| [Components](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.61% <ø> (-0.03%)` | :arrow_down: |
| [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.81% <ø> (ø)` | |
| [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.84% <ø> (+16.40%)` | :arrow_up: |
| [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `91.25% <ø> (ø)` | |
| [PHP SDK](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `85.67% <ø> (ø)` | |
| [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.54% <ø> (+1.56%)` | :arrow_up: |
| [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.25% <ø> (+0.02%)` | :arrow_up: |
| [C++ SDK](https://app.codecov.io/gh/apache/iggy/pull/4455/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.60% <ø> (ø)` | |
[see 92 files with indirect coverage changes](https://app.codecov.io/gh/apache/iggy/pull/4455/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "hubcio (via GitHub) via commits" <co...@iggy.apache.org>.
hubcio commented on code in PR #4455:
URL: https://github.com/apache/iggy/pull/4455#discussion_r4472501611
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -284,49 +359,44 @@ jobs:
esac
require_num "$pr" resolved_pr
- # Constrain the API-derived scalars before they leave this step. The
- # API cannot return a newline in a login or an association; this is
- # defence in depth on top of the source already being trusted.
- # A bash match tests the whole string. grep tests each line, so a
- # value with a newline in it would pass on any one matching line.
- login_re='^[A-Za-z0-9-]+(\[bot\])?$'
- if [[ ! "$author" =~ $login_re ]]; then
- echo "unexpected login: '${author}'" >&2
- exit 1
- fi
- case "$assoc" in
- OWNER|MEMBER|COLLABORATOR|CONTRIBUTOR|FIRST_TIME_CONTRIBUTOR|FIRST_TIMER|MANNEQUIN|NONE) ;;
- *) echo "unexpected association: '${assoc}'" >&2; exit 1 ;;
- esac
- # Empty on the issue_comment path. A newline here could add a second
- # pr_number line to the outputs below.
- case "$state" in
- ''|approved|changes_requested|commented|dismissed|pending) ;;
- *) echo "unexpected review state: '${state}'" >&2; exit 1 ;;
- esac
- # Step outputs, not $GITHUB_ENV: an output is read only through a
- # steps.*.outputs.* expression and never becomes a process env var in
- # a later step, so it cannot smuggle NODE_OPTIONS or BASH_ENV even if
- # a value slipped the checks above. The values are single-line here.
+ # Job outputs, not $GITHUB_ENV: an output is read only through an
+ # expression and never becomes a process env var on its own, so it
+ # cannot smuggle NODE_OPTIONS or BASH_ENV. Every value here is a
+ # checked number, a value from a fixed list, or set by GitHub.
{
- echo "comment_author=${author}"
- echo "comment_assoc=${assoc}"
echo "comment_id=${cid}"
+ echo "lifecycle_action=${lifecycle}"
echo "pr_number=${pr}"
- echo "review_state=${state}"
- echo "triage_event_name=${UPSTREAM_EVENT}"
+ echo "review_id=${rid}"
} >> "$GITHUB_OUTPUT"
+ apply:
+ needs: resolve
+ if: needs.resolve.outputs.skip != 'true'
+ runs-on: ubuntu-slim
+ timeout-minutes: 5
+ # Serialised per PR. The group is keyed on the PR number the resolve job
+ # verified against the collect run's head, so a forged payload cannot
+ # park a run in another PR's group. cancel-in-progress: false keeps the
+ # active run; GitHub still replaces a pending run with the latest
+ # arrival, so under N rapid triggers on one PR the active run and the
+ # latest land and anything queued between them is dropped. That is safe
+ # because every run first converges the S-* labels on the PR's live
+ # state and /ready and /author are idempotent. /request-review is the
+ # only non-idempotent command: a three-comment burst inside one run's
+ # lifetime lands at most two of them.
+ concurrency:
Review Comment:
simplification: the per-PR job guard duplicates the workflow-wide serialization. keep one shared lock around label mutations and remove the redundant guard and explanation.
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -125,16 +147,18 @@ concurrency:
queue: max
jobs:
- apply:
- if: |
- github.event_name == 'pull_request_target'
- || (github.event_name == 'workflow_run'
- && github.event.workflow_run.conclusion == 'success')
+ resolve:
Review Comment:
warning: artifact resolution and no-op checks hold the repository-wide label queue, delaying unrelated PR commands. move the shared concurrency group, including `queue: max`, to the apply job.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on code in PR #4455:
URL: https://github.com/apache/iggy/pull/4455#discussion_r4268424356
##########
.github/workflows/pr-triage-collect.yml:
##########
@@ -17,28 +17,32 @@
name: PR Triage Collect
-# Read-only collector for fork-restricted events. issue_comment and
-# pull_request_review on cross-fork PRs deliver a read-only GITHUB_TOKEN
-# regardless of the workflow's permissions: block, so the label mutations
-# cannot run here. This workflow uploads the raw event payload as an
-# artifact; pr-triage-apply.yml picks it up via workflow_run and applies
-# the labels with a write token from the base ref.
+# Read-only collector for fork-restricted events. issue_comment,
+# pull_request_review and pull_request on cross-fork PRs deliver a read-only
+# GITHUB_TOKEN regardless of the workflow's permissions: block, so the label
+# mutations cannot run here. This workflow uploads the raw event payload as an
+# artifact; pr-triage-apply.yml and stale-prs-unmark-on-activity.yml pick it
+# up via workflow_run and apply the labels with a write token from the base
+# ref.
#
-# pull_request_target is NOT routed through this collector — it already
-# runs against base ref with a write token and is handled directly in
-# pr-triage-apply.yml.
+# The pull_request lifecycle events replace pull_request_target, which ASF
+# Infra bars on workflows that hold a token and disables for ASF repositories
+# from November 2026 (https://infra.apache.org/github-actions-policy.html).
#
# SECURITY: no actions/checkout, no exec of PR contents, no token export.
# The token here is read-only. The artifact is NOT trustworthy: on the
-# pull_request_review path GitHub runs the PR head's copy of this file, so a
-# fork can change it and upload any payload. The consumers take only a
-# numeric id from the artifact and re-fetch everything else from the API.
+# pull_request_review and pull_request paths GitHub runs the PR head's copy of
+# this file, so a fork can change it and upload any payload. The consumers
+# take only numeric ids and the event action from the artifact, check the
+# action against a fixed list, and re-fetch everything else from the API.
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
+ pull_request:
Review Comment:
Done. New `pr-triage-reconcile.yml` runs every six hours from the default branch. It searches for closed or draft PRs with S-*, open non-draft PRs without one, and open PRs with `S-stale`, re-reads each live and applies the same rules; `S-stale` comes off on a reopen, ready_for_review, force-push or newer head commit after the labelling. Comments and reviews fire regardless of conflicts. The welcome comment is not reconciled.
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -281,6 +278,35 @@ jobs:
# Reviews carry no issue-comment id, so reactions stay skipped
# for them, as before.
;;
+ pull_request)
+ # PR lifecycle. The action comes from the artifact, which a fork
+ # can forge, so it is checked against a fixed list and used only
+ # to pick the lifecycle branch; the Dispatch step acts on the
+ # PR's live state from the API, not on the action.
+ cpr="$(jq -r '.pull_request.number // ""' "$f")"
+ lifecycle="$(jq -r '.action // ""' "$f")"
+ require_num "$cpr" pr_number
+ case "$lifecycle" in
+ opened|ready_for_review|converted_to_draft|closed) ;;
+ *)
+ echo "pull_request action '${lifecycle}' has no lifecycle step, skipping"
+ echo "skip=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ ;;
+ esac
+ # As on the review path: the collect run's commit must belong to
+ # the claimed PR, so a forged payload is confined to the fork's
+ # own PR.
+ shas="$(gh_api --paginate "repos/${REPO}/pulls/${cpr}/commits" --jq '.[].sha')"
Review Comment:
Done, in both consumers. On `pull_request` runs the claimed PR's head repository and branch must match `workflow_run.head_repository` and `head_branch`, which a force-push does not change. On `pull_request_review` runs GitHub records the base repo as `head_repository` even for forks (checked on the last 100 here), so that path relies on the review belonging to the claimed PR and being within five minutes of the run; the unmark workflow gains that window.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "justinmclean (via GitHub) via commits" <co...@iggy.apache.org>.
justinmclean commented on code in PR #4455:
URL: https://github.com/apache/iggy/pull/4455#discussion_r4546072786
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -125,16 +147,18 @@ concurrency:
queue: max
jobs:
- apply:
- if: |
- github.event_name == 'pull_request_target'
- || (github.event_name == 'workflow_run'
- && github.event.workflow_run.conclusion == 'success')
+ resolve:
Review Comment:
Moved the shared lock, with `queue: max`, to the apply job, so resolve and no-op triggers never wait on it.
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -284,49 +359,44 @@ jobs:
esac
require_num "$pr" resolved_pr
- # Constrain the API-derived scalars before they leave this step. The
- # API cannot return a newline in a login or an association; this is
- # defence in depth on top of the source already being trusted.
- # A bash match tests the whole string. grep tests each line, so a
- # value with a newline in it would pass on any one matching line.
- login_re='^[A-Za-z0-9-]+(\[bot\])?$'
- if [[ ! "$author" =~ $login_re ]]; then
- echo "unexpected login: '${author}'" >&2
- exit 1
- fi
- case "$assoc" in
- OWNER|MEMBER|COLLABORATOR|CONTRIBUTOR|FIRST_TIME_CONTRIBUTOR|FIRST_TIMER|MANNEQUIN|NONE) ;;
- *) echo "unexpected association: '${assoc}'" >&2; exit 1 ;;
- esac
- # Empty on the issue_comment path. A newline here could add a second
- # pr_number line to the outputs below.
- case "$state" in
- ''|approved|changes_requested|commented|dismissed|pending) ;;
- *) echo "unexpected review state: '${state}'" >&2; exit 1 ;;
- esac
- # Step outputs, not $GITHUB_ENV: an output is read only through a
- # steps.*.outputs.* expression and never becomes a process env var in
- # a later step, so it cannot smuggle NODE_OPTIONS or BASH_ENV even if
- # a value slipped the checks above. The values are single-line here.
+ # Job outputs, not $GITHUB_ENV: an output is read only through an
+ # expression and never becomes a process env var on its own, so it
+ # cannot smuggle NODE_OPTIONS or BASH_ENV. Every value here is a
+ # checked number, a value from a fixed list, or set by GitHub.
{
- echo "comment_author=${author}"
- echo "comment_assoc=${assoc}"
echo "comment_id=${cid}"
+ echo "lifecycle_action=${lifecycle}"
echo "pr_number=${pr}"
- echo "review_state=${state}"
- echo "triage_event_name=${UPSTREAM_EVENT}"
+ echo "review_id=${rid}"
} >> "$GITHUB_OUTPUT"
+ apply:
+ needs: resolve
+ if: needs.resolve.outputs.skip != 'true'
+ runs-on: ubuntu-slim
+ timeout-minutes: 5
+ # Serialised per PR. The group is keyed on the PR number the resolve job
+ # verified against the collect run's head, so a forged payload cannot
+ # park a run in another PR's group. cancel-in-progress: false keeps the
+ # active run; GitHub still replaces a pending run with the latest
+ # arrival, so under N rapid triggers on one PR the active run and the
+ # latest land and anything queued between them is dropped. That is safe
+ # because every run first converges the S-* labels on the PR's live
+ # state and /ready and /author are idempotent. /request-review is the
+ # only non-idempotent command: a three-comment burst inside one run's
+ # lifetime lands at most two of them.
+ concurrency:
Review Comment:
Removed the per-PR group and its explanation. The shared lock is the only one now.
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -125,15 +123,14 @@ concurrency:
# state. Per-PR serialization on this leg is a noise/cost
# optimization, blocked on GH adding job-level concurrency so the
# parsed PR number can re-key.
- group: pr-triage-apply-${{ github.event.pull_request.number || github.event.workflow_run.id }}
+ group: pr-triage-apply-${{ github.event.workflow_run.id }}
Review Comment:
Reconcile now holds the same label lock as apply and PR Skill Review Post, so it never reads labels while another writer is changing them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on code in PR #4455:
URL: https://github.com/apache/iggy/pull/4455#discussion_r4257908634
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -125,15 +123,14 @@ concurrency:
# state. Per-PR serialization on this leg is a noise/cost
# optimization, blocked on GH adding job-level concurrency so the
# parsed PR number can re-key.
- group: pr-triage-apply-${{ github.event.pull_request.number || github.event.workflow_run.id }}
+ group: pr-triage-apply-${{ github.event.workflow_run.id }}
Review Comment:
warning: overlapping lifecycle runs can restore `S-waiting-on-review` after closure or draft conversion clears it. serialize updates per PR and read live state inside that serialized job.
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -281,6 +278,35 @@ jobs:
# Reviews carry no issue-comment id, so reactions stay skipped
# for them, as before.
;;
+ pull_request)
+ # PR lifecycle. The action comes from the artifact, which a fork
+ # can forge, so it is checked against a fixed list and used only
+ # to pick the lifecycle branch; the Dispatch step acts on the
+ # PR's live state from the API, not on the action.
+ cpr="$(jq -r '.pull_request.number // ""' "$f")"
+ lifecycle="$(jq -r '.action // ""' "$f")"
+ require_num "$cpr" pr_number
+ case "$lifecycle" in
+ opened|ready_for_review|converted_to_draft|closed) ;;
+ *)
+ echo "pull_request action '${lifecycle}' has no lifecycle step, skipping"
+ echo "skip=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ ;;
+ esac
+ # As on the review path: the collect run's commit must belong to
+ # the claimed PR, so a forged payload is confined to the fork's
+ # own PR.
+ shas="$(gh_api --paginate "repos/${REPO}/pulls/${cpr}/commits" --jq '.[].sha')"
Review Comment:
warning: a force-push can remove the collector commit before resolution, losing lifecycle labels and the welcome comment. authenticate lifecycle runs through trusted PR identity that survives force-pushes.
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -125,15 +123,14 @@ concurrency:
# state. Per-PR serialization on this leg is a noise/cost
# optimization, blocked on GH adding job-level concurrency so the
# parsed PR number can re-key.
- group: pr-triage-apply-${{ github.event.pull_request.number || github.event.workflow_run.id }}
+ group: pr-triage-apply-${{ github.event.workflow_run.id }}
cancel-in-progress: false
jobs:
apply:
if: |
- github.event_name == 'pull_request_target'
- || (github.event_name == 'workflow_run'
- && github.event.workflow_run.conclusion == 'success')
+ github.event_name == 'workflow_run'
Review Comment:
simplification: `workflow_run` is the only trigger, so the job and both preparation steps repeat an event check that is always true. remove those three guards and keep the conclusion check.
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -281,6 +278,35 @@ jobs:
# Reviews carry no issue-comment id, so reactions stay skipped
# for them, as before.
;;
+ pull_request)
+ # PR lifecycle. The action comes from the artifact, which a fork
+ # can forge, so it is checked against a fixed list and used only
+ # to pick the lifecycle branch; the Dispatch step acts on the
+ # PR's live state from the API, not on the action.
+ cpr="$(jq -r '.pull_request.number // ""' "$f")"
+ lifecycle="$(jq -r '.action // ""' "$f")"
+ require_num "$cpr" pr_number
+ case "$lifecycle" in
+ opened|ready_for_review|converted_to_draft|closed) ;;
+ *)
+ echo "pull_request action '${lifecycle}' has no lifecycle step, skipping"
+ echo "skip=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ ;;
+ esac
+ # As on the review path: the collect run's commit must belong to
+ # the claimed PR, so a forged payload is confined to the fork's
+ # own PR.
+ shas="$(gh_api --paginate "repos/${REPO}/pulls/${cpr}/commits" --jq '.[].sha')"
Review Comment:
warning: the commits endpoint returns at most 250 commits, so valid larger PRs can lose lifecycle updates and stale removal. replace this check with uncapped membership validation in both consumers.
##########
.github/workflows/pr-triage-collect.yml:
##########
@@ -17,28 +17,32 @@
name: PR Triage Collect
-# Read-only collector for fork-restricted events. issue_comment and
-# pull_request_review on cross-fork PRs deliver a read-only GITHUB_TOKEN
-# regardless of the workflow's permissions: block, so the label mutations
-# cannot run here. This workflow uploads the raw event payload as an
-# artifact; pr-triage-apply.yml picks it up via workflow_run and applies
-# the labels with a write token from the base ref.
+# Read-only collector for fork-restricted events. issue_comment,
+# pull_request_review and pull_request on cross-fork PRs deliver a read-only
+# GITHUB_TOKEN regardless of the workflow's permissions: block, so the label
+# mutations cannot run here. This workflow uploads the raw event payload as an
+# artifact; pr-triage-apply.yml and stale-prs-unmark-on-activity.yml pick it
+# up via workflow_run and apply the labels with a write token from the base
+# ref.
#
-# pull_request_target is NOT routed through this collector — it already
-# runs against base ref with a write token and is handled directly in
-# pr-triage-apply.yml.
+# The pull_request lifecycle events replace pull_request_target, which ASF
+# Infra bars on workflows that hold a token and disables for ASF repositories
+# from November 2026 (https://infra.apache.org/github-actions-policy.html).
#
# SECURITY: no actions/checkout, no exec of PR contents, no token export.
# The token here is read-only. The artifact is NOT trustworthy: on the
-# pull_request_review path GitHub runs the PR head's copy of this file, so a
-# fork can change it and upload any payload. The consumers take only a
-# numeric id from the artifact and re-fetch everything else from the API.
+# pull_request_review and pull_request paths GitHub runs the PR head's copy of
+# this file, so a fork can change it and upload any payload. The consumers
+# take only numeric ids and the event action from the artifact, check the
+# action against a fixed list, and re-fetch everything else from the API.
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
+ pull_request:
Review Comment:
warning: `pull_request` skips PRs with merge conflicts, so lifecycle labels and stale removal stop. add a trusted reconciliation path for activity that cannot start the collector.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on PR #4455:
URL: https://github.com/apache/iggy/pull/4455#issuecomment-6358141956
While this PR is open, each push to it fails "PR Triage Apply" and "Unmark Stale PRs on Activity" with `unexpected upstream event: pull_request` (for example https://github.com/apache/iggy/actions/runs/39905195720 and https://github.com/apache/iggy/actions/runs/39905195785). This is expected. The `pull_request` event runs this PR's copy of `pr-triage-collect.yml`, which adds the `pull_request` trigger, but `workflow_run` always runs the default branch's copy of the two consumers, which do not handle that event yet. The failures stop once this PR merges, and pushes to other PRs do not trigger them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on code in PR #4455:
URL: https://github.com/apache/iggy/pull/4455#discussion_r4268425979
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -281,6 +278,35 @@ jobs:
# Reviews carry no issue-comment id, so reactions stay skipped
# for them, as before.
;;
+ pull_request)
+ # PR lifecycle. The action comes from the artifact, which a fork
+ # can forge, so it is checked against a fixed list and used only
+ # to pick the lifecycle branch; the Dispatch step acts on the
+ # PR's live state from the API, not on the action.
+ cpr="$(jq -r '.pull_request.number // ""' "$f")"
+ lifecycle="$(jq -r '.action // ""' "$f")"
+ require_num "$cpr" pr_number
+ case "$lifecycle" in
+ opened|ready_for_review|converted_to_draft|closed) ;;
+ *)
+ echo "pull_request action '${lifecycle}' has no lifecycle step, skipping"
+ echo "skip=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ ;;
+ esac
+ # As on the review path: the collect run's commit must belong to
+ # the claimed PR, so a forged payload is confined to the fork's
+ # own PR.
+ shas="$(gh_api --paginate "repos/${REPO}/pulls/${cpr}/commits" --jq '.[].sha')"
Review Comment:
Done with the same change: neither consumer calls the commits endpoint now.
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -125,15 +123,14 @@ concurrency:
# state. Per-PR serialization on this leg is a noise/cost
# optimization, blocked on GH adding job-level concurrency so the
# parsed PR number can re-key.
- group: pr-triage-apply-${{ github.event.pull_request.number || github.event.workflow_run.id }}
+ group: pr-triage-apply-${{ github.event.workflow_run.id }}
cancel-in-progress: false
jobs:
apply:
if: |
- github.event_name == 'pull_request_target'
- || (github.event_name == 'workflow_run'
- && github.event.workflow_run.conclusion == 'success')
+ github.event_name == 'workflow_run'
Review Comment:
Done. The event guards are gone; only the conclusion check remains.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on code in PR #4455:
URL: https://github.com/apache/iggy/pull/4455#discussion_r4268420628
##########
.github/workflows/pr-triage-apply.yml:
##########
@@ -125,15 +123,14 @@ concurrency:
# state. Per-PR serialization on this leg is a noise/cost
# optimization, blocked on GH adding job-level concurrency so the
# parsed PR number can re-key.
- group: pr-triage-apply-${{ github.event.pull_request.number || github.event.workflow_run.id }}
+ group: pr-triage-apply-${{ github.event.workflow_run.id }}
Review Comment:
Done. Split into two jobs: `resolve` verifies the PR from the artifact, `apply` runs in a job-level concurrency group keyed on that PR number. Every apply run reads the PR and its labels live and converges S-* first (closed or draft clears both, open with none adds `S-waiting-on-review`), so a run that displaces a pending one still leaves the labels right. Comments and reviews with nothing to apply stop in `resolve`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4455:
URL: https://github.com/apache/iggy/pull/4455#issuecomment-6059465695
<!-- iggy-pr-triage-welcome -->
Thanks for the PR. It is labeled `S-waiting-on-review` and queued for review.
Slash commands (own line, regular comment) move it around the queue:
- `/ready` - back to `S-waiting-on-review` after addressing feedback
- `/author` - flip to `S-waiting-on-author` while you finish changes
- `/request-review @user-or-team` - request a reviewer
- `/pin` - exempt the PR from the stale bot, `/unpin` to undo
See [CONTRIBUTING.md](https://github.com/apache/iggy/blob/master/CONTRIBUTING.md#pr-triage-commands) for details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ci): replace pull_request_target in PR triage and stale unmark [iggy]
Posted by "justinmclean (via GitHub) via commits" <co...@iggy.apache.org>.
justinmclean commented on code in PR #4455:
URL: https://github.com/apache/iggy/pull/4455#discussion_r4546074244
##########
.github/workflows/pr-triage-collect.yml:
##########
@@ -17,28 +17,32 @@
name: PR Triage Collect
-# Read-only collector for fork-restricted events. issue_comment and
-# pull_request_review on cross-fork PRs deliver a read-only GITHUB_TOKEN
-# regardless of the workflow's permissions: block, so the label mutations
-# cannot run here. This workflow uploads the raw event payload as an
-# artifact; pr-triage-apply.yml picks it up via workflow_run and applies
-# the labels with a write token from the base ref.
+# Read-only collector for fork-restricted events. issue_comment,
+# pull_request_review and pull_request on cross-fork PRs deliver a read-only
+# GITHUB_TOKEN regardless of the workflow's permissions: block, so the label
+# mutations cannot run here. This workflow uploads the raw event payload as an
+# artifact; pr-triage-apply.yml and stale-prs-unmark-on-activity.yml pick it
+# up via workflow_run and apply the labels with a write token from the base
+# ref.
#
-# pull_request_target is NOT routed through this collector — it already
-# runs against base ref with a write token and is handled directly in
-# pr-triage-apply.yml.
+# The pull_request lifecycle events replace pull_request_target, which ASF
+# Infra bars on workflows that hold a token and disables for ASF repositories
+# from November 2026 (https://infra.apache.org/github-actions-policy.html).
#
# SECURITY: no actions/checkout, no exec of PR contents, no token export.
# The token here is read-only. The artifact is NOT trustworthy: on the
-# pull_request_review path GitHub runs the PR head's copy of this file, so a
-# fork can change it and upload any payload. The consumers take only a
-# numeric id from the artifact and re-fetch everything else from the API.
+# pull_request_review and pull_request paths GitHub runs the PR head's copy of
+# this file, so a fork can change it and upload any payload. The consumers
+# take only numeric ids and the event action from the artifact, check the
+# action against a fixed list, and re-fetch everything else from the API.
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
+ pull_request:
Review Comment:
Pushes: the stale bot step now records the PR head in a hidden marker on its stale comment, and reconcile removes `S-stale` when the live head differs. Commit dates are no longer used.
Opening checks: an open PR that has never had an S-* label was opened while conflicted. Apply now runs the issue check and the prolific author check for it before adding the label, whatever triggered the run. Reconcile hands such a PR to apply through `workflow_dispatch` instead of labelling it itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org