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

cml pr: Add --merge option. #823

Closed
daavoo opened this issue Nov 29, 2021 · 9 comments · Fixed by #932
Closed

cml pr: Add --merge option. #823

daavoo opened this issue Nov 29, 2021 · 9 comments · Fixed by #932
Assignees
Labels
cml-pr Subcommand enhancement New feature or request

Comments

@daavoo
Copy link

daavoo commented Nov 29, 2021

It would be nice to have native support in CML for the cloud-agnostic equivalent of:

gh pr merge --rebase $(cml pr "foo")
@daavoo daavoo added enhancement New feature or request cml-pr Subcommand labels Nov 29, 2021
@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Nov 29, 2021

on: pull_request
jobs:
  cml:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: iterative/setup-cml@v1
      - name: Generate data
        run: echo "Hello World" > output.txt
      - name: Create and merge a new pull request
-       run: gh pr merge --rebase $(cml pr "output.txt")
+       run: cml pr --merge output.txt
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@daavoo
Copy link
Author

daavoo commented Nov 29, 2021

on: pull_request
jobs:
  cml:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: iterative/setup-cml@v1
      - name: Generate data
        run: echo "Hello World" > output.txt
      - name: Create and merge a new pull request
-        run: gh pr merge --rebase $(cml pr "output.txt")
+        run: cml pr --merge output.txt
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Things to consider, when using gh you have 1 level for merge and another for configuring how the merge is done --rebase. How would the different merge options be exposed in CML?

@0x2b3bfa0
Copy link
Member

Probably cml pr --merge for merging, cml pr --rebase-merge / --merge-rebase / --rebase for rebasing and something similar for squashing if we choose to.

@daavoo daavoo changed the title cml pr: Add --rebase option. cml pr: Add --merge option. Nov 29, 2021
@daavoo
Copy link
Author

daavoo commented Nov 29, 2021

Probably cml pr --merge for merging, cml pr --rebase-merge / --merge-rebase / --rebase for rebasing and something similar for squashing if we choose to.

I kind of like --merge, --rebase, and --squash.

Maybe off-topic but, would it make any sense to have separate command cml merge ?

So: cml merge --rebase $(cml pr "output.txt")?

@0x2b3bfa0
Copy link
Member

Yes, in an ideal world (#762) what is now known as cml pr should be cml pr create and it would make sense to have even both cml pr merge and cml pr create --merge

@casperdcl
Copy link
Contributor

casperdcl commented Nov 30, 2021

love cml {pr,mr} {create [{--merge,--rebase,--squash}],merge,rebase,squash}... updated #762 accordingly. Probably worth collecting similar breaking API changes there for a possible major version bump.

@casperdcl
Copy link
Contributor

casperdcl commented Dec 8, 2021

also how to handle conflicts (#758)?

@0x2b3bfa0
Copy link
Member

See also automatic merge as in gh pr merge --auto and #903 (comment)

@0x2b3bfa0
Copy link
Member

Closed with #932; naming suggestions moved to #762 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cml-pr Subcommand enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants