Skip to content

sync: reconsider updating PR comments #141

Description

@boneskull

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

gh-stack/cmd/sync.go

Lines 404 to 407 in 7210b06

fmt.Println("\nUpdating stack comments...")
if err := updateStackComments(cfg, g, gh, s); err != nil {
fmt.Printf("%s failed to update some comments: %v\n", s.WarningIcon(), err)
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions