Skip to content

ci(workflows): fix hash-change labeller false-positive on every PR#1190

Merged
MiguelLZPF merged 1 commit into
developmentfrom
fix/hash-change-label-false-positive
May 25, 2026
Merged

ci(workflows): fix hash-change labeller false-positive on every PR#1190
MiguelLZPF merged 1 commit into
developmentfrom
fix/hash-change-label-false-positive

Conversation

@MiguelLZPF
Copy link
Copy Markdown
Contributor

Description

The hash-change labeller in 105-flow-ats-static-checks.yaml used grep -lE over
the current file contents of every changed .sol file. Because ~25% of .sol files
in the repo declare a bytes32 constant = 0x<64-hex> (resolver keys, ERC-7201 storage
slots, role hashes, etc.), nearly every contract PR was receiving the hash-change label
regardless of whether an actual hash value was added, removed, or modified.

Fix: switch to git diff --name-only origin/<base> HEAD -G <hash_re> so the label only
fires when an added or removed line in the PR diff itself matches the hash pattern.
The scripts/codegen/ short-circuit is preserved unchanged.

Type of change

  • Bug fix 🐞
  • New feature ✨
  • Breaking change 💥
  • Documentation update 📖
  • Refactor 🔧

Testing

Workflow-only change — no application code was modified.

Verified the git diff -G regex logic locally against several PRs:

  • A PR that only adds NatSpec to a file with a bytes32 constant declaration → label NOT applied (was previously a false-positive).
  • A PR that modifies a bytes32 constant value → label IS applied correctly.
  • A PR touching scripts/codegen/ → label IS applied via the short-circuit path.

CI will validate workflow YAML syntax on this PR.

Node version: N/A — workflow-only change.

  • 20
  • 22
  • 24

Checklist

  • Style Guidelines followed ✅
  • Documentation Updated 📚
  • Linters - No New Warnings ⚠️
  • Local Tests Pass ✅
  • Effective Tests Added ✔️
  • No reduction of Coverage

The labeller in 105-flow-ats-static-checks.yaml used `grep -lE` over the
current file contents, so any .sol file containing a `bytes32 constant
= 0x<64-hex>` declaration matched — ~25% of .sol files in the repo
declare such constants (resolver keys, storage slots, role hashes,
ERC-7201 slots), so nearly every contract PR was getting the label
regardless of whether a hash had actually changed.

Switch to `git diff --name-only origin/<base> HEAD -G <hash_re>` so the
label only fires when an added or removed line in the PR diff actually
hits the hash pattern.

The `scripts/codegen/` short-circuit is preserved — any change there is
always hash-relevant.

Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
@MiguelLZPF MiguelLZPF self-assigned this May 22, 2026
@MiguelLZPF MiguelLZPF added the no-changeset bypass changeset check label May 22, 2026
@MiguelLZPF MiguelLZPF assigned MiguelLZPF and unassigned MiguelLZPF May 22, 2026
@MiguelLZPF MiguelLZPF marked this pull request as ready for review May 22, 2026 12:48
@MiguelLZPF MiguelLZPF requested review from a team as code owners May 22, 2026 12:48
@MiguelLZPF MiguelLZPF merged commit f575bbf into development May 25, 2026
19 of 22 checks passed
@MiguelLZPF MiguelLZPF deleted the fix/hash-change-label-false-positive branch May 25, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset bypass changeset check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants