Skip to content

org-bootstrap: the branches step should also create the orphan badges branch #403

Closed

Description

@Shinrai

Summary

The bootstrap branches step (.github/actions/github/jobs/org-bootstrap-repo/action.mjs, the BRANCHES block) creates only next and hotfixes from the default branch. It never creates the orphan badges branch that the coverage badge job pushes to, so every onboarded repo needs a manual step: create an empty parentless commit, then push it as badges. That step is easy to miss, and it regularly is: several onboarded repos have no badges branch today.

badges is already part of the flow everywhere else: it is in the org ruleset's allowed branch names (scripts/setup-org-rulesets.mjs), the ci.yml template excludes it via branches-ignore, and branch retention treats it as bot-managed. Only bootstrap doesn't create it.

Current behaviour

  • push-badge/action.mjs creates the branch lazily on its first run (git checkout --orphan), so a missing branch doesn't break the badge job by itself.
  • But the README badge points at a branch that doesn't exist until the first successful coverage run on the default branch. Until then the badge is broken, and whether a repo has the branch depends on whether someone did the manual step or CI happened to run.

Requested change

In the branches step, after next / hotfixes:

  1. If refs/heads/badges exists, note it and do nothing. Never reset it, since it holds badge history.
  2. Otherwise create an orphan commit through the Git Data API: a tree with a placeholder (for example a short README.md saying the branch is bot-managed), or an empty tree, and a commit with parents: []. Then POST /git/refs for refs/heads/badges. Doing this through the API means the commit is signed for the bot App, the same way other bootstrap writes are.
  3. Record it like the others (branch.badges.created / branch.badges.existed) and honour dry_run.
  4. Optionally, add a badges_branch input (default badges) to mirror next_branch / hotfixes_branch, and add an opt-out for repos with enable_coverage_badge: false.

Re-running bootstrap on already-onboarded repos would then backfill the branch across the fleet.

Activity

  1. added
    type: enhancement
    priority: medium
    type: ci
    status: not started
    status: in progress
    and removed
    status: not started
    on Oct 31, 2026
  2. Shinrai commented on Nov 1, 2026

    @Shinrai
    ContributorAuthor

    #413: the bootstrap branches step creates an orphan badges branch through the Git Data API when it's missing, and leaves an existing one alone. It adds the inputs badges_branch (default badges) and create_badges_branch (default true). Re-running bootstrap will backfill the branch across the fleet.

  3. added
    status: implemented
    and removed
    status: in progress
    on Nov 1, 2026
  4. cldmv-bot commented on Nov 1, 2026

    @cldmv-bot
    Contributor

    Marked status: implemented — resolved by #413, merged into next. This issue closes automatically when that work ships to the default branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumstatus: implementedtype: citype: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions