Skip to content

[fix](build) Allow TeamCity comment triggers on draft PRs - #70605

Merged
mrhhsg merged 1 commit into
apache:masterfrom
hello-stephen:fix/allow-draft-teamcity-only-20261116
Nov 16, 2026
Merged

mrhhsg merged 1 commit into
apache:masterfrom
hello-stephen:fix/allow-draft-teamcity-only-20261116

Conversation

@hello-stephen

Copy link
Copy Markdown
Contributor

Background

PR comment commands use a shared TeamCity helper to verify the PR before submitting builds or writing file-filter skip statuses.

What problem does this PR solve?

Issue Number: None
Related PR: #70459 (introduced the draft restriction), #70515 (retained it)
PR Type: Bugfix

Problem Summary:
Authorized run buildall and individual commands fail on open draft PRs, including when a lane should only write a skip status. Allow draft PRs through the shared gate while retaining the open-state, exact head and target-branch checks.

Details

  • Frequency: Every comment-triggered build or skip for a draft PR.
  • Root cause: The common PR identity check also required draft == false.
  • Why existing tests missed it: Existing dispatch tests replaced the PR check with a freshness stub.
  • Fix: Remove only the draft predicate. New tests exercise the real PR predicate for both enqueue and skip paths.
  • Other paths and branches: The shared helper covers all supported comment-triggered lanes and branches. Workflow commenter authorization and file filters are unchanged.

Testing

  • python3 regression-test/pipeline/common/tests/test_teamcity_utils.py: 29 tests passed locally.
  • The new draft acceptance test fails against the original predicate.
  • Negative coverage verifies closed PRs, changed heads and changed target branches cannot enqueue builds or write skip statuses.
  • bash -n regression-test/pipeline/common/teamcity-utils.sh and git diff --check passed.
  • No live CI rerun performed for this change.

Release note

None.

Check List (For Author)

  • Behavior changed: Yes (open draft PRs accept authorized comment triggers).
  • Does this need documentation: No.
  • Pre-submission status: Ready.

AI Disclosure

  • Tool: OpenAI Codex.
  • Generated: Code change, tests and PR description.
  • Human review: Pending.

### Background

PR comment commands use a shared TeamCity helper to verify the PR before submitting builds or writing file-filter skip statuses.

### What problem does this PR solve?

Issue Number: None
Related PR: apache#70459 (introduced the draft restriction), apache#70515 (retained it)
PR Type: Bugfix

Problem Summary:
Authorized `run buildall` and individual commands fail on open draft PRs, including when a lane should only write a skip status. Allow draft PRs through the shared gate while retaining the open-state, exact head and target-branch checks.

### Details

- **Frequency:** Every comment-triggered build or skip for a draft PR.
- **Root cause:** The common PR identity check also required `draft == false`.
- **Why existing tests missed it:** Existing dispatch tests replaced the PR check with a freshness stub.
- **Fix:** Remove only the draft predicate. New tests exercise the real PR predicate for both enqueue and skip paths.
- **Other paths and branches:** The shared helper covers all supported comment-triggered lanes and branches. Workflow commenter authorization and file filters are unchanged.

### Testing

- `python3 regression-test/pipeline/common/tests/test_teamcity_utils.py`: 29 tests passed locally.
- The new draft acceptance test fails against the original predicate.
- Negative coverage verifies closed PRs, changed heads and changed target branches cannot enqueue builds or write skip statuses.
- `bash -n regression-test/pipeline/common/teamcity-utils.sh` and `git diff --check` passed.
- No live CI rerun performed for this change.

### Release note

None.

### Check List (For Author)

- Behavior changed: Yes (open draft PRs accept authorized comment triggers).
- Does this need documentation: No.
- Pre-submission status: Ready.

### AI Disclosure

- Tool: OpenAI Codex.
- Generated: Code change, tests and PR description.
- Human review: Pending.
@hello-stephen

Copy link
Copy Markdown
Contributor Author

skip buildall

@mrhhsg
mrhhsg merged commit 1323628 into apache:master Nov 16, 2026
35 checks passed
@hello-stephen
hello-stephen deleted the fix/allow-draft-teamcity-only-20261116 branch November 16, 2026 13:56
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