Skip to content

feat(gitbranch): Add git url param to gitbranch plugin#2850

Merged
olblak merged 12 commits intoupdatecli:mainfrom
olblak:feat/gitbranch
Oct 29, 2024
Merged

feat(gitbranch): Add git url param to gitbranch plugin#2850
olblak merged 12 commits intoupdatecli:mainfrom
olblak:feat/gitbranch

Conversation

@olblak
Copy link
Copy Markdown
Member

@olblak olblak commented Oct 19, 2024

Similarly to #2848

This pull request allows using the gitbranch plugin with a URL without having to specify a scmid
Using the scmid comes with the requirement that we need to know what branch the git repository use (master vs main) as Updatecli run git checkout operation before handling a resource, but in the context of the gitbranch all we need is running git clone to retrieve the branch locally.

The gitbranch plugin can now be used in three different ways

using the scmid to clone the repository
using the path parameter to analyze an already cloned git repository
using the url parameter to clone and then analyze the repository, which is more convenient for autodiscovery plugin like 

#1964

Test

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

cd <to_package_directory>
go test

Additional Information

Tradeoff

Potential improvement

I am considering deprecating the parameter path in favor of directory to align with scm naming

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added enhancement New feature or request resource-gitbranch labels Oct 19, 2024
@olblak
Copy link
Copy Markdown
Member Author

olblak commented Oct 19, 2024

I now realize this plugin is missing a lot of tests...

@olblak olblak changed the title feat(gittag): Add git url param to gittag plugin feat(gitbranch): Add git url param to gitbranch plugin Oct 19, 2024
@olblak olblak marked this pull request as draft October 19, 2024 19:38
olblak and others added 7 commits October 24, 2024 15:12
* Remove wrong validation as specific validation must be done on target
* Add sourcebranch parameter to specify what existing branch must be
  used to create the new one

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
@olblak olblak marked this pull request as ready for review October 28, 2024 17:08
@olblak olblak enabled auto-merge (squash) October 28, 2024 20:38
@olblak olblak merged commit f8308ce into updatecli:main Oct 29, 2024
@olblak olblak deleted the feat/gitbranch branch October 29, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request resource-gitbranch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant