fix: submit an explicitly-named bookmark regardless of author (RIG-2267) - #2
Merged
mattwilkinsonn merged 2 commits intoAug 21, 2026
Conversation
`jj-vine submit <bookmark>` silently no-ops — exit 0, "No bookmarks pushed" — when the bookmark's commit author differs from the configured jj `user.email`. The fleet's commit-author flip (`seal@sealedsecurity.com` → `mintaka@rigel.build`) left pre-flip commits authored under the old identity, so re-submitting one of those bookmarks quietly does nothing.
Root cause is a two-pass double-filter. `submit()` resolves the bookmark set from the revset (pass 1, verbatim), announces it, then re-resolves what to actually submit via `find_changes_to_submit` (pass 2). Pass 2 intersected the explicitly-named target with `mine()`, so a foreign-authored named bookmark resolved to the empty set — announced, then dropped, with a success exit.
Fix (both halves):
- **`find_changes_to_submit` (`src/submit.rs`)** — include an explicitly-named target *raw*; only the ancestry-walked companions stay narrowed by `mine()` (so a stacked submit still doesn't sweep in other people's bookmarks). Revset becomes `(({explicit}) | (({ancestry}) & mine() & bookmarks()) | ({pending})) ~ (::trunk())`.
- **`submit()` guard (`src/commands/submit.rs`)** — after pass 2, if pass 1 announced a non-empty bookmark set but pass 2 resolved nothing, fail loudly with an actionable message instead of exiting 0. The guard runs *before* `ForgeImpl::new`, so it fails before any token subprocess or HTTP-client construction.
Two red-green kill-tests: `find_changes_to_submit_includes_foreign_authored_named_target` (Option A — a bookmark authored under a different identity is still found) and `named_bookmark_in_trunk_errors_instead_of_silent_noop` (Option B — the guard fires). Both fail on the pre-fix code and pass after.
This fix originated in the orion `oss/forks/jj-vine/` subtree (RIG-2267) and moved here when the fork externalized to its own repo.
The `Test` CI job may show one pre-existing failure — `config::tests::resolved_token_errors_on_non_utf8_output`, a `printf '\xff\xfe'` fixture that only emits non-UTF-8 bytes under bash, not the dash `/bin/sh` on GitHub's ubuntu runners. That is unrelated to this change and is already fixed by PR #1 (`fix-non-utf8-token-test-portability`); it clears once that merges.
Spec-impact: none.
Closes RIG-2267
Co-authored-by: Matt Wilkinson <matt@rigel.build>
… error (RIG-2267)
Addresses the review of the RIG-2267 fix.
- Test (medium): the fix has a dual invariant — an explicitly-named target is taken raw, but ancestry-walked companions stay `& mine()` so a stacked submit does not sweep in other people's bookmarks. Only the first half was covered. Adds `find_changes_to_submit_excludes_foreign_authored_ancestry_companion`: a stack `a(mine) -> c(foreign) -> b(mine)` where submitting `b` must resolve to exactly `{a, b}` — `c` is excluded by `& mine()`. Proven red (resolves `["a","b","c"]`) if `& mine()` is dropped from the ancestry branch, green with the fix. The two-explicit-target assertion in the same test also exercises the multi-target `join(" | ")` on both the explicit and ancestry branches, previously only single-target.
- Guard message (low): the announce-then-empty backstop rendered bookmark names through `BookmarkOrPending`'s `Display`, which colorizes unconditionally (`.magenta()`), so the propagated error string carried raw ANSI escapes into non-tty stderr / CI logs. Switch to `JJName::raw_name()` for the uncolored name.
No production revset or control-flow change; `find_changes_to_submit` and the guard placement are unchanged.
Spec-impact: none. Refs RIG-2267
Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
tooling/rig-2267-submit-author-filter
branch
from
August 21, 2026 16:33
d64e1a0 to
b806e2f
Compare
rigel-mintaka
changed the base branch from
main
to
fix-non-utf8-token-test-portability
August 21, 2026 16:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of a stack containing 2 PRs:
mainjj-vine submit <bookmark>silently no-ops — exit 0, "No bookmarks pushed" — when the bookmark's commit author differs from the configured jjuser.email. The fleet's commit-author flip (seal@sealedsecurity.com→mintaka@rigel.build) left pre-flip commits authored under the old identity, so re-submitting one of those bookmarks quietly does nothing.Root cause is a two-pass double-filter.
submit()resolves the bookmark set from the revset (pass 1, verbatim), announces it, then re-resolves what to actually submit viafind_changes_to_submit(pass 2). Pass 2 intersected the explicitly-named target withmine(), so a foreign-authored named bookmark resolved to the empty set — announced, then dropped, with a success exit.Fix (both halves):
find_changes_to_submit(src/submit.rs) — include an explicitly-named target raw; only the ancestry-walked companions stay narrowed bymine()(so a stacked submit still doesn't sweep in other people's bookmarks). Revset becomes(({explicit}) | (({ancestry}) & mine() & bookmarks()) | ({pending})) ~ (::trunk()).submit()guard (src/commands/submit.rs) — after pass 2, if pass 1 announced a non-empty bookmark set but pass 2 resolved nothing, fail loudly with an actionable message instead of exiting 0. The guard runs beforeForgeImpl::new, so it fails before any token subprocess or HTTP-client construction. Guard error renders bookmark names viaraw_name(), not the colorizingDisplay(no ANSI leaking into the propagated error string).Three red-green kill-tests:
find_changes_to_submit_includes_foreign_authored_named_target(Option A — a bookmark authored under a different identity is still found),find_changes_to_submit_excludes_foreign_authored_ancestry_companion(the& mine()narrowing still excludes a foreign-authored ancestry companion from a stacked submit), andnamed_bookmark_in_trunk_errors_instead_of_silent_noop(Option B — the guard fires). Each fails on the pre-fix code and passes after.This fix originated in the orion
oss/forks/jj-vine/subtree (RIG-2267) and moved here when the fork externalized to its own repo.CI / stack note. This PR is stacked on #1 (
fix-non-utf8-token-test-portability), which repairs a pre-existing seed bug —config::tests::resolved_token_errors_on_non_utf8_outputused aprintf '\xff\xfe'fixture that only emits non-UTF-8 bytes under bash, not the dash/bin/shon GitHub's ubuntu runners. The fork'smainhas been red since the seed commit; #1 is what turnsTestgreen, so this PR stacks on it and its own three kill-tests run green there. TheBuild - *matrix reds on a second, independent seed bug (ci.ymlusedgithub.ref_name=refs/pull/N/mergeas the artifactVERSION, socptargets a nonexistent.../N/mergedir) — fixed separately by #3 (guard-build-matrix-to-dispatch) and non-blocking here (forkmainhas no required checks; the release matrix is dead weight on push/PR triggers). Neither red is introduced by this change.Spec-impact: none.
Closes RIG-2267
Co-authored-by: Matt Wilkinson matt@rigel.build