feat(ruby): emit dependency relationships from Gemfile.lock#4986
Open
cgreeno wants to merge 1 commit into
Open
feat(ruby): emit dependency relationships from Gemfile.lock#4986cgreeno wants to merge 1 commit into
cgreeno wants to merge 1 commit into
Conversation
b28f915 to
829b3f6
Compare
Schema Change DetectionNew Schemas
|
Contributor
|
@cgreeno since I merged your other elixir PR first this now has some schema conflicts. Can you do a quick rebase and regenerate the schema with the composite changes? |
Parse each gem's dependency list from Gemfile.lock into a new RubyGemfileLockEntry metadata type and use the shared dependency.Processor to resolve dependency-of relationships between locked gems, matching the pattern used by the other lockfile catalogers (elixir, python, rust, ...). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Chris Greeno <cgreeno@gmail.com>
829b3f6 to
ee6164d
Compare
Contributor
Author
|
@spiffcs - ok fixed |
Contributor
Author
|
@spiffcs - gentle nudge :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Ruby
Gemfile.lockparser catalogued gems but discarded the indented dependency lines beneath each spec, so it emitted no relationships. Those lines already encode the dependency graph (the gems listed under each spec are exactly its dependencies), so the graph is derivable from data already in the file — no new inputs required.This change emits
dependency-ofrelationships between locked gems. They are built inline in the parser, the waycpp/conananddotnetderive relationships from their lockfiles — Gemfile.lock packages carry no metadata struct, so there is nothing to hang adependency.Specifieroff, and a relationships-only change needs no metadata type. No new metadata type and no JSON schema change.Changeset:
syft/pkg/cataloger/ruby/parse_gemfile_lock.godependency-ofrelationships (gemfileLockRelationships); split line detection intoisGemSpecLine(4-space) andisGemDependencyLine(6-space)parse_gemfile_lock_test.goGemfile.lockfixtureparse_gemfile_lock_relationships_test.go(new)Type of change: New feature (non-breaking) — adds relationship data without altering existing package output; no schema impact.
This mirrors the Elixir
mix.lockchange in #4985.