Git-backed namespace management#2326
Merged
Merged
Conversation
Root always redirects; Git settings on the read-only default branch edits the root's repo binding, flat/plain edit themselves, working branches drop it. Removes the manageGit bypass/auto-open/navigate machinery.
A node in a flat/root git-backed namespace (read-only via shape, not the git_only flag) still showed the Edit button. Drive NodePage's read-only state from NamespaceHeader's onReadOnlyChange verdict (git_only OR flat/root shape OR git-deployed), same signal that gates Add Node on the namespace page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- AddEditNodePage redirects /nodes/<name>/edit to the node view when the namespace is read-only (git-managed), and doesn't render the editor until the node is confirmed editable. - NamespaceHeader reports the read-only verdict via onReadOnlyChange only once known (config + sources loaded), not a premature false on mount — which was what let the editor flash before redirecting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for thriving-cassata-78ae72 canceled.
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… autolock/normalize The Tier A change generalized check_namespace_not_git_only to block direct user node create/update/delete in any git repo owner (github_repo_path set, no parent_namespace), not just git_only namespaces. Six git tests configured a namespace as a repo owner and THEN created nodes directly via the user node API — now correctly rejected (422), so those creates never happened and the sync/branch/git_info operations under test failed downstream. Fix (resolution b — the blocked calls are genuine user node-API writes into a read-only repo owner, not internal git flows): author the nodes BEFORE configuring git, so setup uses the editable window and the operation under test still exercises a git-backed namespace. Branch-copy remains internal (copy_nodes_to_namespace, no guard) so branch creation still succeeds. Coverage: add tests for the new deployments.py code on this branch — _normalize_repo_path (scheme-prefix strip, .git strip, scp-style colon, single-segment) and the _verify_git_deployment skip path for a git_only namespace with no github_repo_path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
test_create_branch_cleanup_namespace_fails_gracefully created its two parent source nodes AFTER configuring git, so once the parent became a git repo owner those user node-API POSTs were rejected (422). The parent then had no nodes to copy into the branch, so when the branch-create rollback fired, _cleanup_namespace_and_nodes iterated an empty list and never executed the `await session.delete(node)` delete-loop body (branches.py:232). Author the nodes before configuring git (same read-only repo-owner model as the other git tests). The nodes now get copied into the branch namespace, so the rollback's cleanup deletes >=1 node and line 232 is exercised again. Confirmed branches.py back to 100% under tests/api/git_test.py. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shangyian
marked this pull request as ready for review
July 13, 2026 00:01
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.
Summary
Makes git-backed DJ namespaces coherent to manage in the UI, and generalizes the backend that gates them. A namespace can be one of the following:
Each now presents a clean, single-line toolbar with one obvious way to view/manage/edit, along with consistent read-only enforcement across the namespace page, node pages, and the edit route.
Backend
is_git_roottois_repo_owner(github_repo_pathset and noparent_namespace), which covers both git roots and flat namespaces.git_onlyis now valid on any namespace (not just branches); enforcement (check_namespace_not_git_only) honors it uniformly.git_onlywrite, so unlinking is just a config change.github_repo_pathon deploy.UI
NamespaceHeaderis rewritten to a state-driven, single-line toolbar.GitSettingsModalrewritten from a git-only checkbox / path form into an intent-based form:Test Plan
make checkpassesmake testshows 100% unit test coverageDeployment Plan