Skip to content

bridge: explain skipped issues on push and report failures in the exit status - #1668

Open
mcepl wants to merge 7 commits into
git-bug:trunkfrom
openSUSE-Python:push-diagnostics
Open

mcepl wants to merge 7 commits into
git-bug:trunkfrom
openSUSE-Python:push-diagnostics

Conversation

@mcepl

@mcepl mcepl commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

git bug bridge push drops the reasons exporters give for leaving an issue alone. When every issue is skipped, the only output is exported 0 issues with … bridge, and nothing says why. Push and pull also print per-issue errors but still exit with status 0, so scripts never see a failed sync.

Changes

  • commands/bridge: exit non-zero when push or pull reports errors. Both commands count the error events (pull ignores cancellation) and return an error after the summary line.

  • commands/bridge: add --verbose to bridge push. It prints one line per skip reason with the number of issues. The default output doesn't change, because in a normal push most issues are skipped simply for having nothing to send. Illustrative output (numbers made up):

    $ git bug bridge push -v gitlab
    skipped 390 issues: no changes by an identity with a token for this bridge
    skipped 6 issues: issue belongs to another GitLab project (ID 1234)
    exported 0 issues with gitlab bridge
    
  • bridge/github, bridge/gitlab: issues without any change by an identity holding a token were skipped without any export event, so push couldn't count them. They are now reported under one shared reason. The reasons also name the repository, instance or project an issue belongs to, replacing messages like skipping issue from url:....

  • bridge/jira: an issue whose author has no credentials is now skipped, as the code comment already said. Before, exportBug also returned the lookup error, so one such issue stopped the whole push. The skip reasons now match the other bridges.

core.ReasonNothingExported and core.ReasonNoTokenActor are shared constants, so push no longer compares against a string literal.

Testing

go test ./... passes. I couldn't run the GitHub, GitLab and Jira export paths, since their tests need real accounts; those commits are covered only by compiling and the existing tests. I checked --verbose and the exit status by hand on a Gitea bridge that builds on this branch (#1628).

RetriggerConfidence Score: 5/5

The PR appears safe to merge based on the reviewed changes.

Summary

The PR adds verbose push skip summaries and makes push and pull return an error when issue-level operations fail. It also gives exporters shared skip reasons and checks foreign-issue metadata before reporting a missing token. No new actionable issue was established in the changes since the previous review.

Reviews (3) · Last reviewed commit: "bridge: explain foreign issues before ch..."

mcepl added 2 commits October 5, 2026 12:26
Per-issue export and import errors were printed, but the commands still
exited with status 0, so scripts and users could miss a failed sync.
Count the errors (ignoring cancellation on pull) and return an error after
the summary line.
Exporters report why they leave an issue alone (wrong origin, another
repository, missing author token, ...), but "git bug bridge push" threw
those reasons away and printed only "exported N issues". When every issue
was skipped, nothing told the user why.

With --verbose (-v), push prints one line per skip reason with the number
of issues. The default output is unchanged, because in a normal push most
issues are skipped simply for having nothing to send.
Comment thread bridge/github/export.go Outdated
Comment thread commands/bridge/bridge_push.go
mcepl added 4 commits October 5, 2026 13:49
Bugs without any change by an identity holding a token were skipped
without an export event, so "push --verbose" could not count them. Report
them through core.SkipReasonNoTokenActor, which tells the two cases apart:
an issue whose operations all carry the GitHub id is already in sync and
counts as up to date, while one with local changes nobody can push is
reported as skipped for lack of a token.

Name the skip reasons so they read well in the push summary: "issue
belongs to another GitHub repository (owner/project)" instead of
"skipping issue from url:...", and "missing a token for the issue author".
Use core.ReasonNothingExported for issues that needed no update.
Bugs without any change by an identity holding a token were skipped
without an export event, so "push --verbose" could not count them. Report
them through core.SkipReasonNoTokenActor, which reports issues already in
sync with GitLab as up to date instead of skipped.

Name the GitLab instance or project an issue belongs to in the skip
reasons, align "missing a token for the issue author" with the other
bridges, and use core.ReasonNothingExported for issues needing no update.
The comment says an issue whose author has no credentials is skipped, but
exportBug also returned the lookup error. ExportAll then reported an export
error and stopped, so one such issue aborted the whole push. Return nil
after reporting the skip.

Align the skip reasons with the other bridges so "push --verbose" groups
them: core.SkipReasonNoTokenActor instead of "not an actor", one reason for all
issues missing author credentials instead of one per user ID, and name the
Jira project an issue belongs to.
Move the result reporting of push and pull into functions that read from
an event channel, and test them with prepared events: the skip summary is
hidden by default, --verbose groups the reasons in first-seen order without
listing up-to-date issues, and errors make the command fail while
cancellation does not.
@mcepl
mcepl force-pushed the push-diagnostics branch from 5b3456d to 15b55a7 Compare October 5, 2026 11:50
Comment thread bridge/github/export.go

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant