-
-
Notifications
You must be signed in to change notification settings - Fork 62
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(SCM) Introduces a "local" SCM with autoguessing #713
Conversation
d7c3b15
to
b79c139
Compare
b79c139
to
588ed58
Compare
Overall, it's a great PR. Thanks for paving the way But before merging I would like to clarify one thing Disable local scmI don't understand why and when to use the following block
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment nitpicks
Great job! 🎉
…mentation + mock implementation and add a new method RemoteUrls Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Rebase in progress (with conflict merge) |
…etection Signed-off-by: Damien Duportal <damien.duportal@gmail.com> Co-authored-by: Hervé Le Meur <91831478+lemeurherve@users.noreply.github.com>
@olblak Ready to review (approve/merge if ok). I've done full testing on jenkins-infra/kubernetes-management as usual with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Ref. #716
Depends on #717
This change request introduces a new feature for Updatecli: an automatic SCM identified as
local
.The "automatic guess" feature is not complete: for now, it only extracts some of the atrributes, the others have to be specified through manifest or env. vars. I expect more PRs to improve it along the way.
That's why the associated issue won't be closed.
For now:
Please note that:
github.com/goware/urlx
. Not strictly necessarly, but really useful to parse the hostname of the github SSH addresses. Might be doable with a good regexp, but that was too distracting for me to write such (as it needs tests, etc.).gitgeneric
package now provides an interface, implemented by the defaultGoGit{}
struct. Should not change anything (pluginsgit
,github
and others have been updated) but it allows mocking (a basic mock is provided because used by the code introduced in this PR) and would help in unit testing any SCM-dependent behavior.config
package was split (errors.go
to store the errors,defaults.go
for the logic around setting up default configuration). Be careful with rebases!scm
package was split to have a clear source file separation betweenscm.Scm
behaviors andscm.Config
behaviors (Validate was confusing before)Merge
methods forgit
andgithub
SCM plugins. This code could definitivelt be improved in the future, but it's around the whole "configuration definition" + "deep merge tree structures with zero-ed values". Too much compared to writing the 2 raws methods. Can be improved, but since it's tested and since we do not define new SCM plugins everyday, it's worth it for me.local
SCM as none of them use it (to avoid unplanned info/warning message).Test
To test this pull request, you can run the following commands:
make test make test-e2e
Additional Information
Makefile
to explain the env. var$VENOM_VAR_binpath
but also to fail fast with a comprehensive message when missing env vars are absent (instead of starting venom which fails)values.yaml
for now. If we want to end-to-end testing of the templating of values, we have to add a specific test for this. Otherwise it adds too much varying elements. Another idea: we can also make this file back, but the Makefile would parse it to list the required environment variables in a centralized location).