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

Work out PR number for head branch #119

Closed
gibfahn opened this issue Nov 20, 2017 · 8 comments
Closed

Work out PR number for head branch #119

gibfahn opened this issue Nov 20, 2017 · 8 comments
Assignees
Labels
feature request New features for node-core-utils git-node stale

Comments

@gibfahn
Copy link
Member

gibfahn commented Nov 20, 2017

It'd be nice if I could do get-metadata (or get-metadata @) if I'm on a fork branch with an open PR.

Could do something like:

# Get the remote url of the upstream branch (if it exists).
remote=$(git remote get-url $(git rev-parse --abbrev-ref --symbolic-full-name @{u} | cut -d / -f 1))
branch=$(git symbolic-ref --short HEAD) # Or branch parameter passed.

# Convert to https:// syntax if it's ssh syntax (git@github.com)

# Work out what PR has that as a base branch

# Pass PR number through to the rest of get-metadata.
@joyeecheung
Copy link
Member

joyeecheung commented Nov 21, 2017

#106 kinda needs this as well, although that one is for landing PRs that are not necessarily opened by the people landing them. I am thinking a git node config command to associate remote/branch settings so the configuration persists and we don't have to pass the parameter all the time. The prototype in https://asciinema.org/a/6i3gFDSAr7L6fYPSEaMrW0asO uses manually edited fields in ~/.ncurc at the moment but it would attempt to override settings from <project_dir>/.ncu/config

@joyeecheung
Copy link
Member

joyeecheung commented Nov 21, 2017

Also it would be convenient if I can git node pr --open from the current branch, which open the PR and associate the branches for you, a bit like git cl upload of chromium/v8. That doesn't seem very difficult once #106 works out.

@joyeecheung joyeecheung added the feature request New features for node-core-utils label Nov 21, 2017
@gibfahn
Copy link
Member Author

gibfahn commented Nov 21, 2017

I am thinking a git node config command to associate remote/branch settings so the configuration persists and we don't have to pass the parameter all the time.

Config option makes sense, although I think working it out from the remote branch that the local one is tracking is a good fallback.

git node pr --open from the current branch, which open the PR and associate the branches for you, a bit like git cl upload of chromium/v8.

What do you mean by associating the branches for you? I can see that you could automate the "raise PR from fork/mybranch against upstream/master with this comment".

@joyeecheung
Copy link
Member

@gibfahn It means the .ncu folder somehow stores the relationship between pr ids and it's remote branch + base branch, no matter the relationship comes from

  1. Worked out as OP suggests (using Github API?) Maybe git node pr --guess && get-metadata, and let get-metadata grab the PR after looking into .ncu if no PR ID is supplied
  2. git node pr --set <prid> <branch> [base branch] (just some imaginary commands)
  3. git node pr --open [base branch] (opens the PR for you so it will know the PR ID and save it to .ncu)

@joyeecheung
Copy link
Member

Aside: it would be great if git node pr --open also kicks of the CI automatically (after receiving a yes from the prompt)

@evanlucas
Copy link

@joyeecheung I had previously worked on something to kick off a CI run at https://github.com/evanlucas/nodejs-ci-ctl

@joyeecheung
Copy link
Member

@evanlucas Awesome, I will see if I can integrate that into the git commands

@github-actions
Copy link
Contributor

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New features for node-core-utils git-node stale
Projects
None yet
Development

No branches or pull requests

3 participants