Avoid sheering off directories by using manifest_file.directory#14439
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes scanned_manifest_path generation for dependency snapshot submissions by using the Dependabot::DependencyFile#directory field instead of deriving a directory from manifest_file.path, avoiding incorrect directory “shearing” when the manifest file name is blank.
Changes:
- Update
GithubApi::DependencySubmission#scanned_manifest_pathto usemanifest_file.directory. - Adjust and extend
UpdateGraphProcessorspecs to assert the correct scanned manifest path for subdirectory and missing-manifest cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| updater/lib/github_api/dependency_submission.rb | Uses the dependency file’s configured job directory directly when emitting metadata.scanned_manifest_path. |
| updater/spec/dependabot/update_graph_processor_spec.rb | Updates expected scanned_manifest_path for subdirectory snapshots and adds coverage for empty snapshots in a subpath. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jakecoffman
approved these changes
Mar 13, 2026
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.
What are you trying to accomplish?
I realised that I'm using the wrong method to obtain the manifest_file's directory, by using the path along with
File.dirnameI'm guessing at the fact I'm being given a full path to a file - if the filename is blank, which it is in error cases - this shears off the last directory in the path.Let's just use the right method and not second guess, it means we now align on the job's input directory, i.e. we'll see a trailing slash, but the service has normalisation that will cope with this.
Anything you want to highlight for special attention from reviewers?
N/A
How will you know you've accomplished your goal?
I can see the change in my test repo's Actions logs
Checklist