Skip to content

Fix bunny-api-spec=unknown in --version after iter-32 crate move#38

Merged
ractive merged 1 commit into
mainfrom
iter-32b/fix-spec-date-path
May 10, 2026
Merged

Fix bunny-api-spec=unknown in --version after iter-32 crate move#38
ractive merged 1 commit into
mainfrom
iter-32b/fix-spec-date-path

Conversation

@ractive

@ractive ractive commented May 10, 2026

Copy link
Copy Markdown
Owner

Summary

Iter-32 moved the binary into crates/hoppy-cli/ but build.rs was still
resolving specs/ relative to the package directory. specs/ lives at
the workspace root, so the lookup silently fell back to unknown and
hoppy --version regressed to:

```
hoppy 0.3.0 (sha=5de03da, bunny-api-spec=unknown)
```

Fix: resolve the specs directory via `CARGO_MANIFEST_DIR/../../specs`
so it works regardless of the cwd cargo was invoked from. Verified:

```
hoppy 0.3.0 (sha=5de03da, bunny-api-spec=2026-05-05)
```

Test plan

  • `cargo build --release` succeeds
  • `./target/release/hoppy --version` shows the spec date (not `unknown`)
  • `cargo fmt`, `cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace --quiet` clean
  • CI green on this PR

🤖 Generated with Claude Code

After iter-32 moved the binary into crates/hoppy-cli/, build.rs was
still looking for ./specs relative to the package directory, but specs/
lives at the workspace root. The spec-date lookup silently failed and
hoppy --version reported "bunny-api-spec=unknown".

Resolve specs/ via CARGO_MANIFEST_DIR/../../specs so the lookup works
regardless of the cwd cargo was invoked from. Verified locally:
  hoppy 0.3.0 (sha=5de03da, bunny-api-spec=2026-05-05)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 10, 2026 21:44
@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@ractive has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 41 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f4c8c34d-fd65-457e-a15b-d82d55efeb86

📥 Commits

Reviewing files that changed from the base of the PR and between 5de03da and d871533.

📒 Files selected for processing (1)
  • crates/hoppy-cli/build.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch iter-32b/fix-spec-date-path

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression in hoppy --version where the embedded bunny API spec date became unknown after the CLI crate moved under crates/hoppy-cli/, by resolving the specs/ directory relative to CARGO_MANIFEST_DIR (workspace-root-relative).

Changes:

  • Resolve specs/ via a workspace-relative path derived from CARGO_MANIFEST_DIR.
  • Update the build script to pass the computed specs path into newest_spec_mtime().
  • Only emit cargo:rerun-if-changed for specs/ when the directory exists (avoids missing-input issues in tarball/crates.io builds).

Comment thread crates/hoppy-cli/build.rs
Comment on lines 22 to 26
// Re-run when HEAD moves (only emit when the file actually exists, so
// crates.io / tarball builds don't trip "missing rerun-if-changed input").
if Path::new(".git/HEAD").exists() {
println!("cargo:rerun-if-changed=.git/HEAD");
}
@ractive
ractive merged commit 93daf04 into main May 10, 2026
10 of 11 checks passed
@ractive
ractive deleted the iter-32b/fix-spec-date-path branch May 10, 2026 21:50
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