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

create credential conveniences #36

Merged
merged 7 commits into from
Nov 9, 2022

Conversation

jakecoffman
Copy link
Member

When testing with credentials it's a bit redundant to have to specify the metadata in the job definition:

job:
  package-manager: docker
  allowed-updates:
    - update-type: all
  source:
    provider: github
    repo: dependabot/test
    directory: /docker
  credentials-metadata:
    - type: docker_registry
      registry: example.com
      replaces-base: true
    - type: docker_registry
      registry: example.com
credentials:
  - type: docker_registry
    registry: example.com
    username: user1
    password: $PW1
  - type: docker_registry
    registry: example.com
    username: user2
    password: $PW2

With this change, the following is equivalent to the above:

job:
  package-manager: docker
  allowed-updates:
    - update-type: all
  source:
    provider: github
    repo: dependabot/test
    directory: /docker
credentials:
  - type: docker_registry
    registry: example.com
    username: user1
    password: $PW1
    replaces-base: true
  - type: docker_registry
    registry: example.com
    username: user2
    password: $PW2

The CLI will automatically add the credentials-metadata section. This is more inline with how the dependabot.yml works.

I've also made the Credentials definitions all match up with a proper type rather than specifying a map everywhere.

@jakecoffman jakecoffman requested a review from a team as a code owner October 31, 2022 14:10
@jakecoffman jakecoffman changed the title add credential conveniences create credential conveniences Oct 31, 2022
Copy link
Contributor

@mattt mattt left a comment

Choose a reason for hiding this comment

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

I think this is a nice convenience. Nice work, @jakecoffman!

The one concern I have is that automatic behavior becomes invisible and become unexpected. What do you think about logging a debug / warning message giving a quick heads-up when the CLI makes these changes to a job definition?

@jakecoffman
Copy link
Member Author

@mattt makes sense. Along those lines I also added the injected credentials into the output so when specifying -o you end up with what was actually run.

@jakecoffman
Copy link
Member Author

I'm going to run with this locally for a bit longer to make sure there aren't any issues.

@jakecoffman jakecoffman merged commit 1f16b47 into main Nov 9, 2022
@jakecoffman jakecoffman deleted the jakecoffman/credentials-conveniences branch November 9, 2022 13:12
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.

2 participants