Monorepo for Tangled โ€” https://tangled.org

hooks: add create PR message on git push #612

Respond to a successful push with a URL to create a PR pointing to the default branch. This behavior is made to mimic other Git forges.

Signed-off-by: Samuel Shuert me@thecoded.prof

0
by freshlybakedca.ke 1 comment
expand 1 commit
hooks: add create PR message on git push

i would prefer if this addition were made to knotserver/internal.go along side the other post-recieve handlers (insertRefUpdate and triggerPipeline). the way to return strings to the user in this handler are via the HookResponse struct.

there is an example of this in triggerPipeline which conditionally returns pipeline compilation status back to the user, by writing messages into resp.Messages. we could do something similar here.

that being said, the change largely looks good to me! thanks for working on this.

sign up or login to add to the discussion
expand 1 commit
knotserver: add create PR message on git push

this looks pretty good now! the only thing i'd want from this is for this handler to be separated out, just like how insertRefUpdate and triggerPipeline are split up.

this is because we don't want errors here to end the function, even the userIdent fails to resolve, we want to continue with the rest of the post-receive handler.

sign up or login to add to the discussion
expand 1 commit
knotserver/internal: add create PR message on git push
sign up or login to add to the discussion
expand 1 commit
knotserver/internal: add create PR message on git push
sign up or login to add to the discussion
expand 1 commit
knotserver/internal: add create PR message on git push
pull request successfully merged
sign up or login to add to the discussion
Labels
enhancement
assignee

None yet.

Participants 2
AT URI
at://did:plc:k2zmz2l3hvfr44tmlhewol2j/sh.tangled.repo.pull/3lzwhi232k322