-
Notifications
You must be signed in to change notification settings - Fork 707
NIP-34: add PR and PR update events #1966
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
Conversation
|
Looks good to me. |
fd6bc27 to
e9073a5
Compare
|
LGTM, I like the idea that I can create a PR with and without GRASP server. Make it more flexible. |
e9073a5 to
fadcf2a
Compare
|
this last update makes the |
fadcf2a to
b0d94e3
Compare
|
last update adds line: Stirfry max event size default is 65kb and nostr-rs-relay is 128kb. |
b0d94e3 to
6a7ac11
Compare
|
last update handles what SHOULD happen when an additional patch would exceed the 60kb limit. It enables a PR as a patch-revision. |
|
Perhaps we should think about applying nip-22 style threading to Status and Patches as propsed in #1799 ? |
|
@dluvian @Silberengel do you have any thoughts about all this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having two types increases complexity. If patches only work for <60kB changes and PRs work for any size then I will completely ignore patches and only work with PRs to avoid the complexity of maintaining two types.
| ["p", "<repository-owner>"], | ||
| ["p", "<other-user>"], // optionally send the PR to another user to bring it to their attention |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uppercase P for repo-owner and lowecase p for people directly mentioned in the PR. Repo owner could be in P and p if he was mentioned directly in it. Gives client devs the option to improve notification/inbox filtering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes a lot of sense and provides more flexibility. However, an uppercase P is used only for the author of the "root scope event" in NIP-22. Its use for other purposes isn't prohibited in NIP-22, but I haven't seen it used anywhere else. Will we break non-git-specialist clients by doing this? For example, clients may:
- Assume there is only one
Ptag. - Assume it can't be the thread root but get confused as there is no corresponding
Etag. - Carry these
Ptags through to replies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't a repo the root space of a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't a repo the root space of a PR?
In the context of a PR, Patch or Issue, its important that repo announcement isn't mistaken for the root of the thread. Otherwise a single filter can't be used to find all comments related to that thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the context of a PR, Patch or Issue, its important that repo announcement isn't mistaken for the root of the thread.
Makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your suggestion is a really good idea but we need a bit more thought around the above question before adding it to the spec:
Will we break non-git-specialist clients by doing this?
| ["p", "<repository-owner>"], | ||
| ["p", "<other-user>"], // optionally send the PR to another user to bring it to their attention |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same p and P here
6a7ac11 to
7468655
Compare
|
We never wanted patches. |
d28f8c3 to
5599fc4
Compare
|
@Silberengel wrote in this comment
So why do we use GitViaNostr if it's not for decentralized patches and issues? |
|
@dluvian wrote in this comment
Is this because of the PR revision of patches? Then what do you think about closing the patch and open a PR if the revision > 60KB? |
You aren't even using it. You're using GitHub. We tried to use ngit patches, as a team, and the repo quickly turned into 🍝. So, nope. |
You didn't answer my question, anyway, I'm using patches in Nostr and it's good, you just make the patches and send them or fetch them and apply them, I don't know why your repo turned into a spaghetti |
|
Because the commits were too large. |
That's still more work than simply ignoring patches and only implementing PRs. I do prefer patches and their simplicity but if their size restriction is a practical issue I would ignore them and only work with PRs |
|
@cypherhoodlum are you still working on a git stuff client? Any thoughts on this? |
Does it make sense to write in the repo announcement that you only accept patches or only PRs or both? Then whatever client/relay the repository owner is choosing can keep that field updated? Patches are great because they don't require a server, and we cannot guarantee that everybody will have access to a server, even if it's commoditized with GRASP. Servers may still require a setup or registration process in the long run, and for some small things just issuing a "send patch" command from the command line is probably better. @DanConwayDev what do you think about vastly simplifying the patch flow to make it only use one event, throwaway, very simple and dumb -- and leave any slightly more complicated flow to PRs? |
My concern is that repository maintainers won't make a considered or informed choice; instead, a client with an ideological bent for one or the other will choose for them, without the maintainer understanding the implications. imo, this decision shouldn't be made during onboarding, as it assumes too much knowledge and requires too much thought, which would degrade the user experience.
Most of the complexity is optional and degrades gracefully. You would still need |
Also make a set of patches in one single event will make the patches useless, because they will not be accepted by most of the relays because their events are large. I think the current approach are good, use patches if each commit is less than 60KB otherwise use PRs. |
|
this last update adds tags to |
3f9d86a to
6ee3532
Compare
|
this last update simplies the Patch ~> PR path. I expect this very much to be an edge case. |
|
quick update: I have partially built this into the git remote helper shipped with ngit:
Its available on the It still needs to be integrated into Further protocol updates are needed:
|
6ee3532 to
1e2fc88
Compare
I've pushed 1e2fc88 along those lines. I'm still working through the ngit / git-remote-nostr implementation. There are more failure opportunties when the change is not bundled with the change announcement as with patches. |
f1968cf to
84fac7f
Compare
34.md
Outdated
| ["clone", "<clone-url>", ...] // at least one git clone url where commit can be downloaded | ||
| ["branch-name", "<branch-name>"] // optional recommended branch name | ||
|
|
||
| ["e", "<root-patch-event-id>"] // optionally indicate PR is a revision of an existing patch, which should be closed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, when I want to fetch a patch, do I have to check if it's mentioned in a PR to fetch the PR's status? Isn't that complicated? I mean, there's no need to do all of this; we can just close the patch and open a PR. There's no need to check if the PR exists and fetch its status in every patch, right?
Also if there is more than one PR mentioning the same patch, which PR should I fetch its status? It's really complicated.
Knowing that opening a patch and replacing it with a PR later is rare, because I'll know the changes I made before submitting the patch. I don't think there are reviewers who would request changes so numerous that they would require moving the patch to a PR.
I know I've annoyed you with this point, but it really annoys me. Sorry.
| ["e", "<root-patch-event-id>"] // optionally indicate PR is a revision of an existing patch, which should be closed |
|
You haven't at all annoyed me. If we can make it better we should.
We could make it clear that PRs use nip11 threading so 'mentioning' another patch would use a 'q' tag rather than 'e' for a replacement.
Your client doesn't have to treat them as one. It can be treated as a closed patch and a newly opened PR with the same title. What do you think?
|
| ## Replies | ||
|
|
||
| Replies to either a `kind:1621` (_issue_) or a `kind:1617` (_patch_) event should follow [NIP-22 comment](22.md). | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add PR here?
84fac7f to
790e247
Compare
|
https://n34.dev supports Pull Requests now. 🚀 |
Support for pull requests, it's not standard in NIPs yet[1] but there must be two clients that support it to be included in NIPs, n34 is one of them. This support: - Create a new PR `n34 pr new` - Update PR tip `n34 pr update` - View a PR `n34 pr view` - List PRs `n34 pr list` - Add `PR` and `PR-update` kinds as roots in `NostrClient::find_root` - Support issuing statuses for PRs - Support GRASP PR and PR-update - Update the docs [1] nostr-protocol/nips#1966
|
Oops, I meant to comment on this PR, not the other. Should this be merged? Looks like we have support from ngit, n34.dev. I am working on implementing into Shakespeare. Anything left to do? |
db714cd to
b7a9084
Compare
|
I've now added support in gitworkshop.dev. Based on this experience I'm suggesting two minor tweaks:
I pushed an update to this NIP branch (commit bf5c2bd) with these tweaks and a few formatting fixes. ngit has support in the master branch, when this PR is merged I'll issue a release. ngit-relay (currently the only grasp implementation) support this PR, meaning it will receive commit sent to I think we are ready to merge this. |
With the advent of Grasp, we can now do PRs without relying on a single contributor-selected Git server, which they would have to provision and could be rugged at any time. Note how the commit ID is included in the event and any updates, be it force pushes or additional commits, are added by supplementary PR update events. This ensures history is maintained and Nostr events remain the authority, rather than Git servers. Grasp servers with proactive sync enabled will copy the commits to ensure that they are available if the contributor-selected Git server is unreliable or removed. This also provides an alternative for large patches, which are too large to be included within a signle nostr event. It is also more supported by Git tools which don't always have patch support. For example, isomorphic-git, which enables Git in the browser.
reasons for a 'personal-fork' respository include storing PR refs and maintaining a patched version of a dependency. the user grasp list is generally useful by also enables auto-selecting grasp servers for pushing PR refs.
b7a9084 to
2aaba90
Compare
With the advent of Grasp, we can now do PRs without relying on a single contributor-selected Git server, which they would have to provision and could be rugged at any time.
Note how the commit ID is included in the event and any updates, be it force pushes or additional commits, are added by supplementary PR update events. This ensures history is maintained and Nostr events remain the authority, rather than Git servers.
Grasp servers with proactive sync enabled will copy the commits to ensure that they are available if the contributor-selected Git server is unreliable or removed.
This also provides an alternative for large patches, which are too large to be included within a signle nostr event.
It is also more supported by Git tools which don't always have patch support. For example, isomorphic-git, which enables Git in the browser.