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

Reusable GitHub Pull Request #177

Merged
merged 8 commits into from
Feb 16, 2021
Merged

Reusable GitHub Pull Request #177

merged 8 commits into from
Feb 16, 2021

Conversation

olblak
Copy link
Member

@olblak olblak commented Feb 13, 2021

Introducing a new parameter 'PipelineID' which can be used to group targets into one Github Pull Request, by default the PipelineID value is set to a full configuration checksum (source + conditions + targets) but it could be used to chain target from different configuration files.

The default value of 'PipelineID' changes the default behavior. By default, every target using SCM will push to the same branch that ends up being the same pull request on Github. This will significantly reduce the number of Pull requests generated especially in the situation we bump multiple times a value and we are only interested in the latest version update.

Another significant change for temporary branches is to use the format updatecli_<pipelineID> instead of updatecli/<pipelineID>, in the latter situation if the target git repository has already a branch name "updatecli" then it would fail.

Starting from this PR, we constantly update Github Pull request title and body with the latest information.

targets:
    chartVersion:
        name: jenkinsci/jenkins Helm Chart
        pipelineID: "15290729718975628322"
        kind: yaml
        prefix: ""
        postfix: ""
        transformers: []
        spec:
            file: charts/jenkins/requirements.yaml
            key: dependencies[0].version
  • Need to be able to specify a generic pipeline title that could be used across the run for things like Pull Request Title

@olblak olblak added the enhancement New feature or request label Feb 13, 2021
@olblak olblak changed the title Reusable GitHub Pull Reusable GitHub Pull Request Feb 13, 2021
@olblak
Copy link
Member Author

olblak commented Feb 15, 2021

After a quick discussion with @dduportal, we concluded that we need a way to specify a pull request title as it's challenging to generate a title that totally represents changes done inside a pull request. Also In the current state, each target will update a PR title <target_1> -> <target_2>, then next updatecli run <target_1> -> <target_2>.

Another interrogation element that I had was, was it fine to automatically update a PR title/body when the content of the pull request evolves or if we need to track those evolutions, and we conclude that it wasn't the responsibility of updatecli to keep track of that. A pull request title/body must just reflect files changed.

Previously, updatecli would open a pull request per change like

  • PR#1 Update Application to 1.1
  • PR#2 Update Application to 1.2
  • PR#3 Update Application to 1.3
  • ...

Now we would just change PR

  • PR#1 Update Application to 1.1 -> Update Application to 1.2 -> Update Application to 1.3

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Add missing error handling

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Remove debugging message

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Olivier Vernin <olivier@vernin.me>
@olblak olblak merged commit 4982d67 into main Feb 16, 2021
@olblak olblak deleted the reusable_github_pr branch February 16, 2021 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants