Git Product home page Git Product logo

spr's Introduction

spr

spr · GitHub GitHub release crates.io homebrew GitHub Repo stars

A command-line tool for submitting and updating GitHub Pull Requests from local Git commits that may be amended and rebased. Pull Requests can be stacked to allow for a series of code reviews of interdependent code.

spr is pronounced /ˈsuːpəɹ/, like the English word 'super'.

Documentation

Comprehensive documentation is available here: https://getcord.github.io/spr/

Installation

Binary Installation

Using Homebrew

brew install spr

Using Nix

nix-channel --update && nix-env -i spr

Using Cargo

If you have Cargo installed (the Rust build tool), you can install spr by running

cargo install spr

Install from Source

spr is written in Rust. You need a Rust toolchain to build from source. See rustup.rs for information on how to install Rust if you have not got a Rust toolchain on your system already.

With Rust all set up, clone this repository and run cargo build --release. The spr binary will be in the target/release directory.

Quickstart

To use spr, run spr init inside a local checkout of a GitHub-backed git repository. You will be asked for a GitHub PAT (Personal Access Token), which spr will use to make calls to the GitHub API in order to create and merge pull requests.

To submit a commit for pull request, run spr diff.

If you want to make changes to the pull request, amend your local commit (and/or rebase it) and call spr diff again. When updating an existing pull request, spr will ask you for a short message to describe the update.

To squash-merge an open pull request, run spr land.

For more information on spr commands and options, run spr help. For more information on a specific spr command, run spr help <COMMAND> (e.g. spr help diff).

Contributing

Feel free to submit an issue on GitHub if you have found a problem. If you can even provide a fix, please raise a pull request!

If there are larger changes or features that you would like to work on, please raise an issue on GitHub first to discuss.

License

spr is MIT licensed.

spr's People

Contributors

jozef-mokry avatar oyamauchi avatar jwatzman avatar rockwotj avatar flooey avatar joneshf avatar idevelop avatar andrewhamon avatar cadolphs avatar kud avatar keyz avatar sqwxl avatar orausch avatar spacedentist avatar

Stargazers

Łukasz Jachym avatar Alfred Westerveld avatar  avatar Thomas Oddsund avatar  avatar Brandon W Maister avatar Nikita K avatar Casper Lindschouw avatar Yunfei He avatar  avatar Wayan jimmy avatar  avatar  avatar tobey avatar Grzegorz Bokota avatar Igor avatar Luke Yeh avatar Rahul avatar Tiago Carvalho avatar Juri Hahn avatar Harsh Shandilya avatar  avatar Benedikt Ritter avatar Romain Ruetschi avatar Yann Bolliger avatar TheMattaBase avatar gorpig avatar Jonathan Hult avatar Tino Thamjarat avatar Vince van Noort avatar Leon avatar Sylvain Julmy avatar Thomas Friedel avatar Brian Myers avatar Julien Perrochet avatar Matt White avatar Bryan Davis avatar  avatar Moss Cantwell avatar YeonGyu-Kim avatar Christian Legnitto avatar Isagani Mendoza avatar Felix Rath avatar Dmitry Duev avatar Abe Land avatar Hamza avatar nick filippakis avatar Elton Leong avatar Henrique Custódio avatar Bruno Cardoso Lopes avatar Jodi Warren avatar Davide Aversa avatar Andrew Gilbert avatar Davin Kevin avatar Ethan Reece avatar Douglas Stephen avatar Simen Brekken avatar sanjju simha avatar  avatar Gabriel Nützi avatar Kihoon Lee (Kilee) avatar Bernhard Schuster avatar saibotk avatar Simon Paitrault avatar Jan-Erik Rediger avatar Jarek Samic avatar Evgeny avatar Lubomir Anastasov avatar Chris Atkins avatar Diana avatar Josh Klar avatar Gavin H. avatar John Wass avatar Patrick José Pereira avatar Jose Quintana avatar Wei Zhu avatar Serg Podtynnyi avatar Antoine Baché avatar marcos ferreira avatar Steve Klabnik avatar Bradley Wright avatar  avatar Alex wang avatar James Churchill avatar Halu avatar  avatar Valentin G. avatar Edwin Kofler avatar Lucas Bremgartner avatar Leonardo David avatar  avatar Josh Medeski avatar Kevo avatar R. Kit Seal avatar Misha Brukman avatar Chris Watkins avatar Jeroen Tietema avatar Matthew Noel avatar Simonas Daniliauskas avatar Florian Parga avatar

