Skip to content

fix(build): skip rerun-if-changed for .files() in Buf mode#59

Open
hobostay wants to merge 1 commit intoanthropics:mainfrom
hobostay:fix/build-buf-rerun-if-changed
Open

fix(build): skip rerun-if-changed for .files() in Buf mode#59
hobostay wants to merge 1 commit intoanthropics:mainfrom
hobostay:fix/build-buf-rerun-if-changed

Conversation

@hobostay
Copy link
Copy Markdown

Summary

  • Skip emitting cargo:rerun-if-changed for .files() entries when using Config::use_buf(), since those entries are proto-relative names (not filesystem paths)

Problem

In Buf mode, .files() holds proto-relative names like "my/service.proto", not filesystem paths. Emitting cargo:rerun-if-changed=my/service.proto points cargo at a non-existent file, which forces a rebuild on every invocation.

This is the same issue that was fixed for Precompiled mode in #56, but Buf mode was missed in that fix. The comment on DescriptorSource::Precompiled already explains the rationale:

self.files holds proto-relative names (per the docs on descriptor_set()), not on-disk paths; emitting rerun-if-changed for them points cargo at missing files and forces a rebuild on every invocation.

The same applies to Buf mode — the docs on Config::use_buf() say:

Config::files() must contain proto-relative names as they appear in the buf module (e.g. "my/service.proto"), not filesystem paths.

Test plan

  • Existing tests pass (cargo test -p connectrpc-build)
  • The fix mirrors the approach already used for Precompiled mode

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

In Buf mode, `.files()` holds proto-relative names (e.g. "my/service.proto"),
not filesystem paths. Emitting `cargo:rerun-if-changed` for these points
cargo at non-existent files, forcing a rebuild on every invocation.

This is the same issue that was fixed for Precompiled mode in anthropics#56, but
Buf mode was missed in that fix.
@iainmcgin iainmcgin force-pushed the fix/build-buf-rerun-if-changed branch from 27e9444 to e79f695 Compare April 30, 2026 18:14
@iainmcgin
Copy link
Copy Markdown
Collaborator

@hobostay you need to post "I have read the CLA Document and I hereby sign the CLA" here too - I know you did this for the buffa repo, but the CLA records are separately managed in each repo.

iainmcgin added a commit that referenced this pull request Apr 30, 2026
…r trailers) (#73)

Bumps the CLA assistant action from `eeb7f3f` (v2.7.1) to `1ecf0d2f`.

## What's new in the action

- **Impersonation guard** — new `require-opener-as-author` input
(default `true`): fails the check if the PR opener is not recorded as an
author or `Co-authored-by` of any commit in the PR. Guards against an
attacker opening a PR whose commits are attributed to a trusted
identity. Emits an `opener_not_in_commits` output regardless of
pass/fail. Runs before the allowlist filter, so allowlisted maintainers
are not exempt.
- **PR opener and `Co-authored-by:` trailers join the committer set** —
previously only `commit.author` was checked. The PR submitter and any
co-author trailers must now also sign (or be allowlisted). Noreply-form
trailer emails (`<id>+<login>@users.noreply.github.com`) are parsed
directly to login/id.
- **Actionable unlinked-email guidance** — when a commit author's email
is not linked to any GitHub user, the bot now posts a `> [!WARNING]`
block listing each unlinked email with concrete remediation (link at
github.com/settings/emails, or rewrite commands).
- Dead-404-path bugfix (signatures-file bootstrap now works first-time),
broken-markdown fix in the signed list, pagination for
comments/runs/commits, TypeScript 6, knip/publint/actionlint.
- Removed `signed-empty-commit-message` input (we don't use it).

## Config

Kept `require-opener-as-author` at the default `true`. No new inputs
wired. Allowlist preserved verbatim.

## Operational impact

- **Author-rewrite for unlinked-email contributors** (e.g. the recent
author-rewrite on PR #59) — still works: the contributor is the PR
opener and appears via the `Co-authored-by:` trailer, so no opener
mismatch. They are now correctly required to sign.
- **Signed-squash for unsigned fork commits** — the squash commit
message **must include** `Co-authored-by: <login>
<id+login@users.noreply.github.com>` for the PR opener, or the
impersonation guard will fail the check.

## Note

`pull_request_target` runs the workflow from the **base** branch, so
this PR's own CLA check still uses the old `eeb7f3f` pin. The new action
is first exercised on the next PR opened/synced after this merges.

Fixes #72
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