Skip to content

Avoid sheering off directories by using manifest_file.directory#14439

Merged
brrygrdn merged 2 commits into
mainfrom
brrygrdn/dg-9769-use-manifest-directory
Mar 13, 2026
Merged

Avoid sheering off directories by using manifest_file.directory#14439
brrygrdn merged 2 commits into
mainfrom
brrygrdn/dg-9769-use-manifest-directory

Conversation

@brrygrdn
Copy link
Copy Markdown
Contributor

@brrygrdn brrygrdn commented Mar 13, 2026

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.dirname I'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

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@brrygrdn brrygrdn requested a review from a team as a code owner March 13, 2026 18:05
Copilot AI review requested due to automatic review settings March 13, 2026 18:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_path to use manifest_file.directory.
  • Adjust and extend UpdateGraphProcessor specs 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.

Comment thread updater/lib/github_api/dependency_submission.rb
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@brrygrdn brrygrdn merged commit aebed6b into main Mar 13, 2026
168 of 169 checks passed
@brrygrdn brrygrdn deleted the brrygrdn/dg-9769-use-manifest-directory branch March 13, 2026 20:03
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