Watchers

Jevin Sweval avatar Stefan Hagen avatar Jackson Gabbard avatar Michael Demarais avatar  avatar  avatar Theo Stanton avatar Shun Kakinoki avatar Sven Over avatar

spr's Issues

`spr diff` to update an existing PR that's not HEAD

Currently, if I use spr diff to update an existing PR, that PR must either correspond to the commit at HEAD, or I must pass --all, which treats all of the commits on my branch as a stack of dependent PRs and updates all of them.

It would be nice to be able to specify a specific commit in the branch and update just that commit's PR. To work around this, I can reorder the commits and move the one whose PR I'd like to update to HEAD, but it'd be nice not to have to do that.

Turn spr into a stacked Github collaboration library

I looked around a bit and there a bunch of projects that patch alternate non-branch workflows into git. The problem is that most of them don't have anything to make working with Github easy.

See for instance:

spr covers the GitHub workflow part (in a much more straightforward way than any other project really) but doesn't go much further than that. Most of these tools also seem to be written in Rust. Could these two things be combined?

Not sure how much of an effort it would be but could spr be turned into a library for sending sequences of commits to Github and keeping them in sync?

Spr diff will complain about missing Test Plan when commit message contains # Test Plan

I'm trying to have Test Plan appear as a markdown heading in the PR description.
When my commit message contains

 # summary
 using SPR make my life easier
 
 # Test Plan:
 1. do not use spr: sad face
 2. use spr: happy face

Doing spr diff or spr diff --update-message will says:
💔 Commit message does not have a Test Plan!

My current work around is to duplicate Test Plan, one as heading, and one as normal text

spr list (and land) PR statuses are always PENDING

I opened pull request using spr diff, spr list / land detects the status of the PR as pending even though it's already approved. The repo is an organization repo

I cloned the repo and try to put some dbg! statements

Request

[spr/src/commands/list.rs:28] format!("repo:{}/{} is:open is:pr author:@me archived:false", config.owner,
    config.repo) = "repo:clockwisehq/services is:open is:pr author:@me archived:false"
query SearchQuery($query: String!) {
  search(query: $query, type: ISSUE, first: 100) {
    nodes {
      __typename
      ... on PullRequest {
        number
        title
        url
        reviewDecision
      }
    }
  }
}

Response

&response_body = Response {
    data: Some(
        ResponseData {
            search: SearchQuerySearch {
                nodes: Some(
                    [
                        Some(
                            PullRequest(
                                SearchQuerySearchNodesOnPullRequest {
                                    number: 5511,
                                    title: "[AI-1016] Send OOO information to Rust defrag",
                                    url: "https://github.com/<REMOVED>/services/pull/5511",
                                    review_decision: None,
                                },
                            ),
                        ),
                        Some(
                            PullRequest(
                                SearchQuerySearchNodesOnPullRequest {
                                    number: 5508,
                                    title: "[AI-910] sync rust defrag schema",
                                    url: "https://github.com/<REMOVED>/services/pull/5508",
                                    review_decision: None,
                                },
                            ),
                        ),
                        Some(
                            PullRequest(
                                SearchQuerySearchNodesOnPullRequest {
                                    number: 5410,
                                    title: "Add ooo for scheduler input",
                                    url: "https://github.com/<REMOVED>/services/pull/5410",
                                    review_decision: None,
                                },
                            ),
                        ),
                        Some(
                            PullRequest(
                                SearchQuerySearchNodesOnPullRequest {
                                    number: 5319,
                                    title: "first pass, create subclasses of movable events",
                                    url: "https://github.com/<REMOVED>/services/pull/5319",
                                    review_decision: None,
                                },
                            ),
                        ),
                    ],
                ),
            },
        },
    ),
    errors: None,
    extensions: None,
}

Token Settings
Screenshot 2023-08-13 at 1 52 03 PM

Pending From SPR list
Screenshot 2023-08-11 at 5 33 22 PM

Browsing PR status
Screenshot 2023-08-13 at 1 55 50 PM

gh pr view 5508
Screenshot 2023-08-13 at 1 58 47 PM

VSCode extension?

Hi.

A really killer feature here would be a VSCode extension which manages all of the spr features in UI. Two most desired UI features would be:

  1. Show a tree of stacked commits and allow the developer to double-click on some commit to “jump into it” - i.e. rebase -i after it. So the workflow would be: “I want to apply a code review comment, I jump into the commit of the PR, make the changes, amend the commit (which automatically rebases all the further commits) and resubmit the diff. After that, I still remain “sitting” in that commit (it doesn’t bring me on top of the stack!), and of course, it’s all reflected in the tree (in which particular commit I am currently sitting).
  2. Have a button for spr diff which automatically resubmits my current “jumped in” commit and all other commits on top of it in the stack. I don’t want to think about some other commits while I modified some commit in the middle of the stack.

What's the difference with ejoffe's spr?

Hi.

What's the story behind having the tool with the similar purpose and same name, but written in Go?
https://github.com/ejoffe/spr/

That repo doesn't mention you, and also you don't mention them anywhere.

P.S.
BTW a super-nice feature you have in comparison to them is that Pull Request: https://github.com/xyz/abc/... block which is added to every single commit in the local repo (like in old FB times). It helps the reader of commit history to instantly find the PR and discussions in it.

How to use `spr diff` from a fork?

Is it currently possible to use spr diff from a fork and have it create a PR in the upstream repo? I didn't see any options that seemed to imply it was possible, but I might be missing something in the way it works. If it's not possible, are there any thoughts on how it would work? I imagine this doesn't line up with anything in arcanist, since as far as I know Phabricator is meant to be used with a single repo rather than with a bunch of forks.

From what I can understand, it looks like spr uses octocrab for interactions with the GitHub API, and it seems that PullRequestHandler.create wants you to pass in a stringified representation of the fork in the head if creating a pull request from a fork. For instance, if I had a fork of this repo at joneshf/spr, was working on a branch named some-branch-name, and I wanted to submit a PR from a fork of this repo, head seems like it would be "joneshf:some-branch-name" (assuming I understand the documentation of octocrab correctly).

One idea could be to take an option on spr diff specifying which repo to open the PR against. Maybe a better idea is to have a repo-wide configuration to specify if it's a fork or not? I guess it would depend on what else needs to know if it's a fork or not. But I get the feeling that the 80/20 here is: 80% of the time people are either always working directly against the origin repo (so not a fork) or they're always opening PRs against the upstream repo (so always a fork of the same repo), and 20% of the time you're doing something different (like opening a PR against a different repo that is neither upstream nor origin). So maybe most of the ask can be implemented with a repo-wide configuration? Maybe there's another idea?

In any case, I don't have any strong requirements here. I was just thinking about this because I was considering offering to implement something in this repo, and was going to try using spr to do it, but then realized that I couldn't figure out how to create a PR from a fork. I figured Id just ask to see if it was already being thought about.

Land multiple diffs? (eg `spr land --all`)

First off, thank you for building spr! This is already proven to be a really helpful tool.

One workflow I wish could be improved is landing a whole approved stack. I'll often send out a few diffs in a stack (hurray for diff --all) and come back to find them all approved. Right now I'm landing them each with interactive rebase, but this feels cumbersome. I find myself wishing I could land --all to do this programmatically.

Better yet, it would be amazing if this could land those in a landable state (merge-ready and approved) and skip over and report the ones still open. So if I stack A, B and C onto main, find A and B approved, but not yet C and land --all then result in A and B successfully landed and C rebased on the result

[question] Any way to support squash merging PR in GitHub UI and then update locally?

I would like to try out spr, but giving an option for other people in my organization to keep using GitHub UI to merge also my pull requests (we use squash merge by default already).

Is there a way to support squash merging the PR in GitHub UI instead of running spr land?
And then run a command locally to update all the other PRs and local/remote branches?

[question]: How does the landing work?

Is it described how landing works ? For example I did a simple repo with some amend, resulting in the following PR log:

image

  1. Why is the base changed? Nvm, this was because it was actually stacked on something else.
  2. From an auditing perspective, where does commit 21e5427 come from?
  3. How is this PR considered merged to master? - yet the those 'temporary' review commits are not in master.

[feature request] Show stack in PR

If I have a stack of changes A -> B -> C and I create PRs, there is nothing to indicate that C is part of a stack and is built on top of A and B. Would it be possible to have SPR amend the PR description with this information as well?

Add support for GH enterprise

I'm guessing the below failure is due to lack of support for self-hosted gh instances; it would be great to get support here but if there's a workaround please lmk!

❯ spr init
  👋  Welcome to spr!

  🔑  Okay, lets get started. First we need a 'Personal Access Token' from GitHub. This will authorise
      spr to open/update/merge Pull Requests etc. on behalf of your GitHub user.
      You can get one by going to https://github.com/settings/tokens and clicking on 'Generate new
      token'. The token needs the 'repo', 'user' and 'read:org' permissions, so please tick those two
      boxes in the 'Select scopes' section.
      You might want to set the 'Expiration' to 'No expiration', as otherwise you will have to repeat
      this procedure soon. Even if the token does not expire, you can always revoke it in case you fear
      someone got hold of it.
      Please paste in your PAT and press enter. (The input will not be displayed.)
GitHub Personal Access Token: [hidden]
  🛑  GitHub: Bad credentials
      Documentation URL: https://docs.github.com/rest

Retrieve auth token from git credential helper

Git has a way to store repo credentials, which includes GitHub tokens; spr should have a way to use that, instead of needing spr.githubAuthToken. This would avoid having copies of tokens all over the place in .git/config files.

In my global .gitconfig:

[credential]
helper = store

The store helper by default stores credentials in ~/.git-credentials, which looks like:

https://oyamauchi:ghp_*******@github.com

Then this code retrieves credentials for the repo at the URL you pass to CredentialHelper::new:

use git2::Config;
use git2::CredentialHelper;

fn main() {
  let config = Config::open_default().unwrap();
  let mut cred_helper = CredentialHelper::new("https://github.com/getcord/spr.git");
  cred_helper.config(&config);
  println!("{:?}", cred_helper.execute());
}

Which outputs:

Some(("oyamauchi", "ghp_*******"))

Maintenance status

Curious if this is still being maintained and if there's any intent to address some of the current gaps the current user base has raised?

For some examples that I'd personally find valuable myself:
#64
#134
#83
#137

Multiple stacks of work?

Maybe I'm missing something in the documentation, but is there a way to have two different active stacks of work in SPR?

e.g.

main -> A -> B -> C
main -> D -> E

Cleanup without land (similar to close?)

Our repo uses a merge queue to squash and merge all PRs into main and release branches. The way that it is implemented is that after a PR passes all checks and gets code reviewed, a PR author can apply a label to their PR that instructs a github action to merge it into main. This github action will maintain a queue of PRs that want to be merged, and they all need to re-run CI against tip of main before the merge happens. This is to prevent two PRs that don't play nice together from landing and breaking main.

The problem with this approach is that we do not have a way to cleanup the branches that spr creates. I'm not sure if this is something spr land automatically does or not, but we can't run spr land since only the merge queue (and those with special privileges) can merge directly to main.

This would probably be similar to spr close, except the PR is already going to be squashed and merged at this point. I haven't tested using spr close on an already merged PR because I don't know what it will do.

Needing to always pass `--cherry-pick` is unexpected

Ran into some confusing behavior just a bit ago. I opened a PR with spr diff --cherry-pick. I wanted to reword the commit message and update the PR with that new message, so I did git commit --amend followed by spr diff. Since I didn't use the --cherry-pick option the second time, it changed the base and pushed a synthetic branch like it normally does for a stacked PR. I understand why it did that, but it's just not what I expected. I'm not sure what the suggestion is from me.

Maybe the documentation should mention that once you use --cherry-pick for spr diff, you have to use --cherry-pick for every command on that commit? That's how spr land works, so it kind of makes sense.

I think it would be nice if you didn't have to remember to always pass the --cherry-pick option after the initial spr diff. If the motivation behind that is to be explicit with the commands, I can understand that. But I can imagine I wouldn't be the only person to either not know, or forget to pass the --cherry-pick option.

Any thoughts on this situation?

Tips on how to run github workflow checks for stacked diffs?

We have a github workflow like this, which runs fine on my 1st diff, but when i have stacked diffs, the 2nd and 3rd ones don't run

I'm not entirely sure why, any thoughts on best way for them to run on all diffs?

Is it because I have branches: ["main"]?

.github/workflows/project.yml file

name: Project

on:
  pull_request:
    branches: ["main"]
    paths:
      - "src/project/**"
      - ".github/workflows/project.yml"
  push:
    branches: ["main"]
    paths:
      - "src/project/**"
      - ".github/workflows/project.yml"

jobs:
  verify-frontend:

spr diff uses jujutsu to amend?

Hi everyone,

I've been using spr for the last year or so and really love it so far. As an ex-Meta source control person I've always preferred the stacked diff workflow and spr is the best tool of the lot.

I've been trying out Jujutsu version control with a colocated Git repository, and that works pretty well in conjunction with spr (since jj and spr are both about amend/rebase-based workflows). But there's a little nit I ran into, which is that spr diff, spr amend etc use git commit --amend to amend commit messages. This is okay, but essentially creates a separate commit with its own identity in jj -- jj cannot link the identities of the old and new commits.

Ideally spr would be able to run jj describe @- --stdin and feed in the message over stdin, which would avoid this problem. Would it be okay to extend spr's amending logic to use jj describe if a jujutsu repository is found?

Getting eligible reviewers doesn't work for outside collaborators(?)

When I run spr diff with Reviewers: sven-of-cord I get an error saying that that's not an eligible reviewer.

Getting the list of eligible reviewers is done by the API repos/OWNER/REPO/collaborators. When I run this API on this repo, I get a list that doesn't include sven-of-cord. I only get:

[
  {
    "login": "oyamauchi",
    "id": 107014,
    "node_id": "MDQ6VXNlcjEwNzAxNA==",
    ...urls...
    "type": "User",
    "site_admin": false,
    "permissions": {
      "admin": false,
      "maintain": false,
      "push": true,
      "triage": true,
      "pull": true
    },
    "role_name": "write"
  },
  {
    "login": "flooey",
    "id": 215991,
    "node_id": "MDQ6VXNlcjIxNTk5MQ==",
    ...urls...
    "type": "User",
    "site_admin": false,
    "permissions": {
      "admin": true,
      "maintain": true,
      "push": true,
      "triage": true,
      "pull": true
    },
    "role_name": "admin"
  },
  {
    "login": "jacksongabbard",
    "id": 544550,
    "node_id": "MDQ6VXNlcjU0NDU1MA==",
    ...urls...
    "type": "User",
    "site_admin": false,
    "permissions": {
      "admin": true,
      "maintain": true,
      "push": true,
      "triage": true,
      "pull": true
    },
    "role_name": "admin"
  }
]

I'm not sure why this is happening, but I suspect it's a permissions issue, because I'm an outside collaborator, not a member of the organization?

[bug?] spr diff not updating (draft?) PR

👋 Hello!

A couple of times this week we have had issues where we run spr diff to update an existing PR (opened with spr), and although in the command line it seems like everything was ok, no changes occur on Github.

In both cases the PR in question was in draft state, so maybe that is relevant.

This is the output on the terminal on each occasion, in case that helps:

  monorepo git:(master) spr diff -m "update"
11a3da0 Deleted message state
  #️⃣   Pull Request #4423: https://github.com/getcord/monorepo/pull/4423
  ⚠️  The Pull Request's title/message differ from the local commit's message.
     Use `spr diff --update-message` to overwrite the title and message on GitHub with the local message, or `spr amend` to go the other way
     (rewrite the local commit message with what is on GitHub).
  🔁  Commit was changed - updating Pull Request #4423
f91ba54 Implementation on test bed
  #️⃣   Pull Request #4422: https://github.com/getcord/monorepo/pull/4422
  ⚾  Commit was rebased - updating Pull Request #4422

Reviewers field not working in commit message

Every time I add Reviewers: section to my commit message I get an error like
🛑 Reviewers field contains unknown user/team 'topolskib'
where github.com/topolskib is a valid username.

This is on a repository within an organization, so maybe some permission is missing on the token?

Is there a way for others to check out my stacked diffs?

Teammates told me they can't check out my unapproved stacked diffs. Say I have stacked diffs: diff1 -> diff2 -> diff3 -> diff4, and none of them are approved yet. What's the best way someone can check out all these changes so they can play with HEAD pointing to diff4, and having all changes including diff1, diff2, diff3?

Commit in PR shows as "[spr] Initial commit"

Hi 👋 😄

I found myself with a large PR and wanted to give spr a try to see if I could make it easier to manage it and give my colleagues a better experience in review.

I followed the getting started guide and added a simple commit on the main branch of my pre-existing project (with lots of pre-existing commits). When I then ran spr diff a GitHub PR was created 👍 but the commit looks like this:

image

If I run git log locally I can see the actual commit message I was expecting.

I feel this is a problem for me, as I don't want to force the spr workflow onto anyone in my team and in case they would merge this PR it would get merged with the wrong commit message.

Is this expected behavior?

Formula Name Conflict Between Two Projects

Hello maintainers,

I wanted to bring to your attention that there's a naming conflict for the formula between these two projects:

I use both of these projects and have experienced conflicts when attempting to install them together. I understand that naming can be tricky, but it would be greatly appreciated if one of the projects could consider renaming their formula to avoid this issue. This would greatly enhance the user experience for those of us utilizing both tools.

image

Thank you for your understanding and consideration. I really appreciate the hard work you've put into developing these tools.

Best regards,

Related: ejoffe/spr#352

Gitlab support?

Not having look at the source code yet, but how feasible is it in the maintainers' opinions to extend SPR to include support for Gitlab?

spr diff does not work after rebasing

i tried rebasing and now spr diff doesnt work, it keeps creating a brand new PR,

could you help check where i did wrong following steps in https://getcord.github.io/spr/user/simple.html#conflicts-on-landing?

  • git checkout origin/main
  • touch code.py
  • add and stage code.py, then git commit -m "changes"
  • spr diff, PR is created, branch origin/spr/opqpop/dracuieasy-split-solid-liquid-investments is created (0501d416)
  • wait 2 days
  • PR is accepted, now i have to land but master has moved too much and i need to rebase

image

  1. git checkout origin/spr/opqpop/dracuieasy-split-solid-liquid-investments
  2. git rebase origin/main
  3. now the rebase replays it with new commit hashes and the branch name is no longer there, believe this is expected (see a5435a3e)
  4. normally if i wasnt using spr, i'd force push my PR, but instructions say to run spr diff again after rebasing to update the PR
  5. i do that and it ends up creating a new PR w/ the name origin/spr/opqpop/-initial-version instead

am i missing something in step 4? Do I need to do something after rebasing before calling spr diff again, or did I mess up the rebase command in step 2?

image

instructions say to rebase but doesnt say how so I wasnt sure

Rebase your PR onto latest upstream main, resolving conflicts in the process.
Run spr diff to update the PR

Could most of the commands have a `--dry-run` option?

I think it would be pretty useful to have a --dry-run option for most of the commands. I dunno that init or list need one, since they don't affect GitHub. There's two reasons why I think this option would be useful:

  1. As a person using spr, it's not always clear what it's going to do before it does it. It'd be nice to know what the game plan is before it executes it.
  2. As a person developing spr, it's not easy to test the behavior of commands. Most everything sends off actual requests to GitHub or updates the local repo, so writing a test for some changes is next to impossible. If each command wasn't always going to affect the real world, it would be easier to get some amount of confidence (not complete confidence) that the behavior of a command is what is expected.

The first reason is probably more easily understandable than the second. But, I think being able to have a suite of tests that validate a game plan could be really beneficial. Any thoughts on the idea?

spr diff vs spr diff --draft

Hi, I've noticed one edge case (or at least behavior that I think should be different):

  1. spr diff
  2. convert PR to draft from GitHub UI
  3. git amend
  4. spr diff

In this case, I've got a new PR created. Should the already existing draft PR be re-used?

Ran into some issues getting started

Heya! Just found out about spr, and I'm very intrigued! I've never used arc so I have no experience there. I've been interested in it for a while, but too lazy to set up Phabricator to actually try it out. So spr being arc inspired is great! It's way easier to get started with and see if this workflow makes sense. I'm really excited to see where spr ends up.

