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

Allow to open GitHub pullrequest on parent repository #1182

Merged
merged 3 commits into from
Feb 27, 2023

Conversation

frelon
Copy link
Contributor

@frelon frelon commented Feb 27, 2023

Fix #1096

This PR enables updatecli to open new GitHub pull-requests against parent repositories.

Since it is implied the user will not have write-access upstream we will skip setting labels/assignees/etc if not specified in the spec.

Example yaml:

actions:
  pull-request:
    title: "updatecli: bump go version"
    kind: github/pullrequest
    scmid: ci
    spec:
      parent: true

scms:
  ci:
    kind: github
    spec:
      user: "Elemental CI [bot]"
      owner: elemental-ci
      repository: elemental-cli
      branch: "main"
      ...

This pushes changes to elemental-ci/elemental-cli and opens the PR against the upstream rancher/elemental-cli as expected!

@ghost
Copy link

ghost commented Feb 27, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@olblak
Copy link
Member

olblak commented Feb 27, 2023

Nice one.

@frelon, did you try to update an existing pullrequest created by the updatecli pipeline? Because I have situation where the pullrequest can evolve and I would like to update the title, for example such on olblak/kubernetes-marketplace#10 where the title display the version bump

@olblak olblak self-assigned this Feb 27, 2023
@olblak olblak added the enhancement New feature or request label Feb 27, 2023
@olblak olblak added this to the 0.45.0 milestone Feb 27, 2023
If upstream is set to true in the spec, the PR will be opened against
the upstream of the repository specified in scm.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
Only updating labels of existing PR:s if labels are specified, otherwise
we will receive a permission denied for updating PR:s, even though no
labels are added.

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
@frelon
Copy link
Contributor Author

frelon commented Feb 27, 2023

@olblak I tried it initially, but got permission denied errors. Only setting the labels in the mutation if any are specified in the spec fixed it tho! Adding a commit to actually do the update!

@olblak
Copy link
Member

olblak commented Feb 27, 2023

actually

Awesome, and it definitely seems cleaner

Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
@olblak olblak removed this from the 0.45.0 milestone Feb 27, 2023
@olblak olblak merged commit eca0b78 into updatecli:main Feb 27, 2023
@frelon frelon deleted the github-upstream branch February 27, 2023 21:13
@olblak olblak changed the title Add upstream option for GitHub pull-request Allow to open GitHub pullrequest on parent repository Feb 28, 2023
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.

Feature Request: Support upstream GitHub pullrequest
2 participants