CPN Org PR Creation
Open PRs against any cloud-pi-native/* repo with org-wide conventions: a
conventional PR title, a French body, and an issue linkage. Repo-specific
enforcement (commitlint, Release Please, branch protection, merge queue) is
detected per repo (Repo-Class Detection), not assumed — console is
strictest; documentation may enforce none.
Deep detail (squash/author/sign a finalized commit, content verification, and
the full pitfalls list) lives in references/cpn-pr-squash.md — load it before
squashing or when diagnosing a squash/force-push/rebase failure.
Internal policy: origin-only
Open all PRs directly from the org repo cloud-pi-native/*: clone so origin
is the org repo, push the working branch to origin, open with
--head cloud-pi-native:<branch>. (Pre-2026-08 --head shikanime:<branch> is
retired.)
When to Use
- "Open a PR against
<cloud-pi-native repo>" / "link this fix to issue #N". - Any org PR needing the org shape.
Prerequisites
ghauthenticated (gh auth status); active identity must be a collaborator. Do NOT rungh auth switch— edit the scoped config instead.- Linked issue should already exist (see
cpn-issue). For deep merge/CI work loadgithub-pr-workflow. - Push the branch to
originbefore opening the PR.
Org-Wide PR Conventions (every repo)
- Conventional PR title —
feat:/fix:/docs:/chore:/refactor:/revert:/build:. Release Please derives the version bump from it where configured. - French PR body — use the repo's
PULL_REQUEST_TEMPLATE.mdsections verbatim when present; else the canonical French template (Procedure §2). - Liaison issue —
Issues liées: #XXXXpar défaut (suivre sans fermer). - Base branch —
mainunless the repo's default differs.
Repo-Class Detection (adapt, don't assume)
Probe the target repo before enforcing console-only rules elsewhere:
REPO=cloud-pi-native/<repo>
gh api repos/$REPO/branches/main/protection >/dev/null 2>&1 \
&& echo "protected" || echo "no protection"
ls .github/PULL_REQUEST_TEMPLATE* 2>/dev/null || echo "no template"
grep -rilE "commitlint|release-please|@commitlint" . \
--include=package.json --include=*.cjs --include=*.json 2>/dev/null \
| grep -v node_modules || echo "no conventional tooling"
| Signal | Implication |
|---|---|
commitlint + Husky commit-msg |
Commits MUST be conventional (hook rejects otherwise). |
release-please |
PR-title type drives the version bump — get the type right. |
| branch protection | Use a feature/hotfix/* branch; a separate approving review is mandatory; may need a merge queue. |
| no commitlint/release-please | Follow the repo's own commit convention; conventional PR title still expected. |
| need to publish a branch | Push to origin and open with --head cloud-pi-native:<branch>. |
doc repo (documentation, documentation-interne-socle) |
Commit subject MUST be doc:-prefixed (old "plain-English no prefix" note was WRONG). Conventional PR title still expected everywhere. |
Procedure
1. Branch + commit
- Branch prefix matches the conventional type:
feat//fix//chore//docs//refactor/revert/build/.`main` is protected; onlyhotfix/*branches may bypass the feature-branch rule. - Commits are conventional only if the repo enforces it (commitlint/Husky). Else follow the repo's established commit style.
1b. Vérification doublon / pile (obligatoire avant gh pr create)
Avant d'ouvrir TOUTE nouvelle PR, lister ce qui existe déjà :
gh pr list --repo cloud-pi-native/<repo> --state open \
--json number,title,headRefName --jq '.[] | "\(.number)\t\(.title)\t\(.headRefName)"'
- Doublon — une PR ouverte livre déjà ce changement (mêmes fichiers / intention) : ne PAS en ouvrir une seconde. Pousser la révision sur la branche de cette PR ou commenter.
- Pile requise — une PR ouverte touche la même zone et votre changement en
dépend (ou entre en conflit sans elle) : baser la branche sur celle de la PR
existante (
--base <leur-branche>), re-baser surmainaprès sa fusion. Référencer les deux URLs dans « Issues liées ». - Ni l'un ni l'autre — procéder avec
--base main.
2. Open the PR with French body + issue linkage
Rebase onto main before pushing/opening (never from a stale base):
jj rebase -d main. Resolve conflict markers; don't push a conflicted branch.
For an existing PR verify mergeability:
gh pr view <N> --json mergeable,mergeStateStatus.
GitHub PR body is free text — author --body/--body-file as natural
prose: never wrap lines and never insert hard line breaks at a column width.
GitHub renders the text as-is (a blank line separates paragraphs). Never run
nix fmt/mdformat over a PR body; those tools enforce an 80-column wrap
that does not apply to GitHub bodies. Encouragez un diagramme Mermaid (ex.
flowchart) dans le corps quand une représentation visuelle aide le lecteur —
GitHub rend le Mermaid dans les corps de PR. Le diagramme est un renfort
optionnel, jamais un substitut à la prose.
@nomen prose déclenche une mention d'utilisateur/équipe — pour écrire un@littéral (decorators, clés de config,@Inject(x)), l'enfermer dans un bloc de code (inline ou fenced) ; le code est le seul contexte où l'analyse des mentions est désactivée.
PR title must be conventional. Use the repo template verbatim if present; else the canonical org body:
gh pr create \
--repo cloud-pi-native/<repo> \
--base main \
--head cloud-pi-native:<branch> \
--draft \
--title "fix: <short summary>" \
--body "$(cat <<'EOF'
## Issues liées
#XXXX (fermer délibérément après la fusion, voir section 3)
---------
## Quel est le comportement actuel ?
## Quel est le nouveau comportement ?
## Cette PR introduit-elle un breaking change ?
Non.
## Autres informations
EOF
)"
Apply triage metadata (2b)
After creation, delegate to cpn-pr-triage (#N): it enumerates the repo's
metadata and sets each empty, determinable field — labels, assignee, project,
milestone (by type), reviewers. Rules live in cpn-pr-triage. Always against
cloud-pi-native/<repo> (origin-only policy).
Repo-specific post-steps (3)
- console (
cloud-pi-native/console): push toorigin, open with--head cloud-pi-native:<branch>. Do NOT self-merge (another collaborator's approving review required). When checks are green butmergeStateStatusisBLOCKED, trigger the merge queue:gh workflow run 243523481 --repo cloud-pi-native/console -f PR_NUMBER=<N>. Verify SonarQube Quality Gate passed viagh pr checks <N>(SonarQube Code Analysis— 0 new issues, Quality Gate passed). Huskypre-pushrunsvitest, so unit tests must pass beforejj git push. - other repos: follow their branch protection / review rules.
Finalize the commit
When the branch has multiple fixup commits, squash to one commit before the user
validates — full steps, author/sign, content verification, and squash hygiene
are in references/cpn-pr-squash.md.
Verification
gh pr view <N> --repo cloud-pi-native/<repo> --json title,baseRefName,body
Confirm: base is main (or repo default), title is conventional, and the body
contains ## Issues liées plus the linked issue. If the repo has no template,
the canonical French sections still apply.
See also
cpn-commit— the commit this PR must restate (parity rule).cpn-dev-workflow— branch discipline and pre-push checks for this PR.sks-pr— shikanime twin (plain-English titles).cpn-pr-triage— assigns PR metadata; run it after creation.