Skip to content

refactor: delegate dependency checks to git-pkgs modules - #19

Merged
algomaster99 merged 2 commits into
chains-project:mainfrom
andrew:codex/yul-dedup
Aug 22, 2026
Merged

refactor: delegate dependency checks to git-pkgs modules#19
algomaster99 merged 2 commits into
chains-project:mainfrom
andrew:codex/yul-dedup

Conversation

@andrew

@andrew andrew commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This moves yul's manifest parsing, exact-version checks, latest-version selection, enrichment routing, and GitHub ref resolution onto APIs contributed to the git-pkgs modules. The local behavior now comes from released modules instead of parallel implementations.

Removing the duplicate code exposed several bugs in yul:

  • Source declarations were keyed by package or action name, so the same dependency in multiple package.json sections and repeated uses of a GitHub Action could overwrite one another.
  • Changed-pin detection compared only the version at a location, so replacing a package or action with a different one at the same version could be missed.
  • Version comments for SHA-pinned actions were keyed only by action name. Repeated pins of the same action at different SHAs could therefore use the wrong version comment.
  • Any pin different from the registry's reported latest version was treated as outdated, including a pin that was newer than the reported latest version.
  • npm aliases were not consistently resolved to the aliased package identity.
  • yul always constructed the ecosyste.ms enrichment backend directly, bypassing the configured direct or hybrid backend.

These changes depend on work contributed upstream:

  • git-pkgs/vers#32, released in v0.4.0, adds shared exact-version detection for native constraints.
  • git-pkgs/manifests#74, released in v0.10.0, adds location-aware declarations for npm, PyPI, and GitHub Actions while preserving duplicate declarations.
  • git-pkgs/registries#69, released in v0.8.0, centralizes latest-version selection.
  • git-pkgs/forge#150, released in v0.9.0, adds GitHub ref-to-commit resolution.
  • git-pkgs/enrichment#60, released in v0.7.0, delegates latest-version selection to registries.

The yul integration keeps its existing timeout and User-Agent behavior while delegating those shared responsibilities.

@algomaster99
algomaster99 requested a balanced review from Copilot August 22, 2026 17:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@algomaster99

Copy link
Copy Markdown
Member

Didn't see this until now. Taking a look.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Comment thread pkg/util/resolver/enrichment.go
Comment thread pkg/githubactions/workflow.go
@algomaster99

Copy link
Copy Markdown
Member

yul always constructed the ecosyste.ms enrichment backend directly, bypassing the configured direct or hybrid backend.

@andrew does this help you in logging?

SHA-pinned actions normalize actionPin.version to the trailing
comment's tag, so change detection (prior == pin) couldn't see the
actual pinned commit. Re-pinning a SHA action to a different commit
while keeping the same version comment (or converting a tag pin to
this form) was therefore treated as untouched and never checked
against latest.

Preserve the raw declaration.Version on actionPin as ref, which
participates in the equality check without affecting comparison or
reporting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@algomaster99
algomaster99 merged commit 1c23599 into chains-project:main Aug 22, 2026
2 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.

3 participants