-
-
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
Move scm directive to top level #388
Conversation
6871fe0
to
0f71a70
Compare
In the current state of the pullRequest configuration, the
Another option (not implemented yet) would be to have some sort of heritage, like:
In this second example, we retrieve the scm spec via "pullequests.pr1.dependsTargetsOn[0].sourceID" and then merge it with pullRequests.pr1.spec |
A second open question that I have is how to reference that part of the code in this pullRequest will be remove once we fully remove the deprecated to specify scm configuration. |
@dduportal I propose to target the milestone v0.17.0 with only this PR |
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Rename scm interface to scmHandler Move scm package under pipeline
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
Co-authored-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Olblak <me@olblak.com>
I identified another regression where files defined modified by a target is done locally instead of the temporary location.
|
Signed-off-by: Olblak <me@olblak.com>
As seen together, it works as expected: I wasn't using the correct binary. Sorry for the PEBKAC. |
The root cause of the error is coming from #401 and is outside the scope of the current pull request. So at the moment, we need to execute updatecli at the root of the repository to have a successful run. |
Hop, opened an issue to track this #411 \o/ Good catch! |
First batch of testings:
|
As per https://github.com/updatecli/updatecli/pull/388/files#diff-d217d87f213d484dd97f5b4a68a98a57de54d6404c000f7c81167a0371cb963dR35, I was missing the |
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.
🚀 👏
Awesome, thanks for you helping on testing this refactoring. Once the documentation is written, I'll merge this PR and trigger release |
Once again, thanks for your help on this refactoring |
- Deprecated field "version" - updatecli/updatecli#590 - Deprecated fields "postfix/prefix" - updatecli/updatecli#590 - Deprecated fields "replacers" - updatecli/updatecli#592 - SCM setup moved to the top level directive scms - updatecli/updatecli#388 - Deprecated top-level field source (singular source) - updatecli/updatecli#589 Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
- Deprecated field "version" - updatecli/updatecli#590 - Deprecated fields "postfix/prefix" - updatecli/updatecli#590 - Deprecated fields "replacers" - updatecli/updatecli#592 - SCM setup moved to the top level directive scms - updatecli/updatecli#388 - Deprecated top-level field source (singular source) - updatecli/updatecli#589 Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Move SCM directive to top-level
Fix #260
Fix #261
Before this pull request, "scm" configurations are configured per resource at the source/condition/target level.
The consequence of that approach is that it generates a lot of duplicates.
Starting from now, each scm configuration is defined once at the top level and each resource (source/condition/target) references the scm using a scm id.
Due to how "scm" is a central component of updatecli, I had to differentiate scm "configuration" provide via a configuration, scm interface used by git and Github to manipulate git repository.
I also split
pull request
configuration into a top-level one as explained in fix #261 . I was refactoring thescm
code anywayHere is an example of a new configuration
.example
Test
To test this pull request, you can run the following commands:
go build -o bin/updatecli; ./bin/updatecli diff --config examples/updateCli.generic/githubRelease.tpl --values examples/values.yaml ./bin/updatecli show --config examples/updateCli.generic/githubRelease.tpl --values examples/values.yaml
Additional Information
In order to not break the existing updatecli pipeline configuration, I did the extra effort to convert "internally" the old syntax to the new one with the specificity that a GitHub scm would also automatically add pull request configuration.
I am still not sure if I want that to be the definitive approach.
In this pull request, I also decided the move the go packages
source
,condition
,target
, under the packagepipeline
instead ofengine
as I think it makes more sense to be there, next to scm and pull request.Changelog
An updatecli pipeline configuration can now use two additional top resources,
scms
andpullrequests
where they respectively allow to configuration sc's configuration and pullrequests' configuration.Similiar to
sources
,conditions
, andtargets
:scms
andpullrequests
expect a "map" of configuration.The resources of type "source", "condition", "target", "pullrequest" now uses the key
scmID
to specify an scm dependency.This avoids duplicating the scm configuration in every resource like it used to be.
Here is an example
SCM
Excepted that the scm configuration is now defined in its top-level configuration
scms
, parameters remain the same.Cfr documentation on www.updatecli.io
[cols="1,1,1,4",options=header]
|===
| Name | Required | Default |Description
| name | ✔ |-| Defines the scm name displayed in an updatecli pipeline run
| kind | ✔ | - | Defines the scm resource kind
| spec | ✔ |-| Defines the resource kind configuration
A scm of kind
github
can't define a configuration "pullrequest" as this is now living in its own place. Cfg the next section.Pullrequest
[cols="1,1,1,4",options=header]
|===
| Name | Required | Default |Description
| name | ✔ |-| Defines the pull request name displayed in a updatecli pipeline run
| scmID | ✔ |-| Defines the SCM that this pull request depends on
| kind | ✔ | - | Defines the pull request resource kind
| spec | ✔ |-| Defines the resource kind configuration
NOTE: At this stage, the only pull request kind supported is
github
.Github
A GitHub pull request can be used to define how to create and configure GitHub pull request.
A pull request will be opened when needed. It also reopens a closed pull request if they are changes between the head branch and the remote one.
Parameters
[cols="1,1,1,4",options=header]
|===
| Name | Required | Default |Description
| description | | - | Defines a custom description to insert at the beginning of a pull request body
| draft | |false| Defines the pull request is in draft mode by default
| labels | |-| Defines a list of GitHub pull request labels. !Must already exist
| maintainercanmodify | | true | Defines if a repository maintainer can modify the pull request
| title | |-| Defines pull request title
|==
Tradeoff
Potential improvement