sync: reconsider updating PR comments

Open
#141 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
git, github, go
Domain
cli

Research direction

Start in cmd/sync.go around the updateStackComments call at lines 404-407, then trace the function's implementation, callers, and associated tests. Check whether removing comment updates from gh stack sync would miss an edge case, especially after a stack head is merged. If not, done means removing the sync behavior, its now-unused function, and related tests.

Written by the indexing model from the issue text.

Description

bug

gh stack sync invokes updateStackComments and emits "Updating stack comments..." as one of its last operations:

https://github.com/boneskull/gh-stack/blob/7210b06dc85aaee057ae2e83a9fcd8252433a75c/cmd/sync.go#L404-L407

Presumably, this is to update the comments for PRs in a stack if the head of that stack was merged into trunk. Whether the user deleted a merged branch or not previously during sync has no bearing on whether or not this function is executed.

I don't like this, because:

  • gh stack sync feels more like a local-only operation to me.
  • It does not print information about which PRs received updates.
  • gh stack submit will update PR comments anyway.

I don't think updating comments on sync is necessary, and if I designed it that way, I was probably wrong. I may be wrong now, so I should understand if there's some edge case we'd be missing by dropping the behavior (Chesterton's fence & the like).

If we can remove the behavior, then the function itself and any associated tests can also be removed, since it only seems to be in use by the sync command.

Dominant language
Go
Stars
9
Forks
2
Avg merge
9h 14m
Merged PRs (30d)
8

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boneskull/gh-stack

All issues in boneskull/gh-stack

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.