feat(hogli): add devbox:setup --reset-* + Y/n gate#59294
Merged
Conversation
Contributor
There was a problem hiding this comment.
Clean developer-tooling addition by the owning team. New flags are purely additive, the Y/n gate correctly short-circuits on non-TTY stdin, the SSH double-quoting fix is correct, and all new behaviour is covered by tests. No production code, data models, or API contracts touched.
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
tools/hogli-commands/hogli_commands/devbox/cli.py:776-798
**Reset flags re-trigger the configure prompt they just cleared**
After `_apply_resets(reset_dotfiles=True)` fires, `clear_dotfiles_uri()` removes `dotfiles_uri` from config. Then `maybe_configure_dotfiles(configure_dotfiles=None)` is called: because `existing_uri` is now `None`, the early-exit guard `configure_dotfiles is None and existing_uri` evaluates to `False`, and the user is immediately re-prompted to enter a dotfiles URL — the opposite of what `--reset-dotfiles` is supposed to accomplish. The same issue affects `--reset-git-identity` → `maybe_configure_git_identity(None)`. A minimal fix is to pass `configure_dotfiles=False` when `reset_dotfiles` and `configure_git_identity=False` when `reset_git_identity` before calling the `maybe_configure_*` helpers.
### Issue 2 of 2
tools/hogli-commands/hogli_commands/tests/test_devbox.py:1538-1566
**Near-identical secret-reset tests could be a single parameterised case**
`test_reset_git_signing_deletes_user_secret` and `test_reset_claude_deletes_user_secret` have identical structure: patch `delete_user_secret`, invoke with one flag, assert the expected secret name was deleted. Per the project's convention of preferring parameterised tests, these two cases can be collapsed into one `@pytest.mark.parametrize("flag,expected_secret", [...])` test, eliminating the duplication.
Reviews (1): Last reviewed commit: "test(hogli): mock list_user_secrets in d..." | Re-trigger Greptile |
gantoine
approved these changes
May 21, 2026
…etup-reset-flags # Conflicts: # tools/hogli-commands/hogli_commands/devbox/coder.py # tools/hogli-commands/hogli_commands/tests/test_devbox.py
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
inkeep Bot
added a commit
that referenced
this pull request
May 21, 2026
- Update devbox:setup description with compact status block and Y/n gate - Add "Managing devbox configuration" section with devbox:config:show and devbox:config:rm usage examples - Note that clearing dotfiles pushes empty param to existing workspaces
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.
Problem
hogli devbox:setuphad no way to undo a setting. The dotfiles prompt prefilled the saved URL as the default, so pressing Enter just re-saved it; even if you submitted blank, the config helper had noclear_*counterpart and existing workspaces kept the baked-indotfiles_uriparameter — meaning a once-saved repo would keep re-cloning its.zshrcon every boot until you wiped it via the Coder UI. Re-runs also printed two lines of "Using saved X / Run --configure-X to change" per option, which got noisy.Changes
--reset-{git-identity,git-signing,dotfiles,claude}flags ondevbox:setup.--reset-dotfilesalso pushesdotfiles_uri=""to every existing workspace so the template stops re-cloning the repo.clear_dotfiles_uri()/clear_git_identity()helpers inconfig.py.maybe_configure_*helper now returns silently on the already-set path — the status block is the source of truth.devbox:setup, bypassed when stdin is non-TTY or any per-option flag is passed, so CI and scripted callers keep working.--configure-X,--skip-configure-X,-v) keep their previous semantics. Purely additive.How did you test this code?
I'm an agent. I added two new test classes (
TestDevboxSetupResets,TestDevboxSetupGate) covering each reset flag, the empty-param push to existing workspaces, the gate-bypass paths (explicit flag, non-TTY), and the "aborted on no" path. Three existing tests had assertions updated to match the new compact status output. 167/167 tests pass intools/hogli-commands. No manual run ofhogli devbox:setupagainst a real Coder deployment.Publish to changelog?
no
🤖 Agent context
Investigation started from a user report: someone with a saved dotfiles URL whose
.zshrcwas conflicting wanted to back out, and the only escape hatch was the Coder web UI. Initial inspection found three stacked gaps (prompt couldn't be cleared, config helper didn't support clearing, existing workspaces kept the baked param). Considered aSettingprotocol refactor that would have collapsed the fourmaybe_configure_*functions into one loop, but chose the smaller additive shape per "keep it simple, backwards-compatible" guidance — the protocol refactor stays available as a follow-up. Tool: Claude Code (Opus 4.7).