Skip to content

Stop writing the PR number into the size label artifact - #6261

Merged
ChrisJBurns merged 1 commit into
mainfrom
drop-pr-number-artifact
Aug 10, 2026
Merged

Stop writing the PR number into the size label artifact#6261
ChrisJBurns merged 1 commit into
mainfrom
drop-pr-number-artifact

Conversation

@ChrisJBurns

@ChrisJBurns ChrisJBurns commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

#6259 and #6260 have merged, so this is now a single commit against main and the blocker below no longer applies.

Summary

  • Nothing reads pr-number.txt any more. Derive PR number from the triggering run in the size labeler #6259 changed the apply workflow to derive the pull request number from its own workflow_run event instead of from the artifact, because the artifact is produced by a pull_request workflow and is therefore attacker-influenced. This removes the now-unused write.
  • It could not be done in Derive PR number from the triggering run in the size labeler #6259 itself. workflow_run consumers always execute the copy of the workflow on the default branch, never the version in the pull request. A pull request can change the producer — which does run from the pull request head — but cannot change the consumer reading its output until it merges. Dropping the write alongside the consumer change failed the apply job on every open pull request, because the producer stopped writing the file while main's consumer was still reading it.

So this is phase two of a two-phase rollout:

Phase Change Effect
#6259 Consumer stops reading pr-number.txt; producer keeps writing it Old consumer on main still works throughout
This PR Producer stops writing it Safe once the new consumer is on main

CI state

#6259 is on main, so the consumer running against this pull request is the new one that ignores pr-number.txt. The apply job passes here — the ordering hazard described above is resolved, not merely tolerated.

Part of #6253

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

Does this introduce a user-facing change?

No.

Special notes for reviewers

  • The artifact now carries a single file whose only permitted values are the five size/* labels, checked by the consumer. There is nothing left in it that can influence which pull request is acted on.

Generated with Claude Code

@ChrisJBurns
ChrisJBurns requested a review from JAORMX as a code owner August 10, 2026 17:31
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Aug 10, 2026
Base automatically changed from harden-claude-workflow-gate to main August 10, 2026 17:32
Nothing reads it now: the apply workflow derives the number from its own
workflow_run event. The write was kept only so the consumer still on the
default branch, which did read it, would keep working until that change
landed. It has, so the artifact carries the label alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ChrisJBurns
ChrisJBurns force-pushed the drop-pr-number-artifact branch from 9ffc139 to 8300561 Compare August 10, 2026 17:33
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.71%. Comparing base (d163115) to head (8300561).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6261      +/-   ##
==========================================
- Coverage   72.71%   72.71%   -0.01%     
==========================================
  Files         742      742              
  Lines       77299    77299              
==========================================
- Hits        56209    56208       -1     
- Misses      17126    17127       +1     
  Partials     3964     3964              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisJBurns
ChrisJBurns merged commit 0ff8015 into main Aug 10, 2026
46 checks passed
@ChrisJBurns
ChrisJBurns deleted the drop-pr-number-artifact branch August 10, 2026 19:07
@github-actions github-actions Bot mentioned this pull request Aug 14, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants