Skip to content

Conversation

brrygrdn
Copy link
Contributor

What are you trying to accomplish?

The UpdateGraphCommand is slightly simpler than the UpdateFilesCommand as it doesn't need to do modal operation between version/security updates or PR grouping strategies, it just needs to iterate over N directories and submit a snapshot for each.

The Dependabot::DependencySnapshot component also early-evaluates the file parser and this is something we'd ideally leave later in the individual graphing operation so we can run additional steps before or after it, or in extreme cases use an alternative parser.

This change reflows the UpdateGraphCommand and rearranges the responsibilities so that:

  • The Dependabot::DependencySnapshot component is dropped in favour of plucking things out of the Environment.job_definition
    • We drop support for the job.directory key as a back compat concern our new command will not need to care about
  • The GithubApi::DependencySubmission component is now focused exclusively on serialising data into the right JSON for sending to the API
  • The Dependabot::DependencyGrapher now receives the parser to user to get the dependencies
  • The overall command is now compatible with multi-directory jobs, emitting one API call per directory

Anything you want to highlight for special attention from reviewers?

Mainly that the new testing surfaces make sense

How will you know you've accomplished your goal?

The overall graphing behaviour is unchanged by this, but we can now handle monorepo jobs where we need to parse a few directories at once.

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.

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.

1 participant