Skip to content

Namespace default branch - #2555

Draft
shangyian wants to merge 3 commits into
DataJunction:mainfrom
shangyian:namespace-default-branch
Draft

shangyian wants to merge 3 commits into
DataJunction:mainfrom
shangyian:namespace-default-branch

Conversation

@shangyian

Copy link
Copy Markdown
Collaborator

Summary

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

Branch namespaces carry their own `github_repo_path`, so resolution stopped
at the branch row and read `default_branch` from a row that never has one.
`is_default_branch` came back false for the very namespace that tracks the
repo's default branch, and the delete guard in `api/namespaces.py` let a
git-backed default-branch namespace be hard-deleted.

`default_branch` now comes from the first ancestor that has one, in the same
most-specific-first order the repo path and the git branch already use, and
that order includes the FK parent a branch namespace points at when it sits
outside the string hierarchy.

A branch deploy that suppresses a coverage backfill now says so in the
deploy report instead of leaving the author to work out why nothing ran.
is_default_branch treated any namespace with no git_branch anywhere in
its ancestor chain as the default branch, even when that namespace was
just a plain child sitting under a git root (e.g. a branch namespace
created without git_branch ever set on its own row). That falsely
marked such children as the protected default-branch namespace, making
them permanently undeletable. Now the "no branch" case only counts
when the namespace resolves as its own git root.
@netlify

netlify Bot commented Sep 19, 2026

Copy link
Copy Markdown

Deploy Preview for thriving-cassata-78ae72 ready!

Name Link
🔨 Latest commit 4a59f53
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/6aae407faab4cf000885ba92
😎 Deploy Preview https://deploy-preview-2555--thriving-cassata-78ae72.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@shangyian shangyian added the bug Something isn't working label Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant