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

Feat: Add Autodiscovery for Maven dependencies #833

Merged
merged 14 commits into from
Sep 2, 2022

Conversation

olblak
Copy link
Member

@olblak olblak commented Aug 29, 2022

Fix #XXX

  • Credentials handling

Test

To test this pull request, you can run the following commands:

Scenario 1

go build -o bin/updatecli && ./bin/updatecli diff --config e2e/updatecli.d/warning.d/autodiscovery/maven/git.yaml --experimental 
cd pkg/plugins/autodiscovery/maven/
go test

Scenario 2

go build -o bin/updatecli 
cd <to a Maven project>
updatecli diff --experimental --local-autodiscovery

Additional Information

This crawler can be used such as

autodiscovery:
  # scmid is applied to all crawlers
  scmid: default
  crawlers:
    maven:
      # By default enabled
      enable: true
      # To ignore specific path
      #ignore:
      #  - path: <filepath relative to scm repository>
      #only:
      #  - path: <filepath relative to scm repository>

Tradeoff

After additional thoughts on how to handle credentials, I came to the conclusion that it would be easier to expose some parameter to provide credentials mapping repositories then trying to fetch those credentials from settings.xml

autodiscovery:
  # scmid is applied to all crawlers
  scmid: default
  crawlers:
    maven:
      # By default enabled
      enable: true
      # To ignore specific path
      #ignore:
      #  - path: <filepath relative to scm repository>
      #only:
      #  - path: <filepath relative to scm repository>
      auths:
          repo.jenkins-ci.org:
              username: xxx
              password: yyy

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added enhancement New feature or request resource-mavenrepository Resource of kind Maven Repository autodiscovery All things related to the autodiscovery feature labels Aug 29, 2022
@olblak olblak marked this pull request as draft August 29, 2022 20:00
@olblak olblak marked this pull request as ready for review September 1, 2022 19:16
Signed-off-by: Olblak <me@olblak.com>
@olblak
Copy link
Member Author

olblak commented Sep 2, 2022

I'll look to the credentials in a different PR. I am gonna merge the PR so I can already start testing it widely

@olblak olblak merged commit adfc1f8 into updatecli:main Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autodiscovery All things related to the autodiscovery feature enhancement New feature or request resource-mavenrepository Resource of kind Maven Repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant