moz-phab patch -a here with jj says there is no source tree if jj config is broken
Categories
(Conduit :: moz-phab, defect, P3)
Tracking
(Not tracked)
People
(Reporter: Gijs, Assigned: sheehan)
Details
Attachments
(1 file)
moz-phab version (from moz-phab version): 2.8.0
STR:
- use a jj workspace for your tree.
- break your jj config (
jj config edit --repo). E.g. in something like this:
"immutable_heads()" = '''
builtin_immutable_heads()
| remote_bookmarks(exact:'autoland')
| remote_bookmarks(exact:'beta')
| remote_bookmarks(regex:'^esr\d+$')
| remote_bookmarks(exact:'release')
'''
accidentally introduce another quote
- run
jj statusto confirm. It should complain, something like:
jj status
Config error: Invalid `revset-aliases.immutable_heads()`
Caused by: --> 4:29
- try to run
moz-phab patch -a here D123456
ER:
similar error to jj status
AR:
Not a repository (or any of the parent directories): .hg / .jj / .git
Which is confusing because .jj exists.
| Assignee | ||
Comment 1•10 months ago
|
||
Can you paste your moz-phab output (maybe with DEBUG=1 in the environment) so we can see more details?
Any idea if jj fails for every command or just jj status when the config is busted? If it fails for any command, perhaps we could run a cheap sanity-check jj <cheap command> when we build the Jujutsu object to detect this.
| Reporter | ||
Comment 2•10 months ago
•
|
||
With apologies for the silly delay here, this got lost... 😢
(In reply to Connor Sheehan [:sheehan] from comment #1)
Can you paste your
moz-phaboutput (maybe withDEBUG=1in the environment) so we can see more details?
% DEBUG=1 moz-phab patch -a here D123556
DEBUG 2025-12-23 23:19:09,047 MozPhab (2.8.1)
DEBUG 2025-12-23 23:19:09,047 Forced update check: False.
DEBUG 2025-12-23 23:19:09,047 Time since last check is 101 seconds, skipping check for new versions.
DEBUG 2025-12-23 23:19:09,047 Not checking for updates.
DEBUG 2025-12-23 23:19:09,047 found Jujutsu repo in path/to/worktree/
DEBUG 2025-12-23 23:19:09,047 $ jj version
DEBUG 2025-12-23 23:19:09,059 jj 0.36.0
DEBUG 2025-12-23 23:19:09,060 resolved_path: path/to/worktree/
DEBUG 2025-12-23 23:19:09,060 $ jj git root
DEBUG 2025-12-23 23:19:09,086 Config error: Invalid `revset-aliases.immutable_heads()`
Caused by: --> 5:27
|
5 | | remote_bookmarks(exact:'release')
| ^---
|
= expected `-`, `+`, `::`, `..`, `|`, `&`, or `~`
For help, see https://docs.jj-vcs.dev/latest/config/ or use `jj help -k config`.
ERROR 2025-12-23 23:19:09,086 Not a repository (or any of the parent directories): .hg / .jj / .git
Any idea if
jjfails for every command or justjj statuswhen the config is busted? If it fails for any command, perhaps we could run a cheap sanity-checkjj <cheap command>when we build theJujutsuobject to detect this.
Well! Fun fun, the above log output suggests that we do actually know there's a jj repo, we just... forget when the command fails? 😬
Trying in the non-worktree copy of this repo, with the same broken config, the debug output is:
% DEBUG=1 moz-phab patch -a here D123456
DEBUG 2025-12-23 23:21:06,190 MozPhab (2.8.1)
DEBUG 2025-12-23 23:21:06,190 Forced update check: False.
DEBUG 2025-12-23 23:21:06,190 Time since last check is 218 seconds, skipping check for new versions.
DEBUG 2025-12-23 23:21:06,190 Not checking for updates.
DEBUG 2025-12-23 23:21:06,190 found Jujutsu repo in path/to/repo
DEBUG 2025-12-23 23:21:06,190 $ jj version
DEBUG 2025-12-23 23:21:06,202 jj 0.36.0
DEBUG 2025-12-23 23:21:06,203 resolved_path: path/to/repo
DEBUG 2025-12-23 23:21:06,203 $ jj git root
DEBUG 2025-12-23 23:21:06,229 Config error: Invalid `revset-aliases.immutable_heads()`
Caused by: --> 5:27
|
5 | | remote_bookmarks(exact:'release')
| ^---
|
= expected `-`, `+`, `::`, `..`, `|`, `&`, or `~`
For help, see https://docs.jj-vcs.dev/latest/config/ or use `jj help -k config`.
DEBUG 2025-12-23 23:21:06,230 found git repo in path/to/repo
DEBUG 2025-12-23 23:21:06,230 $ git -c i18n.logOutputEncoding=UTF-8 -c i18n.commitEncoding=UTF-8 --version
DEBUG 2025-12-23 23:21:06,247 git version 2.50.1 (Apple Git-155)
DEBUG 2025-12-23 23:21:06,247 $ git -c i18n.logOutputEncoding=UTF-8 -c i18n.commitEncoding=UTF-8 config --list
DEBUG 2025-12-23 23:21:06,316 Initializing Glean...
DEBUG 2025-12-23 23:21:06,350 $ git -c i18n.logOutputEncoding=UTF-8 -c i18n.commitEncoding=UTF-8 status --porcelain
DEBUG 2025-12-23 23:21:07,750 A moz_src_stats_931471037b8a4f16ce3ccfa864310540cac255c1.json
A mozbuild_vs_js_modules_actors_stats.py
DEBUG 2025-12-23 23:21:07,750 $ git -c i18n.logOutputEncoding=UTF-8 -c i18n.commitEncoding=UTF-8 gc --auto --quiet
ERROR 2025-12-23 23:21:07,769 Uncommitted changes present. Please stash them or commit before patching.
(the uncommitted changes thing is not related, but I guess it would just fall back to using git now that it's realized there's also a git repo?)
| Reporter | ||
Comment 3•10 months ago
•
|
||
To be clear, without DEBUG=1, the only final moz-phab output (as moz-phab rewrites lines while making progress) is what is already in comment 0:
Not a repository (or any of the parent directories): .hg / .jj / .git
| Assignee | ||
Comment 4•4 months ago
|
||
A jj git root failure when .jj exists was swallowed as a ValueError
and misreported as "Not a repository". Raise Error with the underlying
jj stderr so a broken config is shown to the user.
Updated•4 months ago
|
| Assignee | ||
Comment 5•4 months ago
|
||
Sorry for the delay, Gijs! This fell through the cracks. I have a patch up that should resolve this, I tagged you for review if you want to give it a try and confirm it works.
Comment 6•4 months ago
|
||
Authored by https://github.com/cgsheeh
https://github.com/mozilla-conduit/review/commit/ac36b536fd7199fd40d24c38147d402062bb22a8
[main] jj: surface broken config error (Bug 2004368) r=ErichDonGubler,shtrom
| Reporter | ||
Comment 7•4 months ago
|
||
Sorry for not responding to the review request, never saw it in my queue as everyone else reviewed too quickly (lovely problem to have 😉).
I can confirm that this fixes it for me on 2.15.2 🎉
Description
•