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

Add more support for Azure DevOps #204

Merged
merged 5 commits into from
Dec 21, 2023

Conversation

JamieMagee
Copy link
Contributor

@JamieMagee JamieMagee commented Dec 6, 2023

Adds the following features:

  • Ability to pass an --api-url flag which gets passed through as the DEPENDABOT_API_URL environment variable for the updater container
    • Still falls back to http://host.docker.internal if one isn't provided
  • Adds credentials for the API URL, Azure DevOps, and Azure Artifacts from the LOCAL_AZURE_ACCESS_TOKEN environment variable
  • Passes through the DEPENDABOT_JOB_ID environment variable to the updater container
    • Still falls back to the cli job ID if the environment isn't set
  • A new struct and parsing logic for Azure DevOps repository format

TODO:

  • Additional support for setting input and job parameters from environment variables
    • Will handle this in a separate PR

@JamieMagee JamieMagee force-pushed the azure-devops-support branch 2 times, most recently from bc5bd08 to b290447 Compare December 6, 2023 17:14
cmd/dependabot/internal/cmd/test.go Show resolved Hide resolved
cmd/dependabot/internal/cmd/update.go Outdated Show resolved Hide resolved
@JamieMagee JamieMagee force-pushed the azure-devops-support branch 5 times, most recently from a460103 to 2ac27ec Compare December 20, 2023 00:20
@JamieMagee
Copy link
Contributor Author

Finished porting the code changes, but still need to fix some tests.

@JamieMagee JamieMagee marked this pull request as ready for review December 20, 2023 00:21
@JamieMagee JamieMagee requested a review from a team as a code owner December 20, 2023 00:21
go.mod Outdated Show resolved Hide resolved
jakecoffman
jakecoffman previously approved these changes Dec 20, 2023
@jakecoffman jakecoffman dismissed their stale review December 20, 2023 21:46

one sec checking something

@jakecoffman
Copy link
Member

(We need to add some better command line testing around the positional arguments.)

This doesn't work with this PR: dependabot update go_modules dependabot/cli

updater | 2023/12/20 21:48:12 ERROR Error during file fetching; aborting: Cloning into '/home/dependabot/dependabot-updater/repo'...
updater | warning: Could not find remote branch --single-branch to clone.
updater | fatal: Remote branch --single-branch not found in upstream origin

I would guess it's because we're now setting the branch to an empty string and the Updater thinks an empty string branch name is ok.

To fix it, I would change the Source struct to not have a pointer to Branch anymore, like Commit.

@JamieMagee
Copy link
Contributor Author

Thanks for the sanity check. I made Branch a value instead of a pointer.

Copy link
Member

@jakecoffman jakecoffman left a comment

Choose a reason for hiding this comment

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

Nice work 👍

@jakecoffman jakecoffman merged commit f50317a into dependabot:main Dec 21, 2023
61 checks passed
@JamieMagee JamieMagee deleted the azure-devops-support branch December 21, 2023 21:21
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