Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass job file path to analyze command #11089

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Dec 10, 2024

The discover and update NuGet tool commands both have a --job-path argument so that the current set of experiments can be parsed.

This PR adds the same behavior to the analyze command. We don't yet need the experiments for this command, but we will soon so this is front loading some of the work.

@brettfo brettfo requested a review from a team as a code owner December 10, 2024 00:01
@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Dec 10, 2024
@brettfo brettfo force-pushed the dev/brettfo/nuget-pass-job branch 2 times, most recently from b0715bb to 4f543fd Compare December 10, 2024 17:15
@brettfo brettfo force-pushed the dev/brettfo/nuget-pass-job branch from 4f543fd to 626a388 Compare December 10, 2024 21:35
@randhircs randhircs merged commit ff29929 into main Dec 10, 2024
70 checks passed
@randhircs randhircs deleted the dev/brettfo/nuget-pass-job branch December 10, 2024 23:10
@andrcuns
Copy link
Contributor

@brettfo This seems to break the ability to use dependabot-core nuget updater as a standalone outside of GitHub given it now depends on DEPENDABOT_JOB_PATH which if I understand correctly is a path to json file that only GitHub instrumentation inserts (it probably got broken even earlier when --job-path argument was added but this will most likely raise an error earlier directly from ruby code now rather than from within the native helpers).

Would you be able to advise if the team still plans to support a usecase for dependabot-core to be usable as a standalone library or it is not a priority anymore?

@brettfo
Copy link
Contributor Author

brettfo commented Dec 18, 2024

Going forward we're trying to only use dependabot through the CLI which uses the proxy image to handle authentication. The reason is that we'd otherwise have to maintain two versions of the code that handles authentication and since the official implementation uses the CLI and proxy, that's the easiest route for us to follow.

@andrcuns
Copy link
Contributor

andrcuns commented Dec 18, 2024

Going forward we're trying to only use dependabot through the CLI which uses the proxy image to handle authentication. The reason is that we'd otherwise have to maintain two versions of the code that handles authentication and since the official implementation uses the CLI and proxy, that's the easiest route for us to follow.

@brettfo I haven't looked in to CLI, is it usable outside GitHub's ecosystem?

edit:

Never mind, I see from the README that it is. Thanks for your response.

@brettfo
Copy link
Contributor Author

brettfo commented Dec 18, 2024

@andrcuns One method to run it locally would be to use the CLI that you found with the following setup:

  • job.yml with the appropriate data. The CLI repo has an example in the README.
  • If you don't want to have to clone the repo you can pass the arguments --local C:\path\to\repo and the files will be zipped and injected into the updater container.
  • Specify an output file on the command line to get a helpful YAML file that describes the operations performed.

As an example, you might invoke it with: dependabot update -f job.yml -o result.yml --local C:\path\to\repo and that would run it from local files. The result file looks like this. The relevant parts are under output where type is create_pull_request.

@andrcuns
Copy link
Contributor

@brettfo Thanks for the example.

My main problem is that I maintain what now is a fairly complex rails app that implements instrumentation around dependabot-core and allows to have a stateful service for managing dependency updates for GitLab.

It actually looks like I could update it to use the CLI and save myself a ton of headache when trying to follow along all the changes in core, it looks like the output actually provides most of the data I would need. The main issue is that it's a cloud native app with ability to deploy to k8s cluster. Not sure how to run the cli in that scenario 😄

Anyhow, thanks for the response, at least now I know general direction core is going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants