Skip to content

fix(deps): remove the yanked core2 dependency - #655

Merged
beardthelion merged 3 commits into
mainfrom
deps/remove-yanked-core2
Dec 1, 2026
Merged

beardthelion merged 3 commits into
mainfrom
deps/remove-yanked-core2

Conversation

@beardthelion

@beardthelion beardthelion commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Update CID to 0.11.3 and drop multihash-codetable without changing Git object CIDs.

Motivation & context

core2 was yanked and is unmaintained.

Kind of change

  • Bug fix
  • Feature
  • Security fix
  • Docs
  • Tests / CI
  • Refactor (no behavior change)
  • Breaking or protocol change (issue required first)

What changed

  • Update the CID pin and remove multihash-codetable from the workspace and twigpine-core manifests.
  • Reuse the existing SHA-256 CID encoder in twigpine-core. A known vector checks that the output stays the same.
  • Prune the 13 rows of ci/twigpine-core-allowed-deps.txt that left the twigpine-core dependency closure with multihash-codetable (core2 and the multihash-derive proc-macro chain), so the purity gate fails if core2 comes back. curve25519-dalek-derive stays: curve25519-dalek depends on it only on x86_64, so a run on another architecture lists it as stale while CI needs it.

How a reviewer can verify

Run from the repository root with DATABASE_URL set to a local Postgres test database and cargo-audit installed.

cargo test --locked -p twigpine-core git_object_cid_matches_known_vector
scripts/check-twigpine-core-deps.sh
cargo fmt --all -- --check
cargo clippy --locked --workspace --all-targets -- -D warnings
cargo test --locked --workspace
cargo audit
cargo +1.91 check --locked --workspace --all-targets

Before you request review

  • Scope is one logical change; no unrelated churn
  • cargo test --workspace passes locally
  • New behavior is covered by tests (required for fixes)
  • cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings are clean
  • Commit titles use Conventional Commits (feat(...), fix(...), docs(...))
  • Docs / .env.example updated if behavior or config changed (or N/A)
  • Checked existing PRs so this isn't a duplicate

Notes for reviewers

The CID vector and dependency allowlist check passed. Postgres workspace tests, fmt, audit, and the Rust 1.91 check passed locally. The hosted fmt + clippy job passed.

The Cargo.lock change also moves data-encoding-macro-internal from syn 2.0.117 to syn 1.0.109 once the multihash-codetable proc-macro subgraph is gone. That is resolver fallout, not a code change, and the cid:: tests pass.

Summary by CodeRabbit

  • Refactor
    • Git blob CIDs continue to be generated using SHA-256, with a known-value check added to verify the result.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

from_git_object_bytes now hashes Git object bytes with the local SHA-256 helper and delegates CID construction to from_sha256_bytes. The change removes the multihash-codetable dependency, updates the dependency allowlist, and adds a known-vector test.

Changes: CID hashing

Layer / File(s) Summary
Git object hashing and validation
Cargo.toml, crates/twigpine-core/Cargo.toml, crates/twigpine-core/src/cid.rs, ci/twigpine-core-allowed-deps.txt
from_git_object_bytes uses sha256_bytes and delegates CID construction to from_sha256_bytes. The workspace and twigpine-core dependency declarations no longer include multihash-codetable. The dependency allowlist removes multihash-codetable and related entries. A known-vector test checks the CID for a Git blob.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: kevincodex1

Merge Risk: Minimal · up to 5ab9d · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the removal of the yanked core2 dependency. The changeset does remove core2 from the twigpine-core allowlist and drops multihash-codetable, which pulls in core2 transitively. The title…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template and fills in the Summary, Motivation & context, Kind of change, What changed, How a reviewer can verify, Before you request review, and Notes for review…
Full details: Title check

Explanation

The title names the removal of the yanked core2 dependency. The changeset does remove core2 from the twigpine-core allowlist and drops multihash-codetable, which pulls in core2 transitively. The title is specific and matches the author's stated motivation, though the main code change is the removal of multihash-codetable. It follows the Conventional Commits form used in the repository.

Full details: Description check

Explanation

The description follows the repository template and fills in the Summary, Motivation & context, Kind of change, What changed, How a reviewer can verify, Before you request review, and Notes for reviewers sections. It states the CID bump to 0.11.3, the removal of multihash-codetable, the reuse of the SHA-256 CID encoder, and the pruning of 13 allowlist rows, and it names the verification commands. Gaps: the 'Closes #' issue link is blank, the Motivation section gives only a one-line advisory link and no linked prior discussion, and the Protocol & signing impact block was removed even though the template marks it optional. The description also says the change is a refactor with no behavior change, which matches the summary and objectives. Confirmation of the actual test results is reported only as author statements.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 949c58b4-08ef-4a72-a523-49e211c5d2aa
Commits

Reviewing files that changed from the base of the PR and between 21a83fb and 5ab9d37.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 1

  • ci/twigpine-core-allowed-deps.txt
Files with no reviewable changes: 1

  • ci/twigpine-core-allowed-deps.txt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟢 Thanks for the contribution. I do not see any actionable issues from my review.

Merge readiness

  • Review gate: GitHub reports mergeStateStatus: BLOCKED while the diff is MERGEABLE and CI is green — expect an approving review (or branch policy) before merge.
  • Allowlist hygiene (optional, non-blocking): scripts/check-twigpine-core-deps.sh prints a 13-crate NOTE (including core2 and multihash-codetable) because ci/twigpine-core-allowed-deps.txt was not regen’d in this PR. CI still passes by design (stale rows are informational). Pruning those rows per the header regen command would restore the allowlist as live closure truth and close the reintroduction blind spot for those crate names.
  • Lockfile collateral: The PR lock hunk also moves data-encoding-macro-internal from syn 2.0.117 to syn 1.0.109 when the codetable proc-macro subgraph drops — incidental resolver fallout, not a shown runtime defect (twigpine-core cid:: tests pass). Worth a one-line PR note if you want reviewers to expect it.
  • PR template: CodeRabbit noted missing template sections (kind of change, Closes #, checklist). Non-blocking given the body’s technical summary and CI evidence.

…-codetable

Removing multihash-codetable drops 13 crates from twigpine-core's normal
dependency closure on every target (core2 and the multihash-derive proc-macro
chain). Leaving them listed meant a reintroduced core2 would still pass the
purity gate.

curve25519-dalek-derive stays: curve25519-dalek only depends on it on
x86_64, so a non-x86_64 local run reports it stale while CI needs it.
@beardthelion
beardthelion added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit ec8a0c6 Dec 1, 2026
23 checks passed
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