Gave it a try and ran into some issues. I'm going to dump them all in this issue just for the sake of not opening a bunch of different issues as my first interaction. Let me know if you'd prefer a different place to track these issues or separate issues. In any case, these are the things I ran into:

  • There are lots of requirements to build
    • Needs libiconv, libgit2, openssl, Apple's Security framework (probably comes from xcode tools or something).
    • Doesn't seem to matter if it's with cargo install spr or building from source.
  • Prebuilt macOS binary requires openssl.
    • Again, might come from xcode tools or something.
  • spr diff requires a Test Plan: section
    • This isn't really explained.
    • Have to guess one what the format is.
    • It'd be nice to specify what is actually required and allow different sections.
    • Some projects don't have a "Test Plan" section, but might have a "QA" section or a "Testing steps" or whatever else. Some might have multiple sections that are required.
    • Might be nice to somehow interact with PR templates (since this is a GitHub-specific tool).
  • spr land requires an approved review.
    • Not all repos require this.
    • Doesn't work for a single person working in a repo.
    • Admirable goal, but reality is that it needs to be a bit more flexible.
  • #117
  • spr diff requires additional scopes to update PRs.
    • It says it only needs repo and user scopes in the README.
    • If you only have the repo and user scopes, it'll error with:
        🛑  <query>:30:15: Your token has not been granted the required scopes to execute this query. The 'slug' field
      requires one of the following scopes: ['read:org', 'read:discussion'], but your token has only been granted
      the: ['repo', 'user'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.
      
  • spr diff says "Message (leave empty to abort):" and that doesn't work.
  • #64
    • In fact, it will remove the GPG signature when it does whatever changes it does to update the commit.
  • Sections don't work as git trailers.
    • Might be intentional that they're not supposed to be trailers, but they basically look/feel like trailers.
    • Maybe this is some ad-hoc format that spr is introducing? If so, it would be nice to call out that they're explicitly not git trailers.
    • First reason is because they have spaces in them.
    • Second reason is because they aren't all at the end.
  • #63
    • Not entirely sure what this maps to in arc, maybe arc close-revision?

Can no longer land complaining about no approving review even though reviewers approved it

This has just started happening 2-3 days ago and I'm not sure why. Is it possible it has to do with the recent commits that happened since 3 days ago? Pinging the authors too in case it might be related (#159 cc @andrewhamon, #153 cc @cadolphs, #162 cc @spacedentist)

Repro:

  1. git checkout -b branch
  2. make change, git commit (hash: 123)
  3. spr diff, PR is created
  4. have someone stamp it
  5. go to main and get latest changes to prepare for rebase: git checkout origin/main; git pull origin main --rebase
  6. cherry-pick the commit to land git cherry-pick 123
  7. spr diff -m "rebase"
  8. spr land, get below error
> spr land                                          
847b2ea [drac] fix up add wallet (1/n)
  #️⃣   Pull Request #1789
  🛫  Getting started...
  ❌  GitHub Pull Request merge failed
  🛑  GitHub: At least 1 approving review is required by reviewers with write access.
      Documentation URL: https://docs.github.com/articles/about-protected-branches

Let me know if there's anything else I can help with

Every time I update I get title/message differences

"The Pull Request's title/message differ from the local commit's message."

I'm not sure why I'm getting this and the interface how to resolve this is also not very clear. I'm passing the --update-message flag but that still asks me to provide a message (why?).

Report which PR is stacked upon

It would be wonderful for SPR to by default record in PR descriptions, which PR does the current PR depend upon.

As a concrete example, if I create multiple PRs of A then B, it would be great if the pull request description for B mentioned that the changes in that PR where dependent upon the changes in the other PR.

Hopefully this is clear. Thank you for building this amazing tool, it's super great!

Bug: landing a PR after being accepted then re-ordered does not work

when a PR that is higher up on the stack is accepted, and then re-ordered so that it can be landed, complains about not being accepted. (this only happens for people who do not have permission to override the peer review requirements)

steps to reproduce:

  1. create commit A
  2. create commit B -- NOTE: these are independent commits
  3. spr diff --all
  4. accept Commit/PR B
  5. re-order local main so that B is below A
  6. spr land commit B
  7. get error stating that PR has not been accepted

seems to be similar if not the same issue as #163 (comment), but I thought I should put up my own issue in case they were different.

`spr land` keeps triggering the CI and block merging

Hi,

For some reason when I run spr land on an accepted and CI passed PR, it would re-trigger the CI and would tell me that

  ❌  GitHub Pull Request merge failed
  🛑  GitHub: 11 of 11 required status checks have not succeeded: 10 expected and 1 pending.

And after I wait for that 11 checks finish and run spr land again, it would happen again ... as a result i wouldn't be able to merge the PR with the tool. Is this a known issue?

One possibility is I did re-arrange (via rebase) the stack after run spr diff on some PRs. Is that what messing up with spr?

Thanks

Spr doesn't work well with git worktrees?

I was able to spr init just fine for my repo. However, when I run spr diff from a git worktree, I get this error:

  🛑  object not found - no match for id (aa1d3cfa12a67a60408240eecdb08d4a3a64460a); class=Odb (9); code=NotFound (-3)

Do worktrees confuse spr? Thanks!

spr looks really cool and I really want to use it!

Reviewers not updated with spr --update-message

Hello! First of all thanks for the wonderful tool.

I frequently have the workflow where I make an initial commit and then want to update the set of reviewers later. I'd love to be able to do this via the commit message just like I can do on the initial commit. I prefer using the commit message as the source of the truth rather than the GitHub UI

However after the initial commit it appears that the Reviewers: field is ignored. Another indication of this is that if you edit the Reviewers field only and run spr diff --update-message it says there is no update necessary.

If this is deliberate decision, no worries and feel free to close.

See a test PR: dagster-io/dagster#10751

Can't disable test plan checking

I'm just giving spr a try, and don't want to use test plans in my commit messages. I've tried to change the configuration settings but it seems to be blocking my commit anyway:

❯ spr --version
spr 1.3.3

❯ tail .git/config 
[spr]
        githubAuthToken = .....
        githubRemoteName = origin
        githubRepository = powerxai/application-v3
        githubMasterBranch = main
        branchPrefix = spr/cjols/
        requireTestPlan = false
        requireApproval = true

❯ git config --get spr.requireTestPlan  
false

❯ spr diff --all                        
3f5c1c5 fix(alarms): Use all dimensions for Cloudwatch queue metrics
  💔  Commit message does not have a Test Plan!

Am I missing something?

Feature Request: `spr lint` for running linters locally

My team is looking at spr as an arcanist replacement. My teammates have gotten used to arc lint to run linters locally and the fact that arc diff automatically runs arc lint before sending out the diff.

I was wondering if:

  • There are any plans to add a similar behaving spr lint command?
  • Would you be willing to accept PRs that add spr lint and hook it to spr diff?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.