blueprint-shared-facts 0.7.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  "package": "blueprint-shared-facts",
5
5
  "entry": "blueprint-shared",
6
6
  "describes": {
7
- "blueprint-shared-facts": "0.7.1"
7
+ "blueprint-shared-facts": "0.9.0"
8
8
  },
9
9
  "layer": "org",
10
10
  "facts": [
@@ -348,6 +348,39 @@
348
348
  ]
349
349
  }
350
350
  }
351
+ },
352
+ {
353
+ "since": "0.9.0",
354
+ "content": {
355
+ "value": {
356
+ "rows": [
357
+ {
358
+ "job": "build and deploy in a private repository",
359
+ "runner": "the runner the organization gives in privateRepoRunner"
360
+ },
361
+ {
362
+ "job": "publish job of Trusted Publishing (npm, PyPI, crates.io)",
363
+ "runner": "GitHub-hosted (ubuntu-latest)",
364
+ "why": "Trusted Publishing accepts only GitHub-hosted runners (npm documents that self-hosted runners are not supported). The template has no PUBLISH_ENABLED condition on the job. Only a demonstration repository has it, added by compose, and the variable is unset there, so the job shows as skipped. A repository in real use does not carry the condition, and adds one only to control whether it publishes."
365
+ },
366
+ {
367
+ "job": "publish to GitHub Packages",
368
+ "runner": "the runner the organization gives in githubPackagesPublishRunner",
369
+ "shape": "one job",
370
+ "why": "It uses GITHUB_TOKEN and needs no hosted runner. A demonstration repository has the same PUBLISH_ENABLED condition on it as on the job above, and the same rule applies: the template has none and a repository in real use does not carry it."
371
+ },
372
+ {
373
+ "job": "every job of a public repository, mirror repositories included",
374
+ "runner": "GitHub-hosted (ubuntu-latest)",
375
+ "why": "A fork pull request of a public repository cannot run on self-hosted."
376
+ }
377
+ ],
378
+ "orgValues": [
379
+ "privateRepoRunner",
380
+ "githubPackagesPublishRunner"
381
+ ]
382
+ }
383
+ }
351
384
  }
352
385
  ],
353
386
  "source": {
@@ -363,13 +396,13 @@
363
396
  {
364
397
  "job": "publish job of Trusted Publishing (npm, PyPI, crates.io)",
365
398
  "runner": "GitHub-hosted (ubuntu-latest)",
366
- "why": "Trusted Publishing accepts only GitHub-hosted runners (npm documents that self-hosted runners are not supported). The template gives the job a PUBLISH_ENABLED condition for the demo repositories and a repository just copied from them, so it shows as skipped there. A repository in real use removes the condition and keeps it only to control whether it publishes."
399
+ "why": "Trusted Publishing accepts only GitHub-hosted runners (npm documents that self-hosted runners are not supported). The template has no PUBLISH_ENABLED condition on the job. Only a demonstration repository has it, added by compose, and the variable is unset there, so the job shows as skipped. A repository in real use does not carry the condition, and adds one only to control whether it publishes."
367
400
  },
368
401
  {
369
402
  "job": "publish to GitHub Packages",
370
403
  "runner": "the runner the organization gives in githubPackagesPublishRunner",
371
404
  "shape": "one job",
372
- "why": "It uses GITHUB_TOKEN and needs no hosted runner. The template gives it the same PUBLISH_ENABLED condition as the job above, and the same rule for removing it applies."
405
+ "why": "It uses GITHUB_TOKEN and needs no hosted runner. A demonstration repository has the same PUBLISH_ENABLED condition on it as on the job above, and the same rule applies: the template has none and a repository in real use does not carry it."
373
406
  },
374
407
  {
375
408
  "job": "every job of a public repository, mirror repositories included",
@@ -451,6 +484,89 @@
451
484
  }
452
485
  }
453
486
  },
487
+ {
488
+ "id": "blueprint-shared.ci.wait-loops",
489
+ "tool": "blueprint-shared",
490
+ "topics": [
491
+ "ci"
492
+ ],
493
+ "title": "job 不佔著 runner 等另一個 job",
494
+ "description": "等另一個 run、PR 或 release-please 的迴圈最多問兩輪,三個輪數變數不超過 2,間隔變數不超過預設值。`writeback-ops.sh` 的寫入重試是登記過的例外。",
495
+ "variants": [
496
+ {
497
+ "since": "0.8.0",
498
+ "content": {
499
+ "value": {
500
+ "rule": "A job on a self-hosted runner does not keep the runner waiting for another run. A loop that asks about another run, a pull request or release-please asks twice at most; the rest is triggered by an event, or the job fails and is dispatched again from outside.",
501
+ "roundVariables": [
502
+ "POLL_TRIES",
503
+ "CI_GATE_TRIES",
504
+ "CI_GATE_QUEUE_TRIES"
505
+ ],
506
+ "maxRounds": 2,
507
+ "roundVariablesWhere": "The three round variables are set on the workflow env, or in the env of every job whose runs-on is not a literal GitHub-hosted label (ubuntu-, macos-, windows-), and none is above maxRounds. The template ci.yml sets them on the jobs, the other workflows on the workflow.",
508
+ "sleepDefaults": {
509
+ "POLL_SLEEP": 3,
510
+ "CI_GATE_SLEEP": 15,
511
+ "WRITEBACK_RETRY_SLEEP": 5,
512
+ "WRITEBACK_RETRY_JITTER": 5,
513
+ "RETRY_SLEEP": 5
514
+ },
515
+ "sleepRule": "An interval variable is not set above its default (seconds).",
516
+ "writeRetries": [
517
+ {
518
+ "file": "templates/deploy/scripts/deploy/writeback-ops.sh",
519
+ "loop": "for ((i=1; i<=${WRITEBACK_TRIES:-6}; i++))",
520
+ "defaults": {
521
+ "WRITEBACK_TRIES": 6,
522
+ "WRITEBACK_RETRY_SLEEP": 5,
523
+ "WRITEBACK_RETRY_JITTER": 5
524
+ },
525
+ "limit": "WRITEBACK_TRIES rounds, 6 by default, of WRITEBACK_RETRY_SLEEP seconds (5) plus up to WRITEBACK_RETRY_JITTER seconds (5) at random",
526
+ "why": "the deploys of a monorepo write the ops declaration back at once, and each round lets one of them push"
527
+ }
528
+ ]
529
+ }
530
+ }
531
+ }
532
+ ],
533
+ "source": {
534
+ "kind": "published"
535
+ },
536
+ "content": {
537
+ "value": {
538
+ "rule": "A job on a self-hosted runner does not keep the runner waiting for another run. A loop that asks about another run, a pull request or release-please asks twice at most; the rest is triggered by an event, or the job fails and is dispatched again from outside.",
539
+ "roundVariables": [
540
+ "POLL_TRIES",
541
+ "CI_GATE_TRIES",
542
+ "CI_GATE_QUEUE_TRIES"
543
+ ],
544
+ "maxRounds": 2,
545
+ "roundVariablesWhere": "The three round variables are set on the workflow env, or in the env of every job whose runs-on is not a literal GitHub-hosted label (ubuntu-, macos-, windows-), and none is above maxRounds. The template ci.yml sets them on the jobs, the other workflows on the workflow.",
546
+ "sleepDefaults": {
547
+ "POLL_SLEEP": 3,
548
+ "CI_GATE_SLEEP": 15,
549
+ "WRITEBACK_RETRY_SLEEP": 5,
550
+ "WRITEBACK_RETRY_JITTER": 5,
551
+ "RETRY_SLEEP": 5
552
+ },
553
+ "sleepRule": "An interval variable is not set above its default (seconds).",
554
+ "writeRetries": [
555
+ {
556
+ "file": "templates/deploy/scripts/deploy/writeback-ops.sh",
557
+ "loop": "for ((i=1; i<=${WRITEBACK_TRIES:-6}; i++))",
558
+ "defaults": {
559
+ "WRITEBACK_TRIES": 6,
560
+ "WRITEBACK_RETRY_SLEEP": 5,
561
+ "WRITEBACK_RETRY_JITTER": 5
562
+ },
563
+ "limit": "WRITEBACK_TRIES rounds, 6 by default, of WRITEBACK_RETRY_SLEEP seconds (5) plus up to WRITEBACK_RETRY_JITTER seconds (5) at random",
564
+ "why": "the deploys of a monorepo write the ops declaration back at once, and each round lets one of them push"
565
+ }
566
+ ]
567
+ }
568
+ }
569
+ },
454
570
  {
455
571
  "id": "blueprint-shared.templates.deploy-repos",
456
572
  "tool": "blueprint-shared",
@@ -777,6 +893,128 @@
777
893
  ]
778
894
  }
779
895
  }
896
+ },
897
+ {
898
+ "since": "0.9.0",
899
+ "content": {
900
+ "value": {
901
+ "rule": "Only the repositories that put Workers online hold the Cloudflare credentials. A repository uses them only while its deploy jobs run, and the template gives those jobs no vars.DEPLOY_ENABLED condition. Only the demonstration repositories have it, added by compose, and a repository in real use adds one itself only to control when deploying runs. Every other repository builds, hands a bundle over and writes a declaration.",
902
+ "repos": [
903
+ {
904
+ "kind": "single repository of a monorepo product",
905
+ "roles": [
906
+ "deploy",
907
+ "ops",
908
+ "verify"
909
+ ],
910
+ "does": "the release flow of a poly product in one repository: the deploy job builds the Workers units, attaches the bundle and its hash to its own GitHub Release and writes ops/versions.json of the same repository, ops-deploy.yml of the same repository creates the cloud resources of its iac steps (OpenTofu) and then puts it online, and verify-prod.yml, started by hand, checks the prod declaration against the Release Plan",
911
+ "cloudflare": true
912
+ },
913
+ {
914
+ "kind": "app repository of a poly product",
915
+ "roles": [
916
+ "deploy"
917
+ ],
918
+ "does": "builds, attaches the bundle and its hash to its own GitHub Release, writes the declaration into the ops repository",
919
+ "cloudflare": false
920
+ },
921
+ {
922
+ "kind": "service repository of a poly product",
923
+ "roles": [
924
+ "deploy"
925
+ ],
926
+ "does": "builds, attaches the bundle and its hash to its own GitHub Release, writes the declaration into the ops repository",
927
+ "cloudflare": false
928
+ },
929
+ {
930
+ "kind": "ops repository of a poly product",
931
+ "roles": [
932
+ "ops"
933
+ ],
934
+ "does": "holds ops/versions.json, ops/urls.json (the URL patterns its ops unit publishes) and the iac steps under ops/iac/ (OpenTofu), creates the cloud resources of the iac steps and then puts the declared bundles online on every push to main. Its own tags publish its facts package only, they deploy nothing",
935
+ "cloudflare": true
936
+ },
937
+ {
938
+ "kind": "ops repository of the organization layer",
939
+ "roles": [
940
+ "ops"
941
+ ],
942
+ "does": "holds ops/targets.json (the locations, their parent clusters and the instances that the ops repositories of the products point at), the iac steps and the workloads of the locations. It belongs to no product, so it has no ops/versions.json of a product, no ops/urls.json and no Workers units, and its CI checks ops/targets.json (scripts/ci/check-targets.mjs). Its deploy jobs carry the same vars.DEPLOY_ENABLED condition as the other ops repositories",
943
+ "cloudflare": true
944
+ },
945
+ {
946
+ "kind": "hub repository of a poly product",
947
+ "roles": [
948
+ "hub",
949
+ "verify"
950
+ ],
951
+ "does": "holds the Release Plans, opens the release line of the member repositories, and after a product release checks the prod declaration of the ops repository against the unit versions of the Release Plan (verify-prod.yml). No Cloudflare credential",
952
+ "cloudflare": false
953
+ }
954
+ ],
955
+ "cloudflareSecretRepos": [
956
+ "single repository of a monorepo product",
957
+ "ops repository of a poly product",
958
+ "ops repository of the organization layer"
959
+ ],
960
+ "cloudflareNames": {
961
+ "secret": [
962
+ "CLOUDFLARE_API_TOKEN",
963
+ "CLOUDFLARE_R2_API_TOKEN"
964
+ ],
965
+ "variable": [
966
+ "CLOUDFLARE_ACCOUNT_ID"
967
+ ],
968
+ "tokens": "CLOUDFLARE_API_TOKEN is the token of the workloads job (Workers), read by the self-hosted runner. CLOUDFLARE_R2_API_TOKEN is another token with the R2 write permission, read only by the iac job, which runs on a GitHub-hosted runner. Neither job reads the token of the other"
969
+ },
970
+ "otherVariables": [
971
+ {
972
+ "name": "OPS_REPO",
973
+ "repos": [
974
+ "app repository of a poly product",
975
+ "service repository of a poly product",
976
+ "hub repository of a poly product"
977
+ ],
978
+ "meaning": "owner/name of the ops repository. Unset in the single repository of a monorepo product, which holds ops/ itself. The hub reads it for the check after a product release (verify-prod.yml); the same workflow in the single repository has it unset and reads ops/versions.json of its own repository"
979
+ },
980
+ {
981
+ "name": "BUNDLE_REPOS",
982
+ "repos": [
983
+ "ops repository of a poly product"
984
+ ],
985
+ "meaning": "comma list of the repositories whose Releases hold the bundles. Unset in the single repository of a monorepo product, whose bundles are in its own Releases"
986
+ }
987
+ ],
988
+ "consumedBy": "the roles of a composed repository must follow this fact, and the Cloudflare credentials are read only by the jobs of ops-deploy.yml (iac and workloads)",
989
+ "referencedBy": "cloudflareSecretRepos lists where a product repository that deploys sets the Cloudflare secret. A demo repository sets none.",
990
+ "urlPatterns": "The URL pattern of a Worker in each environment is not a repository variable. It is the interface of the OpsName unit of the ops repository (the field urls of its interface), which compose writes into ops/urls.json (read by healthz.sh), into the facts of the unit and into the wrangler.toml of the unit that calls the Worker",
991
+ "demoRepositories": "A demo repository holds no Cloudflare credential and leaves DEPLOY_ENABLED unset. The repos and the credential names say what a product repository that deploys sets.",
992
+ "enableCondition": "The cloudflare field says which repository holds the Cloudflare credentials, not which one deploys. The deploy jobs of the ops role (iac and workloads) carry vars.DEPLOY_ENABLED == 'true' only in the demonstration repositories, where compose adds it, the variable is unset and nothing goes online. The template has no such condition. A repository whose roles are all of one kind needs no other field for it. A repository in real use does not carry the condition, and adds one only to control when deploying runs. A product with a deploy-role repository and an ops repository that adds it sets the variable in both.",
993
+ "stateBackend": {
994
+ "rule": "The iac job keeps the OpenTofu state in an S3-compatible backend (a bucket of R2) that the organization provides. A GitHub-hosted runner has an empty disk on every run, so without a backend the second apply would try to create what exists. The job stops before tofu init, and calls no tofu apply, when one of the settings is missing, and prints the names of the missing ones",
995
+ "variable": [
996
+ "TOFU_STATE_BUCKET",
997
+ "TOFU_STATE_ENDPOINT"
998
+ ],
999
+ "secret": [
1000
+ "TOFU_STATE_ACCESS_KEY_ID",
1001
+ "TOFU_STATE_SECRET_ACCESS_KEY"
1002
+ ],
1003
+ "key": "iac/<purpose>/<env>/<step name>.tfstate, one state per iac step",
1004
+ "unverified": "The settings follow the documentation of the OpenTofu S3 backend and the S3 API of R2. A real apply was not run, so they are to be verified"
1005
+ },
1006
+ "iacVariables": [
1007
+ {
1008
+ "name": "INFRA_MODULES_REPO",
1009
+ "repos": [
1010
+ "single repository of a monorepo product",
1011
+ "ops repository of a poly product"
1012
+ ],
1013
+ "meaning": "owner/name of the organization-layer repository that holds the OpenTofu modules the main.tf of the iac steps take with a git source. Unset when the modules are public. When it is set the iac job makes a GitHub App token for that repository and sets git config url.<base>.insteadOf before tofu init, so the private repository can be cloned"
1014
+ }
1015
+ ]
1016
+ }
1017
+ }
780
1018
  }
781
1019
  ],
782
1020
  "source": {
@@ -784,7 +1022,7 @@
784
1022
  },
785
1023
  "content": {
786
1024
  "value": {
787
- "rule": "Only the repositories that put Workers online hold the Cloudflare credentials. A repository uses them only while its deploy jobs run, and the template gives those jobs a vars.DEPLOY_ENABLED condition for the demo repositories and for a repository just copied from it. A repository in real use removes the condition, and keeps it only to control when deploying runs. Every other repository builds, hands a bundle over and writes a declaration.",
1025
+ "rule": "Only the repositories that put Workers online hold the Cloudflare credentials. A repository uses them only while its deploy jobs run, and the template gives those jobs no vars.DEPLOY_ENABLED condition. Only the demonstration repositories have it, added by compose, and a repository in real use adds one itself only to control when deploying runs. Every other repository builds, hands a bundle over and writes a declaration.",
788
1026
  "repos": [
789
1027
  {
790
1028
  "kind": "single repository of a monorepo product",
@@ -875,7 +1113,7 @@
875
1113
  "referencedBy": "cloudflareSecretRepos lists where a product repository that deploys sets the Cloudflare secret. A demo repository sets none.",
876
1114
  "urlPatterns": "The URL pattern of a Worker in each environment is not a repository variable. It is the interface of the OpsName unit of the ops repository (the field urls of its interface), which compose writes into ops/urls.json (read by healthz.sh), into the facts of the unit and into the wrangler.toml of the unit that calls the Worker",
877
1115
  "demoRepositories": "A demo repository holds no Cloudflare credential and leaves DEPLOY_ENABLED unset. The repos and the credential names say what a product repository that deploys sets.",
878
- "enableCondition": "The cloudflare field says which repository holds the Cloudflare credentials, not which one deploys. The deploy jobs of the ops role (iac and workloads) have a vars.DEPLOY_ENABLED == 'true' condition for the demo repositories and for a repository just copied from the template, where the variable is unset and nothing goes online. A repository whose roles are all of one kind needs no other field for it. A repository in real use removes the condition, and keeps it only to control when deploying runs. A product with a deploy-role repository and an ops repository that keeps it sets the variable in both.",
1116
+ "enableCondition": "The cloudflare field says which repository holds the Cloudflare credentials, not which one deploys. The deploy jobs of the ops role (iac and workloads) carry vars.DEPLOY_ENABLED == 'true' only in the demonstration repositories, where compose adds it, the variable is unset and nothing goes online. The template has no such condition. A repository whose roles are all of one kind needs no other field for it. A repository in real use does not carry the condition, and adds one only to control when deploying runs. A product with a deploy-role repository and an ops repository that adds it sets the variable in both.",
879
1117
  "stateBackend": {
880
1118
  "rule": "The iac job keeps the OpenTofu state in an S3-compatible backend (a bucket of R2) that the organization provides. A GitHub-hosted runner has an empty disk on every run, so without a backend the second apply would try to create what exists. The job stops before tofu init, and calls no tofu apply, when one of the settings is missing, and prints the names of the missing ones",
881
1119
  "variable": [
@@ -1068,7 +1306,7 @@
1068
1306
  "sameAs": "scripts/lib/bundle.sh is the same file as the one of the deploy role",
1069
1307
  "urls": "healthz.sh reads the URL pattern of each environment from ops/urls.json, which compose writes. The role has no repository variable for it",
1070
1308
  "targets": "The static job of ci.yml runs `node scripts/ci/check-targets.mjs` in a repository with this role. It validates ops/targets.json against schemas/targets.schema.json (the same JSON Schema as blueprint-shared.infra-layout.targets), then checks what the schema cannot: a ref points at an instance of the same kind, a host and a cluster are declared by the repository they name, a location or parent cluster with an environment suffix holds instances of that environment only, parent clusters and tenants are named by blueprint-shared.infra-layout.cluster-naming, and every iac/hosts/<location>/clusters/<cluster> and workloads/hosts/<location>/clusters/<cluster> directory is declared. The suffixes and the order of the cases are constants of the script that a test compares with the machine-readable fields of cluster-naming",
1071
- "orgRepos": "scripts/ci/org-repos.json is a list of repository names that compose writes from the repository list of the organization of the repository (blueprint.demos.repos for the demo organization), because the script cannot read the facts. A <RepoName>: prefix of a host or ref has to be in this list, and a name outside it fails. The list is of one organization, so two organizations that both have a repository of the same name never share a list. A host or ref into a repository of the list whose ops/targets.json was not given is printed as 未核對 with the instance and the host, and does not fail. A repository checks only its own ops/targets.json in its own CI; a run that is given the ops/targets.json of every repository of the organization (--targets <RepoName>=<file>) checks all of it",
1309
+ "orgRepos": "scripts/ci/org-repos.json is a list of repository names that compose writes from the repository list of the organization of the repository (for the demo organization, the repository list of its facts), because the script cannot read the facts. A <RepoName>: prefix of a host or ref has to be in this list, and a name outside it fails. The list is of one organization, so two organizations that both have a repository of the same name never share a list. A host or ref into a repository of the list whose ops/targets.json was not given is printed as 未核對 with the instance and the host, and does not fail. A repository checks only its own ops/targets.json in its own CI; a run that is given the ops/targets.json of every repository of the organization (--targets <RepoName>=<file>) checks all of it",
1072
1310
  "iac": "ops/iac/<purpose>/<env>/<step name>/ holds an OpenTofu root module: main.tf (a module call with a git source and ref, and the backend block) and terraform.tfvars.json (the inputs, among them the name of the bucket). apply-iac.sh applies the steps of one environment in the order of ops/needs.json with tofu init and tofu apply",
1073
1311
  "bucketName": "The name of an R2 bucket is written once, in the terraform.tfvars.json of its iac step. When apply-ops.sh joins the settings of a workloads step to the wrangler.toml of the bundle, it adds bucket_name to every [[env.<env>.r2_buckets]] table that has none, with the name from the terraform.tfvars.json of the iac steps the workloads step needs in ops/needs.json"
1074
1312
  }
@@ -1103,7 +1341,7 @@
1103
1341
  "sameAs": "scripts/lib/bundle.sh is the same file as the one of the deploy role",
1104
1342
  "urls": "healthz.sh reads the URL pattern of each environment from ops/urls.json, which compose writes. The role has no repository variable for it",
1105
1343
  "targets": "The static job of ci.yml runs `node scripts/ci/check-targets.mjs` in a repository with this role. It validates ops/targets.json against schemas/targets.schema.json (the same JSON Schema as blueprint-shared.infra-layout.targets), then checks what the schema cannot: a ref points at an instance of the same kind, a host and a cluster are declared by the repository they name, a location or parent cluster with an environment suffix holds instances of that environment only, parent clusters and tenants are named by blueprint-shared.infra-layout.cluster-naming, and every iac/hosts/<location>/clusters/<cluster> and workloads/hosts/<location>/clusters/<cluster> directory is declared. The suffixes and the order of the cases are constants of the script that a test compares with the machine-readable fields of cluster-naming",
1106
- "orgRepos": "scripts/ci/org-repos.json is a list of repository names that compose writes from the repository list of the organization of the repository (blueprint.demos.repos for the demo organization), because the script cannot read the facts. A <RepoName>: prefix of a host or ref has to be in this list, and a name outside it fails. The list is of one organization, so two organizations that both have a repository of the same name never share a list. A host or ref into a repository of the list whose ops/targets.json was not given is printed as 未核對 with the instance and the host, and does not fail. A repository checks only its own ops/targets.json in its own CI; a run that is given the ops/targets.json of every repository of the organization (--targets <RepoName>=<file>) checks all of it",
1344
+ "orgRepos": "scripts/ci/org-repos.json is a list of repository names that compose writes from the repository list of the organization of the repository (for the demo organization, the repository list of its facts), because the script cannot read the facts. A <RepoName>: prefix of a host or ref has to be in this list, and a name outside it fails. The list is of one organization, so two organizations that both have a repository of the same name never share a list. A host or ref into a repository of the list whose ops/targets.json was not given is printed as 未核對 with the instance and the host, and does not fail. A repository checks only its own ops/targets.json in its own CI; a run that is given the ops/targets.json of every repository of the organization (--targets <RepoName>=<file>) checks all of it",
1107
1345
  "iac": "ops/iac/<purpose>/<env>/<step name>/ holds an OpenTofu root module: main.tf (a module call with a git source and ref, and the backend block) and terraform.tfvars.json (the inputs, among them the name of the bucket). apply-iac.sh applies the steps of one environment in the order of ops/needs.json with tofu init and tofu apply",
1108
1346
  "bucketName": "The name of an R2 bucket is written once, in the terraform.tfvars.json of its iac step. When apply-ops.sh joins the settings of a workloads step to the wrangler.toml of the bundle, it adds bucket_name to every [[env.<env>.r2_buckets]] table that has none, with the name from the terraform.tfvars.json of the iac steps the workloads step needs in ops/needs.json"
1109
1347
  }
@@ -1645,6 +1883,37 @@
1645
1883
  "releaseIf": "The if of the release job depends on the roles of the repository. A repository with both roles (the line is between # @if deploy+infra) has needs.infra.result != 'failure' && !cancelled() && in front of the tag check, because a skipped infra job (DEPLOY_ENABLED is not true) would skip a downstream job that has no status function, and a failed infra job must still stop it. A repository with only the deploy role has no infra job, so its if has no such part."
1646
1884
  }
1647
1885
  }
1886
+ },
1887
+ {
1888
+ "since": "0.9.0",
1889
+ "content": {
1890
+ "value": {
1891
+ "file": "deploy/.github/workflows/deploy-production.yml",
1892
+ "role": "deploy and infra",
1893
+ "triggers": [
1894
+ "push of a tag v[0-9]*",
1895
+ "workflow_dispatch with the product tag"
1896
+ ],
1897
+ "onlyProductTag": "Production is put online by a product tag vX.Y.Z only. The stable tag of a unit does not trigger it",
1898
+ "tagCheck": "The workflow `if` and run-production.sh both check the tag, because a private repository on a plan without deployment tag rules for environments (the GitHub Free plan is one) cannot rely on them",
1899
+ "units": "plan-production.sh: the units under apps/ and services/ whose version in .release-please-manifest.json differs from the previous product tag and that have an [env.production] table",
1900
+ "rebuild": "Each unit is rebuilt at its GA version from the product tag. The bundle of the rc is not reused",
1901
+ "release": "The GA bundles are attached to the Release of the product tag, which is created when it does not exist",
1902
+ "files": [
1903
+ "deploy/.github/workflows/deploy-production.yml",
1904
+ "infra/.github/workflows/deploy-production.yml"
1905
+ ],
1906
+ "sameFile": "The two files are the same. Compose keeps the release job (# @if deploy) in a repository with the deploy role and the infra job (# @if infra) in a repository with the infra role",
1907
+ "jobs": [
1908
+ "infra: apply-production.sh creates the R2 buckets of production with wrangler (infra role)",
1909
+ "release: rebuild, attach to the Release, write the production declaration (deploy role)"
1910
+ ],
1911
+ "order": "In a repository with both roles the release job has needs: infra (the line is between # @if deploy+infra), so the buckets exist before the Workers that bind them go online",
1912
+ "credentials": "Only the infra job reads CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. The release job does not",
1913
+ "enableCondition": "The infra job has no enable condition in the template. Only a demonstration repository has vars.DEPLOY_ENABLED == 'true' in front of its tag checks, added by compose, and the variable is unset there. A repository in real use does not carry it, and adds one only to control when deploying runs. The release job keeps the tag check (startsWith(github.ref, 'refs/tags/v')) and has no enable condition of its own: it builds, attaches and writes the declaration.",
1914
+ "releaseIf": "The if of the release job depends on the roles of the repository. A repository with both roles (the line is between # @if deploy+infra) has needs.infra.result != 'failure' && !cancelled() && in front of the tag check, because a skipped infra job (DEPLOY_ENABLED is not true) would skip a downstream job that has no status function, and a failed infra job must still stop it. A repository with only the deploy role has no infra job, so its if has no such part."
1915
+ }
1916
+ }
1648
1917
  }
1649
1918
  ],
1650
1919
  "when": {
@@ -1678,7 +1947,7 @@
1678
1947
  ],
1679
1948
  "order": "In a repository with both roles the release job has needs: infra (the line is between # @if deploy+infra), so the buckets exist before the Workers that bind them go online",
1680
1949
  "credentials": "Only the infra job reads CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. The release job does not",
1681
- "enableCondition": "The infra job has the condition vars.DEPLOY_ENABLED == 'true' in front of its tag checks, for the demo repositories and for a repository just copied from the template, where the variable is unset. A repository in real use removes it, and keeps it only to control when deploying runs. The release job keeps the tag check (startsWith(github.ref, 'refs/tags/v')) and has no enable condition of its own: it builds, attaches and writes the declaration.",
1950
+ "enableCondition": "The infra job has no enable condition in the template. Only a demonstration repository has vars.DEPLOY_ENABLED == 'true' in front of its tag checks, added by compose, and the variable is unset there. A repository in real use does not carry it, and adds one only to control when deploying runs. The release job keeps the tag check (startsWith(github.ref, 'refs/tags/v')) and has no enable condition of its own: it builds, attaches and writes the declaration.",
1682
1951
  "releaseIf": "The if of the release job depends on the roles of the repository. A repository with both roles (the line is between # @if deploy+infra) has needs.infra.result != 'failure' && !cancelled() && in front of the tag check, because a skipped infra job (DEPLOY_ENABLED is not true) would skip a downstream job that has no status function, and a failed infra job must still stop it. A repository with only the deploy role has no infra job, so its if has no such part."
1683
1952
  }
1684
1953
  }
@@ -1817,6 +2086,41 @@
1817
2086
  "prod": "The workflow deploys what is declared. Only deploy-prod.yml writes the prod declaration"
1818
2087
  }
1819
2088
  }
2089
+ },
2090
+ {
2091
+ "since": "0.9.0",
2092
+ "content": {
2093
+ "value": {
2094
+ "file": "ops/.github/workflows/ops-deploy.yml",
2095
+ "role": "ops",
2096
+ "triggers": [
2097
+ "push to main that changes ops/versions.json, ops/versions.lock.json, ops/workloads/**, ops/iac/** or ops/needs.json",
2098
+ "workflow_dispatch with env and units"
2099
+ ],
2100
+ "steps": "scripts/deploy/ops-run.sh: apply-ops.sh puts the declared bundles online, then smoke.sh checks /healthz. Every run aligns every unit that ops/versions.json declares for the environment, because the concurrency group ops-deploy keeps one pending run and cancels the older one, so the units a cancelled run carried go online with the next run; a unit already online with the declared version and hashes is skipped. With --since every environment is aligned, and a unit that has settings in ops/workloads/ but no declared version is reported (\"<env> <unit> 沒有宣告版本,不部署\") and skipped, and when nothing is declared it ends with status 0. With --env the input units is only a hint that is printed",
2101
+ "wrangler": [
2102
+ "wrangler versions upload",
2103
+ "wrangler versions deploy <version id>@100 --env <env>"
2104
+ ],
2105
+ "credentials": "The iac job reads CLOUDFLARE_R2_API_TOKEN (secret, the R2 write permission), CLOUDFLARE_ACCOUNT_ID (variable) and the state backend settings (TOFU_STATE_BUCKET and TOFU_STATE_ENDPOINT as variables, TOFU_STATE_ACCESS_KEY_ID and TOFU_STATE_SECRET_ACCESS_KEY as secrets). The workloads job reads CLOUDFLARE_API_TOKEN (secret, the permission of the Cloudflare template \"Edit Cloudflare Workers\", limited to the one account) and CLOUDFLARE_ACCOUNT_ID. Neither job reads the token of the other",
2106
+ "bundleToken": "The GitHub App token with contents: read on the repositories of the variable BUNDLE_REPOS, when it is set",
2107
+ "sources": [
2108
+ "https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/",
2109
+ "https://developers.cloudflare.com/workers/wrangler/commands/workers/",
2110
+ "https://developers.cloudflare.com/workers/wrangler/system-environment-variables/"
2111
+ ],
2112
+ "readOn": "2026-11-06",
2113
+ "enableCondition": "Neither job has an enable condition in the template. Only a demonstration repository has vars.DEPLOY_ENABLED == 'true' on both, added by compose, and the variable is unset there. A repository in real use does not carry it, and adds one only to control when deploying runs.",
2114
+ "runName": "run-name is `ops-deploy ${{ inputs.env || 'push' }}`: a workflow_dispatch run is named after its env input and a push run is `ops-deploy push`. A run list does not show the inputs of a dispatch, so the deploy gate of the release scripts reads the environment the run aligns from this name",
2115
+ "jobs": [
2116
+ "iac: on a GitHub-hosted runner, applies the iac steps of the environment (scripts/deploy/ops-run.sh --phase iac). It runs the steps in the order of ops/needs.json with apply-iac.sh, which stops before tofu init when a state backend setting is missing",
2117
+ "workloads: needs: iac, on the self-hosted runner, puts the declared bundles online and checks /healthz (scripts/deploy/ops-run.sh --phase workloads)"
2118
+ ],
2119
+ "moduleToken": "When the variable INFRA_MODULES_REPO is set, the iac job makes a GitHub App token for that repository (contents: read) and runs git config url.<base>.insteadOf with it before tofu init, so a main.tf with a git source on the private repository can be cloned",
2120
+ "unverified": "The real run of tofu init and tofu apply (the module fetch, the R2 backend and the provider) was not done. The jobs are tested against the stand-in of tofu in scripts/lib/",
2121
+ "prod": "The workflow deploys what is declared. Only deploy-prod.yml writes the prod declaration"
2122
+ }
2123
+ }
1820
2124
  }
1821
2125
  ],
1822
2126
  "source": {
@@ -1843,7 +2147,7 @@
1843
2147
  "https://developers.cloudflare.com/workers/wrangler/system-environment-variables/"
1844
2148
  ],
1845
2149
  "readOn": "2026-11-06",
1846
- "enableCondition": "Both jobs have the condition vars.DEPLOY_ENABLED == 'true', for the demo repositories and for a repository just copied from the template, where the variable is unset. A repository in real use removes it, and keeps it only to control when deploying runs.",
2150
+ "enableCondition": "Neither job has an enable condition in the template. Only a demonstration repository has vars.DEPLOY_ENABLED == 'true' on both, added by compose, and the variable is unset there. A repository in real use does not carry it, and adds one only to control when deploying runs.",
1847
2151
  "runName": "run-name is `ops-deploy ${{ inputs.env || 'push' }}`: a workflow_dispatch run is named after its env input and a push run is `ops-deploy push`. A run list does not show the inputs of a dispatch, so the deploy gate of the release scripts reads the environment the run aligns from this name",
1848
2152
  "jobs": [
1849
2153
  "iac: on a GitHub-hosted runner, applies the iac steps of the environment (scripts/deploy/ops-run.sh --phase iac). It runs the steps in the order of ops/needs.json with apply-iac.sh, which stops before tofu init when a state backend setting is missing",
@@ -3358,13 +3662,19 @@
3358
3662
  "content": {
3359
3663
  "statement": "預發布 tag `<component>/v<X.Y.Z>-<stage>.<N>` 由 `deploy-prerelease.yml` 部署到政策檔該階段的去處,單元自己的 `targets` 優先於倉庫的 `targets`,單元沒有該階段的去處時略過並寫明原因。範本的 `targets` 是 alpha 到 dev、beta 到 stg、rc 到 stg。ga 由產品 tag `vX.Y.Z` 觸發 `deploy-prod.yml` 統一部署到 prod,逐單元的正式 tag 不部署。預設分支不部署,整合驗證在本機完成,通過才推送。prod 部署失敗時印出回滾指令,由人決定是否執行,不自動回滾。寫入部署目標的 job 帶 `DEPLOY_ENABLED` 判斷,只給示範倉與剛複製的倉,正式使用時移除判斷。有判斷的倉只在 `DEPLOY_ENABLED` 是 `true` 時執行這個 job,其他倉顯示 skipped。"
3360
3664
  }
3665
+ },
3666
+ {
3667
+ "since": "0.9.0",
3668
+ "content": {
3669
+ "statement": "預發布 tag `<component>/v<X.Y.Z>-<stage>.<N>` 由 `deploy-prerelease.yml` 部署到政策檔該階段的去處,單元自己的 `targets` 優先於倉庫的 `targets`,單元沒有該階段的去處時略過並寫明原因。範本的 `targets` 是 alpha 到 dev、beta 到 stg、rc 到 stg。ga 由產品 tag `vX.Y.Z` 觸發 `deploy-prod.yml` 統一部署到 prod,逐單元的正式 tag 不部署。預設分支不部署,整合驗證在本機完成,通過才推送。prod 部署失敗時印出回滾指令,由人決定是否執行,不自動回滾。範本是參考實作,寫入部署目標的 job 不帶判斷。判斷只在示範倉:示範倉的這個 job 帶 `DEPLOY_ENABLED` 判斷,由 compose 加進去,只在 `DEPLOY_ENABLED` 是 `true` 時執行。示範倉不設這個變數,所以這個 job 顯示 skipped。正式使用的倉不帶這個判斷,job 直接執行,要用變數控制是否部署時才自己加。"
3670
+ }
3361
3671
  }
3362
3672
  ],
3363
3673
  "source": {
3364
3674
  "kind": "published"
3365
3675
  },
3366
3676
  "content": {
3367
- "statement": "預發布 tag `<component>/v<X.Y.Z>-<stage>.<N>` 由 `deploy-prerelease.yml` 部署到政策檔該階段的去處,單元自己的 `targets` 優先於倉庫的 `targets`,單元沒有該階段的去處時略過並寫明原因。範本的 `targets` 是 alpha 到 dev、beta 到 stg、rc 到 stg。ga 由產品 tag `vX.Y.Z` 觸發 `deploy-prod.yml` 統一部署到 prod,逐單元的正式 tag 不部署。預設分支不部署,整合驗證在本機完成,通過才推送。prod 部署失敗時印出回滾指令,由人決定是否執行,不自動回滾。寫入部署目標的 job 帶 `DEPLOY_ENABLED` 判斷,只給示範倉與剛複製的倉,正式使用時移除判斷。有判斷的倉只在 `DEPLOY_ENABLED` 是 `true` 時執行這個 job,其他倉顯示 skipped。"
3677
+ "statement": "預發布 tag `<component>/v<X.Y.Z>-<stage>.<N>` 由 `deploy-prerelease.yml` 部署到政策檔該階段的去處,單元自己的 `targets` 優先於倉庫的 `targets`,單元沒有該階段的去處時略過並寫明原因。範本的 `targets` 是 alpha 到 dev、beta 到 stg、rc 到 stg。ga 由產品 tag `vX.Y.Z` 觸發 `deploy-prod.yml` 統一部署到 prod,逐單元的正式 tag 不部署。預設分支不部署,整合驗證在本機完成,通過才推送。prod 部署失敗時印出回滾指令,由人決定是否執行,不自動回滾。範本是參考實作,寫入部署目標的 job 不帶判斷。判斷只在示範倉:示範倉的這個 job 帶 `DEPLOY_ENABLED` 判斷,由 compose 加進去,只在 `DEPLOY_ENABLED` 是 `true` 時執行。示範倉不設這個變數,所以這個 job 顯示 skipped。正式使用的倉不帶這個判斷,job 直接執行,要用變數控制是否部署時才自己加。"
3368
3678
  }
3369
3679
  },
3370
3680
  {
@@ -3832,13 +4142,19 @@
3832
4142
  "content": {
3833
4143
  "statement": "`scripts/setup/git-hooks.sh` 在每次 `pnpm install` 的 `prepare` 執行,把 `core.hooksPath` 設成 `scripts/hooks`(`commit-msg`、`pre-push`),並把 `commit.cleanup` 設成 `scissors`,因為訊息用 `## ` 開頭的段落標題。各模式的行為見 devtool-facts 的 `git.commit-cleanup-modes`。"
3834
4144
  }
4145
+ },
4146
+ {
4147
+ "since": "0.8.0",
4148
+ "content": {
4149
+ "statement": "`scripts/setup/git-hooks.sh` 在每次 `pnpm install` 的 `prepare` 執行,不設倉內的 `core.hooksPath`,因為倉內的值會蓋過機器的全域設定,讓機器上的整組 hook 不跑。它在 `$(git rev-parse --git-common-dir)/hooks`(一般是 `.git/hooks/`,linked worktree 也用這個共用目錄)放 `commit-msg` 與 `pre-push` 兩個轉呼叫檔。轉呼叫檔把同樣的參數與 stdin 交給所在工作樹根的 `scripts/hooks/<name>`,結束碼照它。那支檔不存在或不能執行時略過並以 0 結束。舊版腳本設過倉內的 `core.hooksPath`,腳本只在共用設定裡的值等於 `scripts/hooks` 時移除它。值是別的,或寫在個別 worktree 的設定檔時不動,並印警告說轉呼叫檔會被它蓋住。`.git/hooks/` 已有同名檔時,帶腳本標記的就更新。沒有標記的不覆寫,印出檔名與處理方式並以非零結束。機器設了全域 `core.hooksPath` 時,git 只跑全域那組,全域那組會轉給 `.git/hooks/<name>` 時倉的 hook 才會跑,所以腳本偵測到全域路徑時印一行說明。不在工作樹裡時,例如 bare 倉或解開的壓縮檔,腳本不做任何事。`commit.cleanup` 照舊設成 `scissors`,因為訊息用 `## ` 開頭的段落標題。各模式的行為見 devtool-facts 的 `git.commit-cleanup-modes`。"
4150
+ }
3835
4151
  }
3836
4152
  ],
3837
4153
  "source": {
3838
4154
  "kind": "published"
3839
4155
  },
3840
4156
  "content": {
3841
- "statement": "`scripts/setup/git-hooks.sh` 在每次 `pnpm install` 的 `prepare` 執行,把 `core.hooksPath` 設成 `scripts/hooks`(`commit-msg`、`pre-push`),並把 `commit.cleanup` 設成 `scissors`,因為訊息用 `## ` 開頭的段落標題。各模式的行為見 devtool-facts 的 `git.commit-cleanup-modes`。"
4157
+ "statement": "`scripts/setup/git-hooks.sh` 在每次 `pnpm install` 的 `prepare` 執行,不設倉內的 `core.hooksPath`,因為倉內的值會蓋過機器的全域設定,讓機器上的整組 hook 不跑。它在 `$(git rev-parse --git-common-dir)/hooks`(一般是 `.git/hooks/`,linked worktree 也用這個共用目錄)放 `commit-msg` 與 `pre-push` 兩個轉呼叫檔。轉呼叫檔把同樣的參數與 stdin 交給所在工作樹根的 `scripts/hooks/<name>`,結束碼照它。那支檔不存在或不能執行時略過並以 0 結束。舊版腳本設過倉內的 `core.hooksPath`,腳本只在共用設定裡的值等於 `scripts/hooks` 時移除它。值是別的,或寫在個別 worktree 的設定檔時不動,並印警告說轉呼叫檔會被它蓋住。`.git/hooks/` 已有同名檔時,帶腳本標記的就更新。沒有標記的不覆寫,印出檔名與處理方式並以非零結束。機器設了全域 `core.hooksPath` 時,git 只跑全域那組,全域那組會轉給 `.git/hooks/<name>` 時倉的 hook 才會跑,所以腳本偵測到全域路徑時印一行說明。不在工作樹裡時,例如 bare 倉或解開的壓縮檔,腳本不做任何事。`commit.cleanup` 照舊設成 `scissors`,因為訊息用 `## ` 開頭的段落標題。各模式的行為見 devtool-facts 的 `git.commit-cleanup-modes`。"
3842
4158
  }
3843
4159
  },
3844
4160
  {
@@ -4371,13 +4687,19 @@
4371
4687
  "content": {
4372
4688
  "statement": "套件單元在政策檔 `stages` 記下的每個階段都發布。npm 的 dist-tag 是階段名,ga 才是 `latest`。每個單元的版號必須屬於派送時帶的階段,不符就停下。登記中心上已有的版號略過,匯總套件是例外:已有的版號內容不同時停下,見 `facts-package-publish`。範本的發布 job 帶 `PUBLISH_ENABLED` 判斷,保留給示範倉與剛複製的倉,這些倉的變數不是 `true` 時發布 job 顯示 skipped,不寫登記中心。正式使用的倉移除這個判斷,發布 job 直接執行。只有要用變數控制是否發布時才保留判斷。"
4373
4689
  }
4690
+ },
4691
+ {
4692
+ "since": "0.9.0",
4693
+ "content": {
4694
+ "statement": "套件單元在政策檔 `stages` 記下的每個階段都發布。npm 的 dist-tag 是階段名,ga 才是 `latest`。每個單元的版號必須屬於派送時帶的階段,不符就停下。登記中心上已有的版號略過,匯總套件是例外:已有的版號內容不同時停下,見 `facts-package-publish`。範本是參考實作,發布 job 不帶判斷。判斷只在示範倉:示範倉的發布 job 帶 `PUBLISH_ENABLED` 判斷,由 compose 加進去,變數不是 `true` 時發布 job 顯示 skipped,不寫登記中心。示範倉不設這個變數,所以顯示 skipped。正式使用的倉不帶這個判斷,發布 job 直接執行,要用變數控制是否發布時才自己加。"
4695
+ }
4374
4696
  }
4375
4697
  ],
4376
4698
  "source": {
4377
4699
  "kind": "published"
4378
4700
  },
4379
4701
  "content": {
4380
- "statement": "套件單元在政策檔 `stages` 記下的每個階段都發布。npm 的 dist-tag 是階段名,ga 才是 `latest`。每個單元的版號必須屬於派送時帶的階段,不符就停下。登記中心上已有的版號略過,匯總套件是例外:已有的版號內容不同時停下,見 `facts-package-publish`。範本的發布 job 帶 `PUBLISH_ENABLED` 判斷,保留給示範倉與剛複製的倉,這些倉的變數不是 `true` 時發布 job 顯示 skipped,不寫登記中心。正式使用的倉移除這個判斷,發布 job 直接執行。只有要用變數控制是否發布時才保留判斷。"
4702
+ "statement": "套件單元在政策檔 `stages` 記下的每個階段都發布。npm 的 dist-tag 是階段名,ga 才是 `latest`。每個單元的版號必須屬於派送時帶的階段,不符就停下。登記中心上已有的版號略過,匯總套件是例外:已有的版號內容不同時停下,見 `facts-package-publish`。範本是參考實作,發布 job 不帶判斷。判斷只在示範倉:示範倉的發布 job 帶 `PUBLISH_ENABLED` 判斷,由 compose 加進去,變數不是 `true` 時發布 job 顯示 skipped,不寫登記中心。示範倉不設這個變數,所以顯示 skipped。正式使用的倉不帶這個判斷,發布 job 直接執行,要用變數控制是否發布時才自己加。"
4381
4703
  }
4382
4704
  },
4383
4705
  {
@@ -4543,13 +4865,19 @@
4543
4865
  "content": {
4544
4866
  "statement": "推進階段與 GA 前,腳本在 ci 閘之後核對上一階段的部署。對象是發布分支 manifest 上 apps、services、infra 單元的目前版號,也就是上一階段的 tag。版號不含 `-` 的單元略過,`scripts/deploy/route-tag.sh` 判定沒有部署去處的 tag 也略過。每個 tag 只取最新一筆 deploy-prerelease 的 run,指令是 `gh run list --workflow deploy-prerelease.yml --branch <tag> --limit 1 --json status,conclusion,databaseId`,只有 completed 且 success 放行。最新一筆 completed 但結論不是 success 時,印出 tag、run id 與結論並以非 0 結束。run 還在跑時印「部署還在跑」,沒有 run 時印「尚未派送部署」,tag 還沒建立時印「tag 尚未建立」,三者都以非 0 結束。查詢(含 tag 是否存在、ops-deploy 的 run 與 `ops/versions.json`)碰到暫時性錯誤時先經 `read_retry` 重問,仍失敗才印出 gh 的錯誤並以非 0 結束。deploy-prerelease 通過之後,閘再核對 ops 的部署:用 `gh run list --repo <ops 倉> --workflow ops-deploy.yml --branch <預設分支> --limit 20 --json status,conclusion,databaseId,headSha,event,displayTitle` 列出最近 20 筆 ops-deploy run,由新到舊找「涵蓋這個單元」的 run。涵蓋要兩件事都成立:一是該 run 的 headSha 的 `ops/versions.json`(用 `gh api repos/<ops 倉>/contents/ops/versions.json?ref=<sha>` 讀,同一個 sha 在一次閘內只讀一次)在 `<purpose>/<env>`(不含 `hosts/` 開頭的 key)宣告了這個單元,版號等於 tag 的版號,env 是 `route-tag.sh` 輸出的 `env=`。二是該 run 會對齊那個環境:event 是 push,或 event 是 workflow_dispatch 且 run 名稱是 `ops-deploy <env>`(`ops-deploy.yml` 的 `run-name`,run list 看不到 dispatch 的輸入)。涵蓋的 run 中,已 completed 且結論是 cancelled 的略過,因為 ops-deploy 的 concurrency group 會取消排隊中的舊執行,而每次執行都對齊環境宣告的全部單元,被取消那次的單元由下一次補上。剩下的最新一筆決定結果,不看宣告 commit 的那一筆,因為 monorepo 派送的 run 的 headSha 是派送當下的 main,不一定是宣告 commit,宣告已存在時也不產生 commit。completed 且 success 放行。completed 且 skipped 也放行,因為 ops-deploy 的 job 帶 `vars.DEPLOY_ENABLED == 'true'` 條件,條件不成立時整個 run 是 skipped,代表 ops-deploy 沒啟用,沒有上線可核對。這時閘印出 tag、ops 倉、run id 與「ops-deploy 沒啟用」當原因。skipped 的 run 不當作 cancelled 略過,因為略過它去看更舊的 success,會讓已關掉 ops-deploy 的倉被舊的結果判定。其他結論印 run id 與 `gh run view`,還在跑時印「還在跑」,最近 20 筆沒有涵蓋的 run 或涵蓋的全被取消時印沒有一筆成功套用,並提示 `gh workflow run ops-deploy.yml --repo <ops 倉> -f env=<env>`,都以非 0 結束。ops 倉依序取:環境變數 `OPS_REPO`;沒設時取被推進的倉的倉層變數 `OPS_REPO`,再沒有就取組織層變數 `OPS_REPO`(poly 倉的 `OPS_REPO` 是 repository variable,本機執行沒有環境變數),讀法與 `DEPLOY_ENABLED` 相同,兩個變數共用同一次列表查詢,不為每個單元重查,查詢失敗時印出倉名與錯誤並以非 0 結束;三處都沒有才是被推進的倉自己(monorepo)。這道閘只查一次,不輪詢,等部署跑完由本機入口或人重跑。環境變數 `DEPLOY_GATE=0` 略過這道閘,用於本機演練,`--dry-run` 時也不查。算不出有 apps、services、infra 預發布單元的倉庫,閘不查 gh 直接放行。閘先看被推進的倉的 `.github/workflows/deploy-prerelease.yml`(路徑以倉根目錄為起點)有沒有非註解行寫了 `vars.DEPLOY_ENABLED`。`DEPLOY_ENABLED` 判斷只給示範倉與剛複製範本的倉,正式使用時移除。有判斷的倉沒有啟用部署時,閘也不查 deploy-prerelease 的 run:倉層與組織層的 `DEPLOY_ENABLED` 都沒設成 `true`,倉層的值優先。這時閘印出倉名與變數名當原因,然後放行,deploy-prerelease 與 ops-deploy 的 run 都不查。沒有判斷或檔案不存在的倉,也就是正式使用而移除判斷的倉,部署由 workflow 是否執行決定,閘不讀變數,照常核對 deploy-prerelease 的 run,沒設變數也不放行。閘只讀被推進的倉自己的變數,不讀 ops 倉的。讀變數的 API 回應不是 200 時,印出倉名與錯誤並以非 0 結束,不當作沒啟用。對 ops 倉的呼叫(`gh run list --repo`、`gh api …/contents/ops/versions.json`)用環境變數 `DEPLOY_GATE_OPS_TOKEN` 的權杖,沒設時用 `GH_TOKEN`。advance-release.yml 在倉有 `OPS_REPO` 時另取一個只限 ops 倉、`permission-actions: read`、`permission-contents: read` 的 App 權杖放進它,因為推發布分支的權杖只涵蓋本倉,private 的 ops 倉對它回 404;沒有 `OPS_REPO`(monorepo)時不取,行為照舊。"
4545
4867
  }
4546
- }
4547
- ],
4548
- "source": {
4868
+ },
4869
+ {
4870
+ "since": "0.9.0",
4871
+ "content": {
4872
+ "statement": "推進階段與 GA 前,腳本在 ci 閘之後核對上一階段的部署。對象是發布分支 manifest 上 apps、services、infra 單元的目前版號,也就是上一階段的 tag。版號不含 `-` 的單元略過,`scripts/deploy/route-tag.sh` 判定沒有部署去處的 tag 也略過。每個 tag 只取最新一筆 deploy-prerelease 的 run,指令是 `gh run list --workflow deploy-prerelease.yml --branch <tag> --limit 1 --json status,conclusion,databaseId`,只有 completed 且 success 放行。最新一筆 completed 但結論不是 success 時,印出 tag、run id 與結論並以非 0 結束。run 還在跑時印「部署還在跑」,沒有 run 時印「尚未派送部署」,tag 還沒建立時印「tag 尚未建立」,三者都以非 0 結束。查詢(含 tag 是否存在、ops-deploy 的 run 與 `ops/versions.json`)碰到暫時性錯誤時先經 `read_retry` 重問,仍失敗才印出 gh 的錯誤並以非 0 結束。deploy-prerelease 通過之後,閘再核對 ops 的部署:用 `gh run list --repo <ops 倉> --workflow ops-deploy.yml --branch <預設分支> --limit 20 --json status,conclusion,databaseId,headSha,event,displayTitle` 列出最近 20 筆 ops-deploy run,由新到舊找「涵蓋這個單元」的 run。涵蓋要兩件事都成立:一是該 run 的 headSha 的 `ops/versions.json`(用 `gh api repos/<ops 倉>/contents/ops/versions.json?ref=<sha>` 讀,同一個 sha 在一次閘內只讀一次)在 `<purpose>/<env>`(不含 `hosts/` 開頭的 key)宣告了這個單元,版號等於 tag 的版號,env 是 `route-tag.sh` 輸出的 `env=`。二是該 run 會對齊那個環境:event 是 push,或 event 是 workflow_dispatch 且 run 名稱是 `ops-deploy <env>`(`ops-deploy.yml` 的 `run-name`,run list 看不到 dispatch 的輸入)。涵蓋的 run 中,已 completed 且結論是 cancelled 的略過,因為 ops-deploy 的 concurrency group 會取消排隊中的舊執行,而每次執行都對齊環境宣告的全部單元,被取消那次的單元由下一次補上。剩下的最新一筆決定結果,不看宣告 commit 的那一筆,因為 monorepo 派送的 run 的 headSha 是派送當下的 main,不一定是宣告 commit,宣告已存在時也不產生 commit。completed 且 success 放行。completed 且 skipped 也放行,因為 ops-deploy 的 job 帶 `vars.DEPLOY_ENABLED == 'true'` 條件,條件不成立時整個 run 是 skipped,代表 ops-deploy 沒啟用,沒有上線可核對。這時閘印出 tag、ops 倉、run id 與「ops-deploy 沒啟用」當原因。skipped 的 run 不當作 cancelled 略過,因為略過它去看更舊的 success,會讓已關掉 ops-deploy 的倉被舊的結果判定。其他結論印 run id 與 `gh run view`,還在跑時印「還在跑」,最近 20 筆沒有涵蓋的 run 或涵蓋的全被取消時印沒有一筆成功套用,並提示 `gh workflow run ops-deploy.yml --repo <ops 倉> -f env=<env>`,都以非 0 結束。ops 倉依序取:環境變數 `OPS_REPO`;沒設時取被推進的倉的倉層變數 `OPS_REPO`,再沒有就取組織層變數 `OPS_REPO`(poly 倉的 `OPS_REPO` 是 repository variable,本機執行沒有環境變數),讀法與 `DEPLOY_ENABLED` 相同,兩個變數共用同一次列表查詢,不為每個單元重查,查詢失敗時印出倉名與錯誤並以非 0 結束;三處都沒有才是被推進的倉自己(monorepo)。這道閘只查一次,不輪詢,等部署跑完由本機入口或人重跑。環境變數 `DEPLOY_GATE=0` 略過這道閘,用於本機演練,`--dry-run` 時也不查。算不出有 apps、services、infra 預發布單元的倉庫,閘不查 gh 直接放行。閘先看被推進的倉的 `.github/workflows/deploy-prerelease.yml`(路徑以倉根目錄為起點)有沒有非註解行寫了 `vars.DEPLOY_ENABLED`。範本不帶 `DEPLOY_ENABLED` 判斷,判斷只在示範倉,由 compose 加進去。有判斷的倉沒有啟用部署時,閘也不查 deploy-prerelease 的 run:倉層與組織層的 `DEPLOY_ENABLED` 都沒設成 `true`,倉層的值優先。這時閘印出倉名與變數名當原因,然後放行,deploy-prerelease 與 ops-deploy 的 run 都不查。沒有判斷或檔案不存在的倉,也就是正式使用的倉,部署由 workflow 是否執行決定,閘不讀變數,照常核對 deploy-prerelease 的 run,沒設變數也不放行。閘只讀被推進的倉自己的變數,不讀 ops 倉的。讀變數的 API 回應不是 200 時,印出倉名與錯誤並以非 0 結束,不當作沒啟用。對 ops 倉的呼叫(`gh run list --repo`、`gh api …/contents/ops/versions.json`)用環境變數 `DEPLOY_GATE_OPS_TOKEN` 的權杖,沒設時用 `GH_TOKEN`。advance-release.yml 在倉有 `OPS_REPO` 時另取一個只限 ops 倉、`permission-actions: read`、`permission-contents: read` 的 App 權杖放進它,因為推發布分支的權杖只涵蓋本倉,private 的 ops 倉對它回 404;沒有 `OPS_REPO`(monorepo)時不取,行為照舊。"
4873
+ }
4874
+ }
4875
+ ],
4876
+ "source": {
4549
4877
  "kind": "published"
4550
4878
  },
4551
4879
  "content": {
4552
- "statement": "推進階段與 GA 前,腳本在 ci 閘之後核對上一階段的部署。對象是發布分支 manifest 上 apps、services、infra 單元的目前版號,也就是上一階段的 tag。版號不含 `-` 的單元略過,`scripts/deploy/route-tag.sh` 判定沒有部署去處的 tag 也略過。每個 tag 只取最新一筆 deploy-prerelease 的 run,指令是 `gh run list --workflow deploy-prerelease.yml --branch <tag> --limit 1 --json status,conclusion,databaseId`,只有 completed 且 success 放行。最新一筆 completed 但結論不是 success 時,印出 tag、run id 與結論並以非 0 結束。run 還在跑時印「部署還在跑」,沒有 run 時印「尚未派送部署」,tag 還沒建立時印「tag 尚未建立」,三者都以非 0 結束。查詢(含 tag 是否存在、ops-deploy 的 run 與 `ops/versions.json`)碰到暫時性錯誤時先經 `read_retry` 重問,仍失敗才印出 gh 的錯誤並以非 0 結束。deploy-prerelease 通過之後,閘再核對 ops 的部署:用 `gh run list --repo <ops 倉> --workflow ops-deploy.yml --branch <預設分支> --limit 20 --json status,conclusion,databaseId,headSha,event,displayTitle` 列出最近 20 筆 ops-deploy run,由新到舊找「涵蓋這個單元」的 run。涵蓋要兩件事都成立:一是該 run 的 headSha 的 `ops/versions.json`(用 `gh api repos/<ops 倉>/contents/ops/versions.json?ref=<sha>` 讀,同一個 sha 在一次閘內只讀一次)在 `<purpose>/<env>`(不含 `hosts/` 開頭的 key)宣告了這個單元,版號等於 tag 的版號,env 是 `route-tag.sh` 輸出的 `env=`。二是該 run 會對齊那個環境:event 是 push,或 event 是 workflow_dispatch 且 run 名稱是 `ops-deploy <env>`(`ops-deploy.yml` 的 `run-name`,run list 看不到 dispatch 的輸入)。涵蓋的 run 中,已 completed 且結論是 cancelled 的略過,因為 ops-deploy 的 concurrency group 會取消排隊中的舊執行,而每次執行都對齊環境宣告的全部單元,被取消那次的單元由下一次補上。剩下的最新一筆決定結果,不看宣告 commit 的那一筆,因為 monorepo 派送的 run 的 headSha 是派送當下的 main,不一定是宣告 commit,宣告已存在時也不產生 commit。completed 且 success 放行。completed 且 skipped 也放行,因為 ops-deploy 的 job 帶 `vars.DEPLOY_ENABLED == 'true'` 條件,條件不成立時整個 run 是 skipped,代表 ops-deploy 沒啟用,沒有上線可核對。這時閘印出 tag、ops 倉、run id 與「ops-deploy 沒啟用」當原因。skipped 的 run 不當作 cancelled 略過,因為略過它去看更舊的 success,會讓已關掉 ops-deploy 的倉被舊的結果判定。其他結論印 run id 與 `gh run view`,還在跑時印「還在跑」,最近 20 筆沒有涵蓋的 run 或涵蓋的全被取消時印沒有一筆成功套用,並提示 `gh workflow run ops-deploy.yml --repo <ops 倉> -f env=<env>`,都以非 0 結束。ops 倉依序取:環境變數 `OPS_REPO`;沒設時取被推進的倉的倉層變數 `OPS_REPO`,再沒有就取組織層變數 `OPS_REPO`(poly 倉的 `OPS_REPO` 是 repository variable,本機執行沒有環境變數),讀法與 `DEPLOY_ENABLED` 相同,兩個變數共用同一次列表查詢,不為每個單元重查,查詢失敗時印出倉名與錯誤並以非 0 結束;三處都沒有才是被推進的倉自己(monorepo)。這道閘只查一次,不輪詢,等部署跑完由本機入口或人重跑。環境變數 `DEPLOY_GATE=0` 略過這道閘,用於本機演練,`--dry-run` 時也不查。算不出有 apps、services、infra 預發布單元的倉庫,閘不查 gh 直接放行。閘先看被推進的倉的 `.github/workflows/deploy-prerelease.yml`(路徑以倉根目錄為起點)有沒有非註解行寫了 `vars.DEPLOY_ENABLED`。`DEPLOY_ENABLED` 判斷只給示範倉與剛複製範本的倉,正式使用時移除。有判斷的倉沒有啟用部署時,閘也不查 deploy-prerelease 的 run:倉層與組織層的 `DEPLOY_ENABLED` 都沒設成 `true`,倉層的值優先。這時閘印出倉名與變數名當原因,然後放行,deploy-prerelease 與 ops-deploy 的 run 都不查。沒有判斷或檔案不存在的倉,也就是正式使用而移除判斷的倉,部署由 workflow 是否執行決定,閘不讀變數,照常核對 deploy-prerelease 的 run,沒設變數也不放行。閘只讀被推進的倉自己的變數,不讀 ops 倉的。讀變數的 API 回應不是 200 時,印出倉名與錯誤並以非 0 結束,不當作沒啟用。對 ops 倉的呼叫(`gh run list --repo`、`gh api …/contents/ops/versions.json`)用環境變數 `DEPLOY_GATE_OPS_TOKEN` 的權杖,沒設時用 `GH_TOKEN`。advance-release.yml 在倉有 `OPS_REPO` 時另取一個只限 ops 倉、`permission-actions: read`、`permission-contents: read` 的 App 權杖放進它,因為推發布分支的權杖只涵蓋本倉,private 的 ops 倉對它回 404;沒有 `OPS_REPO`(monorepo)時不取,行為照舊。"
4880
+ "statement": "推進階段與 GA 前,腳本在 ci 閘之後核對上一階段的部署。對象是發布分支 manifest 上 apps、services、infra 單元的目前版號,也就是上一階段的 tag。版號不含 `-` 的單元略過,`scripts/deploy/route-tag.sh` 判定沒有部署去處的 tag 也略過。每個 tag 只取最新一筆 deploy-prerelease 的 run,指令是 `gh run list --workflow deploy-prerelease.yml --branch <tag> --limit 1 --json status,conclusion,databaseId`,只有 completed 且 success 放行。最新一筆 completed 但結論不是 success 時,印出 tag、run id 與結論並以非 0 結束。run 還在跑時印「部署還在跑」,沒有 run 時印「尚未派送部署」,tag 還沒建立時印「tag 尚未建立」,三者都以非 0 結束。查詢(含 tag 是否存在、ops-deploy 的 run 與 `ops/versions.json`)碰到暫時性錯誤時先經 `read_retry` 重問,仍失敗才印出 gh 的錯誤並以非 0 結束。deploy-prerelease 通過之後,閘再核對 ops 的部署:用 `gh run list --repo <ops 倉> --workflow ops-deploy.yml --branch <預設分支> --limit 20 --json status,conclusion,databaseId,headSha,event,displayTitle` 列出最近 20 筆 ops-deploy run,由新到舊找「涵蓋這個單元」的 run。涵蓋要兩件事都成立:一是該 run 的 headSha 的 `ops/versions.json`(用 `gh api repos/<ops 倉>/contents/ops/versions.json?ref=<sha>` 讀,同一個 sha 在一次閘內只讀一次)在 `<purpose>/<env>`(不含 `hosts/` 開頭的 key)宣告了這個單元,版號等於 tag 的版號,env 是 `route-tag.sh` 輸出的 `env=`。二是該 run 會對齊那個環境:event 是 push,或 event 是 workflow_dispatch 且 run 名稱是 `ops-deploy <env>`(`ops-deploy.yml` 的 `run-name`,run list 看不到 dispatch 的輸入)。涵蓋的 run 中,已 completed 且結論是 cancelled 的略過,因為 ops-deploy 的 concurrency group 會取消排隊中的舊執行,而每次執行都對齊環境宣告的全部單元,被取消那次的單元由下一次補上。剩下的最新一筆決定結果,不看宣告 commit 的那一筆,因為 monorepo 派送的 run 的 headSha 是派送當下的 main,不一定是宣告 commit,宣告已存在時也不產生 commit。completed 且 success 放行。completed 且 skipped 也放行,因為 ops-deploy 的 job 帶 `vars.DEPLOY_ENABLED == 'true'` 條件,條件不成立時整個 run 是 skipped,代表 ops-deploy 沒啟用,沒有上線可核對。這時閘印出 tag、ops 倉、run id 與「ops-deploy 沒啟用」當原因。skipped 的 run 不當作 cancelled 略過,因為略過它去看更舊的 success,會讓已關掉 ops-deploy 的倉被舊的結果判定。其他結論印 run id 與 `gh run view`,還在跑時印「還在跑」,最近 20 筆沒有涵蓋的 run 或涵蓋的全被取消時印沒有一筆成功套用,並提示 `gh workflow run ops-deploy.yml --repo <ops 倉> -f env=<env>`,都以非 0 結束。ops 倉依序取:環境變數 `OPS_REPO`;沒設時取被推進的倉的倉層變數 `OPS_REPO`,再沒有就取組織層變數 `OPS_REPO`(poly 倉的 `OPS_REPO` 是 repository variable,本機執行沒有環境變數),讀法與 `DEPLOY_ENABLED` 相同,兩個變數共用同一次列表查詢,不為每個單元重查,查詢失敗時印出倉名與錯誤並以非 0 結束;三處都沒有才是被推進的倉自己(monorepo)。這道閘只查一次,不輪詢,等部署跑完由本機入口或人重跑。環境變數 `DEPLOY_GATE=0` 略過這道閘,用於本機演練,`--dry-run` 時也不查。算不出有 apps、services、infra 預發布單元的倉庫,閘不查 gh 直接放行。閘先看被推進的倉的 `.github/workflows/deploy-prerelease.yml`(路徑以倉根目錄為起點)有沒有非註解行寫了 `vars.DEPLOY_ENABLED`。範本不帶 `DEPLOY_ENABLED` 判斷,判斷只在示範倉,由 compose 加進去。有判斷的倉沒有啟用部署時,閘也不查 deploy-prerelease 的 run:倉層與組織層的 `DEPLOY_ENABLED` 都沒設成 `true`,倉層的值優先。這時閘印出倉名與變數名當原因,然後放行,deploy-prerelease 與 ops-deploy 的 run 都不查。沒有判斷或檔案不存在的倉,也就是正式使用的倉,部署由 workflow 是否執行決定,閘不讀變數,照常核對 deploy-prerelease 的 run,沒設變數也不放行。閘只讀被推進的倉自己的變數,不讀 ops 倉的。讀變數的 API 回應不是 200 時,印出倉名與錯誤並以非 0 結束,不當作沒啟用。對 ops 倉的呼叫(`gh run list --repo`、`gh api …/contents/ops/versions.json`)用環境變數 `DEPLOY_GATE_OPS_TOKEN` 的權杖,沒設時用 `GH_TOKEN`。advance-release.yml 在倉有 `OPS_REPO` 時另取一個只限 ops 倉、`permission-actions: read`、`permission-contents: read` 的 App 權杖放進它,因為推發布分支的權杖只涵蓋本倉,private 的 ops 倉對它回 404;沒有 `OPS_REPO`(monorepo)時不取,行為照舊。"
4553
4881
  }
4554
4882
  },
4555
4883
  {
@@ -7836,7 +8164,7 @@
7836
8164
  "merge"
7837
8165
  ],
7838
8166
  "title": "自動合併 workflow",
7839
- "description": "每個倉都有同一份 `auto-merge.yml`,由 PR 加上 label 與 CI workflow 跑完兩個時機觸發,每次重查最新 commit 的檢查。",
8167
+ "description": "每個倉都跑一個做到本 fact 所列行為的 auto-merge workflow:PR 加上 label 與 CI workflow 跑完時觸發,每次重查最新 commit 的必要檢查,squash 並帶 `--match-head-commit`,不用 `--auto`。",
7840
8168
  "variants": [
7841
8169
  {
7842
8170
  "since": "0.1.0",
@@ -7872,6 +8200,59 @@
7872
8200
  "runName": "The workflow has a run-name `auto-merge <head sha of the pull request>`, quoted as a whole. A run of the workflow_run event has the head commit and branch of the default branch, so its own head sha says nothing about the pull request; the head sha in the name is what tells whose run it is."
7873
8201
  }
7874
8202
  }
8203
+ },
8204
+ {
8205
+ "since": "0.9.0",
8206
+ "content": {
8207
+ "value": {
8208
+ "file": "auto-merge.yml",
8209
+ "rule": "Every repository, private and public alike, runs one auto-merge workflow that does everything this value lists. A repository writes the workflow itself and may take the base role of blueprint-shared-templates as a reference implementation (blueprint-shared.templates.auto-merge); what is checked is the behavior, not that the file equals the template.",
8210
+ "ownWork": "The workflow merges the pull requests that carry the auto-merge label.",
8211
+ "label": "auto-merge",
8212
+ "triggers": [
8213
+ "A pull request gets the auto-merge label (pull_request_target, labeled).",
8214
+ "The CI workflow and the pr-message workflow finish (workflow_run, completed)."
8215
+ ],
8216
+ "runsOnlyWhen": "For the label event, only when the label that was added is the auto-merge label, and the pull request branch does not start with release-please--. For the workflow_run event, only when the run belongs to a pull request and its head branch does not start with release-please--. Any other label, a Release PR, a run on a push to main or a release branch, and a run for a fork take no runner. A CI run that did not succeed still starts the decision, because a job of CI that is not a required check can fail while the required checks pass.",
8217
+ "everyTime": "Each run reads the pull request and the required checks of its latest head commit again. If any check failed or is still running, the run ends and waits for the next trigger.",
8218
+ "requiredChecks": "blueprint-shared.merge.required-checks. A required check that passed or was skipped by scope counts as passed. A required check that does not appear because its workflow has a path filter that no changed file matches counts as skipped.",
8219
+ "merge": "blueprint-shared.merge.method: squash, delete the branch, and --match-head-commit with the head commit the checks were read for. The auto-merge flag of gh pr merge is not used (blueprint-shared.merge.no-platform-auto-merge).",
8220
+ "notHandled": [
8221
+ "a pull request that is not open",
8222
+ "a draft",
8223
+ "a pull request from a fork (blueprint-shared.merge.fork)",
8224
+ "a Release PR, whose decision is skip (blueprint-shared.merge.release-pr)"
8225
+ ],
8226
+ "skipWhen": [
8227
+ "a commit was pushed after the checks were read",
8228
+ "a required check failed or was cancelled",
8229
+ "a required check is still running",
8230
+ "a required check has not run",
8231
+ "the pull request changes a review path, is not a Release PR or a pull request of a kind the repository declares as exempt, and has no approving review or has a review that asks for changes"
8232
+ ],
8233
+ "failedList": "A skip because a required check failed or was cancelled also lists those checks in failed, so a caller can tell a failure from a wait.",
8234
+ "reviewPaths": "A pull request that changes one of the review paths (blueprint-shared.git-flow.review-paths) is skipped until a review approves it and none asks for changes. The platform only enforces CODEOWNERS with branch protection, which a private repository on a plan without branch protection (the GitHub Free plan is one) does not have (blueprint-shared.merge.no-platform-auto-merge), so the decision reads the reviews itself. A repository whose review path list is empty merges its own pull requests without this gate.",
8235
+ "mergeRetry": {
8236
+ "on": "HTTP 405 \"Base branch was modified\": pull requests merged at the same moment into one base can get it for the one that lost the race. Only gh output containing \"Base branch was modified\" is retried; any other error fails at once.",
8237
+ "attempts": 5,
8238
+ "intervalSeconds": 3,
8239
+ "lastAttempt": "The fifth attempt that gets the same error fails the job with the gh exit status.",
8240
+ "source": "Not in the GitHub documentation. Reported by users: ridedott/merge-me-action issue 458, and Zuul (openstack-infra/zuul commit 49bff07) retries after about 2 seconds when it merges at the same moment."
8241
+ },
8242
+ "noChecksYet": {
8243
+ "on": "gh pr checks exits 1 with nothing on stdout and \"no checks reported on the '<branch>' branch\" on stderr, as it does for a pull request that has no check yet (service-facts github gh-pr-checks-exit-status).",
8244
+ "result": "The decision is that a required check has not run (skip), and a later workflow_run looks again.",
8245
+ "otherErrors": "Exit status 1 with an empty stdout and any other stderr (for example the token lacks actions: read), or an exit status other than 0, 1 and 8, fails the step."
8246
+ },
8247
+ "concurrency": {
8248
+ "decide": "One group per pull request, cancel-in-progress true: a newer event of the same pull request reads the checks again, so an older decision still running is cancelled.",
8249
+ "merge": "A separate group per pull request, cancel-in-progress false: a merge is never cancelled halfway."
8250
+ },
8251
+ "sameBranchOnly": "Only a pull request from a branch in the same repository is handled.",
8252
+ "runName": "The workflow has a run-name `auto-merge <head sha of the pull request>`, quoted as a whole. A run of the workflow_run event has the head commit and branch of the default branch, so its own head sha says nothing about the pull request; the head sha in the name is what tells whose run it is.",
8253
+ "token": "blueprint-shared.merge.token"
8254
+ }
8255
+ }
7875
8256
  }
7876
8257
  ],
7877
8258
  "source": {
@@ -7880,16 +8261,51 @@
7880
8261
  "content": {
7881
8262
  "value": {
7882
8263
  "file": "auto-merge.yml",
7883
- "source": "the base role of blueprint-shared-templates, synced into every repository",
7884
- "repositories": "Every repository has the same workflow, private and public alike.",
8264
+ "rule": "Every repository, private and public alike, runs one auto-merge workflow that does everything this value lists. A repository writes the workflow itself and may take the base role of blueprint-shared-templates as a reference implementation (blueprint-shared.templates.auto-merge); what is checked is the behavior, not that the file equals the template.",
7885
8265
  "ownWork": "The workflow merges the pull requests that carry the auto-merge label.",
8266
+ "label": "auto-merge",
7886
8267
  "triggers": [
7887
- "A pull request gets the auto-merge label.",
7888
- "The CI workflow finishes (workflow_run, completed)."
8268
+ "A pull request gets the auto-merge label (pull_request_target, labeled).",
8269
+ "The CI workflow and the pr-message workflow finish (workflow_run, completed)."
8270
+ ],
8271
+ "runsOnlyWhen": "For the label event, only when the label that was added is the auto-merge label, and the pull request branch does not start with release-please--. For the workflow_run event, only when the run belongs to a pull request and its head branch does not start with release-please--. Any other label, a Release PR, a run on a push to main or a release branch, and a run for a fork take no runner. A CI run that did not succeed still starts the decision, because a job of CI that is not a required check can fail while the required checks pass.",
8272
+ "everyTime": "Each run reads the pull request and the required checks of its latest head commit again. If any check failed or is still running, the run ends and waits for the next trigger.",
8273
+ "requiredChecks": "blueprint-shared.merge.required-checks. A required check that passed or was skipped by scope counts as passed. A required check that does not appear because its workflow has a path filter that no changed file matches counts as skipped.",
8274
+ "merge": "blueprint-shared.merge.method: squash, delete the branch, and --match-head-commit with the head commit the checks were read for. The auto-merge flag of gh pr merge is not used (blueprint-shared.merge.no-platform-auto-merge).",
8275
+ "notHandled": [
8276
+ "a pull request that is not open",
8277
+ "a draft",
8278
+ "a pull request from a fork (blueprint-shared.merge.fork)",
8279
+ "a Release PR, whose decision is skip (blueprint-shared.merge.release-pr)"
8280
+ ],
8281
+ "skipWhen": [
8282
+ "a commit was pushed after the checks were read",
8283
+ "a required check failed or was cancelled",
8284
+ "a required check is still running",
8285
+ "a required check has not run",
8286
+ "the pull request changes a review path, is not a Release PR or a pull request of a kind the repository declares as exempt, and has no approving review or has a review that asks for changes"
7889
8287
  ],
7890
- "everyTime": "Each run reads the required checks of the latest head commit of the pull request again. If any check failed or is still running, the run ends and waits for the next trigger.",
8288
+ "failedList": "A skip because a required check failed or was cancelled also lists those checks in failed, so a caller can tell a failure from a wait.",
8289
+ "reviewPaths": "A pull request that changes one of the review paths (blueprint-shared.git-flow.review-paths) is skipped until a review approves it and none asks for changes. The platform only enforces CODEOWNERS with branch protection, which a private repository on a plan without branch protection (the GitHub Free plan is one) does not have (blueprint-shared.merge.no-platform-auto-merge), so the decision reads the reviews itself. A repository whose review path list is empty merges its own pull requests without this gate.",
8290
+ "mergeRetry": {
8291
+ "on": "HTTP 405 \"Base branch was modified\": pull requests merged at the same moment into one base can get it for the one that lost the race. Only gh output containing \"Base branch was modified\" is retried; any other error fails at once.",
8292
+ "attempts": 5,
8293
+ "intervalSeconds": 3,
8294
+ "lastAttempt": "The fifth attempt that gets the same error fails the job with the gh exit status.",
8295
+ "source": "Not in the GitHub documentation. Reported by users: ridedott/merge-me-action issue 458, and Zuul (openstack-infra/zuul commit 49bff07) retries after about 2 seconds when it merges at the same moment."
8296
+ },
8297
+ "noChecksYet": {
8298
+ "on": "gh pr checks exits 1 with nothing on stdout and \"no checks reported on the '<branch>' branch\" on stderr, as it does for a pull request that has no check yet (service-facts github gh-pr-checks-exit-status).",
8299
+ "result": "The decision is that a required check has not run (skip), and a later workflow_run looks again.",
8300
+ "otherErrors": "Exit status 1 with an empty stdout and any other stderr (for example the token lacks actions: read), or an exit status other than 0, 1 and 8, fails the step."
8301
+ },
8302
+ "concurrency": {
8303
+ "decide": "One group per pull request, cancel-in-progress true: a newer event of the same pull request reads the checks again, so an older decision still running is cancelled.",
8304
+ "merge": "A separate group per pull request, cancel-in-progress false: a merge is never cancelled halfway."
8305
+ },
7891
8306
  "sameBranchOnly": "Only a pull request from a branch in the same repository is handled.",
7892
- "runName": "The workflow has a run-name `auto-merge <head sha of the pull request>`, quoted as a whole. A run of the workflow_run event has the head commit and branch of the default branch, so its own head sha says nothing about the pull request; the head sha in the name is what tells whose run it is."
8307
+ "runName": "The workflow has a run-name `auto-merge <head sha of the pull request>`, quoted as a whole. A run of the workflow_run event has the head commit and branch of the default branch, so its own head sha says nothing about the pull request; the head sha in the name is what tells whose run it is.",
8308
+ "token": "blueprint-shared.merge.token"
7893
8309
  }
7894
8310
  }
7895
8311
  },
@@ -8304,6 +8720,59 @@
8304
8720
  }
8305
8721
  }
8306
8722
  }
8723
+ },
8724
+ {
8725
+ "since": "0.8.0",
8726
+ "content": {
8727
+ "value": {
8728
+ "pattern": "<ProductName> or <ProductName><suffix> for a repository of the product layer; its own name for a repository of the organization layer",
8729
+ "suffixes": [
8730
+ "-hub",
8731
+ "-app",
8732
+ "-service",
8733
+ "-pkg",
8734
+ "-ops",
8735
+ "-infra"
8736
+ ],
8737
+ "suffixMeaning": {
8738
+ "-hub": "holds the product version, the Release Plan and the product-level facts and docs of a product split over several repositories",
8739
+ "-app": "deployable front ends and clients",
8740
+ "-service": "deployable back-end services",
8741
+ "-pkg": "packages published to a registry",
8742
+ "-ops": "the configuration repository of the product: declares and applies its cloud resources and workloads, and holds which version runs in each environment",
8743
+ "-infra": "capability interfaces only, see blueprint-shared.naming.unit-name (InfraName). Cloud resources are declared and applied in the -ops repository"
8744
+ },
8745
+ "mirror": {
8746
+ "pattern": "<UnitName>",
8747
+ "meaning": "A public mirror repository that publishes one Go or Swift unit is named after that unit.",
8748
+ "examples": [
8749
+ "acme-sdk-go",
8750
+ "acme-sdk-swift",
8751
+ "orbit-sdk-go"
8752
+ ]
8753
+ },
8754
+ "examples": [
8755
+ "acme",
8756
+ "orbit-hub",
8757
+ "orbit-pkg"
8758
+ ],
8759
+ "layer": {
8760
+ "field": "layer",
8761
+ "values": [
8762
+ "organization",
8763
+ "product"
8764
+ ],
8765
+ "default": "product",
8766
+ "writtenIn": "the entry of the repository in a list of repositories that a naming check reads, and the top-level layer of its release-policy.json",
8767
+ "organization": "A repository of the organization layer belongs to no product: it serves every product. Its name is its own, not a ProductName and not a ProductName with a suffix. The organization layer has any number of repositories, for example a code repository, a configuration repository, and the repository that holds the templates (blueprint-shared.templates.org-role). Their names are not used as a prefix of any unit",
8768
+ "product": "A repository of the product layer is named after the product as the pattern says",
8769
+ "examples": [
8770
+ "fleet",
8771
+ "fleet-config"
8772
+ ]
8773
+ }
8774
+ }
8775
+ }
8307
8776
  }
8308
8777
  ],
8309
8778
  "source": {
@@ -8350,7 +8819,7 @@
8350
8819
  ],
8351
8820
  "default": "product",
8352
8821
  "writtenIn": "the entry of the repository in a list of repositories that a naming check reads, and the top-level layer of its release-policy.json",
8353
- "organization": "A repository of the organization layer belongs to no product: it serves every product. Its name is its own, not a ProductName and not a ProductName with a suffix. The organization layer has a code repository and a configuration repository, and their names are not used as a prefix of any unit",
8822
+ "organization": "A repository of the organization layer belongs to no product: it serves every product. Its name is its own, not a ProductName and not a ProductName with a suffix. The organization layer has any number of repositories, for example a code repository, a configuration repository, and the repository that holds the templates (blueprint-shared.templates.org-role). Their names are not used as a prefix of any unit",
8354
8823
  "product": "A repository of the product layer is named after the product as the pattern says",
8355
8824
  "examples": [
8356
8825
  "fleet",
@@ -8483,6 +8952,180 @@
8483
8952
  }
8484
8953
  }
8485
8954
  }
8955
+ },
8956
+ {
8957
+ "since": "0.8.0",
8958
+ "content": {
8959
+ "value": {
8960
+ "kinds": [
8961
+ "AppName",
8962
+ "ServiceName",
8963
+ "PackageName",
8964
+ "LibName",
8965
+ "InfraName",
8966
+ "OpsName"
8967
+ ],
8968
+ "isUnit": "A unit is something that has its own version. It is a release-please package and a unit of release-policy.json.",
8969
+ "pattern": "<ProductName> or <ProductName>-<part> for a unit marked product; its own name for a unit marked own",
8970
+ "notShortened": "The name is never shortened to the part after the product name: acme-cli, not cli.",
8971
+ "sameAsRepo": "A unit may have the name of its repository.",
8972
+ "examples": [
8973
+ "acme-cli",
8974
+ "acme-js",
8975
+ "orbit-api",
8976
+ "pathwatch"
8977
+ ],
8978
+ "counterExamples": [
8979
+ "cli",
8980
+ "api"
8981
+ ],
8982
+ "shared": {
8983
+ "meaning": "A shared unit is published on its own and shared by several products, so it is not a component of the aggregate package of the repository. Its directory follows blueprint-shared.repo-layout.unit-dirs.",
8984
+ "names": [
8985
+ "<RepoName>-shared-facts",
8986
+ "<RepoName>-shared-docs",
8987
+ "<RepoName>-shared-templates"
8988
+ ],
8989
+ "access": "public",
8990
+ "scope": "The name carries no @<scope>/ prefix, whatever blueprint-shared.naming.scope-prefix gives the other names of the repository.",
8991
+ "examples": [
8992
+ "blueprint-shared-facts",
8993
+ "blueprint-shared-docs",
8994
+ "blueprint-shared-templates"
8995
+ ]
8996
+ },
8997
+ "naming": {
8998
+ "field": "naming",
8999
+ "values": [
9000
+ "product",
9001
+ "own"
9002
+ ],
9003
+ "default": "product",
9004
+ "writtenIn": "the entry of the unit in a list of repositories that a naming check reads",
9005
+ "product": "The unit exists only for one product, so it follows the pattern <ProductName> or <ProductName>-<part>.",
9006
+ "own": "Every other unit takes its own name: a tool that can be used on its own, or a service of the organization that every product uses.",
9007
+ "ownUnique": "An own name equals no ProductName and no other UnitName.",
9008
+ "organizationLayer": "A repository of the organization layer (blueprint-shared.naming.repo-name, field layer) has own units only, a module shared only inside the repository too, because no product name is there to prefix.",
9009
+ "mixed": "One repository may hold both kinds. For example a product monorepo holds <ProductName>-web, <ProductName>-api and a small open-source tool, and the tool takes its own name.",
9010
+ "checkedBy": "scripts/naming/check-names.mjs",
9011
+ "examples": {
9012
+ "product": [
9013
+ "acme-web",
9014
+ "orbit-api"
9015
+ ],
9016
+ "own": [
9017
+ "pathwatch"
9018
+ ]
9019
+ }
9020
+ },
9021
+ "kindMeaning": {
9022
+ "InfraName": "a capability interface in infra/<InfraName>/: the code of other units depends on it, and it stays the same in every environment. It fixes the engine and the way to reach it, see blueprint-shared.infra-layout.capability-interface",
9023
+ "OpsName": "an interface in ops/<OpsName>/ that changes with the environment, for example the address of each environment, used by the code of other units"
9024
+ },
9025
+ "dutyPackages": {
9026
+ "meaning": "The repository that holds the templates (blueprint-shared.templates.org-role) may have packages for its own duties. A package of the duty of showing the templates in demonstration repositories is named <RepoName>-demos-facts (facts) or <RepoName>-demos-docs (docs), and lives in demos/_facts or demos/_docs. The leading underscore keeps the two directories apart from the directory of a demonstration repository in demos/.",
9027
+ "pattern": "<RepoName>-<Duty>-facts and <RepoName>-<Duty>-docs, with <Duty> the duty in kebab-case; the duty demos is the only one written here",
9028
+ "dirs": {
9029
+ "<RepoName>-demos-facts": "demos/_facts",
9030
+ "<RepoName>-demos-docs": "demos/_docs"
9031
+ },
9032
+ "scope": "The @<scope>/ prefix follows blueprint-shared.naming.scope-prefix, like the other names of the repository.",
9033
+ "dependsOn": "They may depend on the packages of the organization layer of the repository and on the shared packages. No package of the organization layer or shared package depends on them.",
9034
+ "notAggregate": "They are packages of their own, not components of the <RepoName>-facts aggregate, which holds no duty of the template holder.",
9035
+ "examples": [
9036
+ "blueprint-demos-facts",
9037
+ "blueprint-demos-docs"
9038
+ ]
9039
+ }
9040
+ }
9041
+ }
9042
+ },
9043
+ {
9044
+ "since": "0.9.0",
9045
+ "content": {
9046
+ "value": {
9047
+ "kinds": [
9048
+ "AppName",
9049
+ "ServiceName",
9050
+ "PackageName",
9051
+ "LibName",
9052
+ "InfraName",
9053
+ "OpsName"
9054
+ ],
9055
+ "isUnit": "A unit is something that has its own version. It is a release-please package and a unit of release-policy.json.",
9056
+ "pattern": "<ProductName> or <ProductName>-<part> for a unit marked product; its own name for a unit marked own",
9057
+ "notShortened": "The name is never shortened to the part after the product name: acme-cli, not cli.",
9058
+ "sameAsRepo": "A unit may have the name of its repository.",
9059
+ "examples": [
9060
+ "acme-cli",
9061
+ "acme-js",
9062
+ "orbit-api",
9063
+ "pathwatch"
9064
+ ],
9065
+ "counterExamples": [
9066
+ "cli",
9067
+ "api"
9068
+ ],
9069
+ "shared": {
9070
+ "meaning": "A shared unit is published on its own so that several products can pin it and read it, so it is not a component of the aggregate package of the repository. blueprint-shared-templates is a public reference implementation and specification, not a source to fetch files from. Its directory follows blueprint-shared.repo-layout.unit-dirs.",
9071
+ "names": [
9072
+ "<RepoName>-shared-facts",
9073
+ "<RepoName>-shared-docs",
9074
+ "<RepoName>-shared-templates"
9075
+ ],
9076
+ "access": "public",
9077
+ "scope": "The name carries no @<scope>/ prefix, whatever blueprint-shared.naming.scope-prefix gives the other names of the repository.",
9078
+ "examples": [
9079
+ "blueprint-shared-facts",
9080
+ "blueprint-shared-docs",
9081
+ "blueprint-shared-templates"
9082
+ ]
9083
+ },
9084
+ "naming": {
9085
+ "field": "naming",
9086
+ "values": [
9087
+ "product",
9088
+ "own"
9089
+ ],
9090
+ "default": "product",
9091
+ "writtenIn": "the entry of the unit in a list of repositories that a naming check reads",
9092
+ "product": "The unit exists only for one product, so it follows the pattern <ProductName> or <ProductName>-<part>.",
9093
+ "own": "Every other unit takes its own name: a tool that can be used on its own, or a service of the organization that every product uses.",
9094
+ "ownUnique": "An own name equals no ProductName and no other UnitName.",
9095
+ "organizationLayer": "A repository of the organization layer (blueprint-shared.naming.repo-name, field layer) has own units only, a module shared only inside the repository too, because no product name is there to prefix.",
9096
+ "mixed": "One repository may hold both kinds. For example a product monorepo holds <ProductName>-web, <ProductName>-api and a small open-source tool, and the tool takes its own name.",
9097
+ "checkedBy": "scripts/naming/check-names.mjs",
9098
+ "examples": {
9099
+ "product": [
9100
+ "acme-web",
9101
+ "orbit-api"
9102
+ ],
9103
+ "own": [
9104
+ "pathwatch"
9105
+ ]
9106
+ }
9107
+ },
9108
+ "kindMeaning": {
9109
+ "InfraName": "a capability interface in infra/<InfraName>/: the code of other units depends on it, and it stays the same in every environment. It fixes the engine and the way to reach it, see blueprint-shared.infra-layout.capability-interface",
9110
+ "OpsName": "an interface in ops/<OpsName>/ that changes with the environment, for example the address of each environment, used by the code of other units"
9111
+ },
9112
+ "dutyPackages": {
9113
+ "meaning": "The repository that holds the templates (blueprint-shared.templates.org-role) may have packages for its own duties. A package of the duty of showing the templates in demonstration repositories is named <RepoName>-demos-facts (facts) or <RepoName>-demos-docs (docs), and lives in demos/_facts or demos/_docs. The leading underscore keeps the two directories apart from the directory of a demonstration repository in demos/.",
9114
+ "pattern": "<RepoName>-<Duty>-facts and <RepoName>-<Duty>-docs, with <Duty> the duty in kebab-case; the duty demos is the only one written here",
9115
+ "dirs": {
9116
+ "<RepoName>-demos-facts": "demos/_facts",
9117
+ "<RepoName>-demos-docs": "demos/_docs"
9118
+ },
9119
+ "scope": "The @<scope>/ prefix follows blueprint-shared.naming.scope-prefix, like the other names of the repository.",
9120
+ "dependsOn": "They may depend on the packages of the organization layer of the repository and on the shared packages. No package of the organization layer or shared package depends on them.",
9121
+ "notAggregate": "They are packages of their own, not components of the <RepoName>-facts aggregate, which holds no duty of the template holder.",
9122
+ "examples": [
9123
+ "blueprint-demos-facts",
9124
+ "blueprint-demos-docs"
9125
+ ]
9126
+ }
9127
+ }
9128
+ }
8486
9129
  }
8487
9130
  ],
8488
9131
  "source": {
@@ -8513,7 +9156,7 @@
8513
9156
  "api"
8514
9157
  ],
8515
9158
  "shared": {
8516
- "meaning": "A shared unit is published on its own and shared by several products, so it is not a component of the aggregate package of the repository. Its directory follows blueprint-shared.repo-layout.unit-dirs.",
9159
+ "meaning": "A shared unit is published on its own so that several products can pin it and read it, so it is not a component of the aggregate package of the repository. blueprint-shared-templates is a public reference implementation and specification, not a source to fetch files from. Its directory follows blueprint-shared.repo-layout.unit-dirs.",
8517
9160
  "names": [
8518
9161
  "<RepoName>-shared-facts",
8519
9162
  "<RepoName>-shared-docs",
@@ -8554,9 +9197,24 @@
8554
9197
  "kindMeaning": {
8555
9198
  "InfraName": "a capability interface in infra/<InfraName>/: the code of other units depends on it, and it stays the same in every environment. It fixes the engine and the way to reach it, see blueprint-shared.infra-layout.capability-interface",
8556
9199
  "OpsName": "an interface in ops/<OpsName>/ that changes with the environment, for example the address of each environment, used by the code of other units"
8557
- }
8558
- }
8559
- }
9200
+ },
9201
+ "dutyPackages": {
9202
+ "meaning": "The repository that holds the templates (blueprint-shared.templates.org-role) may have packages for its own duties. A package of the duty of showing the templates in demonstration repositories is named <RepoName>-demos-facts (facts) or <RepoName>-demos-docs (docs), and lives in demos/_facts or demos/_docs. The leading underscore keeps the two directories apart from the directory of a demonstration repository in demos/.",
9203
+ "pattern": "<RepoName>-<Duty>-facts and <RepoName>-<Duty>-docs, with <Duty> the duty in kebab-case; the duty demos is the only one written here",
9204
+ "dirs": {
9205
+ "<RepoName>-demos-facts": "demos/_facts",
9206
+ "<RepoName>-demos-docs": "demos/_docs"
9207
+ },
9208
+ "scope": "The @<scope>/ prefix follows blueprint-shared.naming.scope-prefix, like the other names of the repository.",
9209
+ "dependsOn": "They may depend on the packages of the organization layer of the repository and on the shared packages. No package of the organization layer or shared package depends on them.",
9210
+ "notAggregate": "They are packages of their own, not components of the <RepoName>-facts aggregate, which holds no duty of the template holder.",
9211
+ "examples": [
9212
+ "blueprint-demos-facts",
9213
+ "blueprint-demos-docs"
9214
+ ]
9215
+ }
9216
+ }
9217
+ }
8560
9218
  },
8561
9219
  {
8562
9220
  "id": "blueprint-shared.naming.component-name",
@@ -8783,6 +9441,26 @@
8783
9441
  "repositoryPrefix": "The aggregate package is named after the repository: its prefix is the RepoName, not a ProductName. A repository of the organization layer, which belongs to no product, names it <RepoName>-facts too."
8784
9442
  }
8785
9443
  }
9444
+ },
9445
+ {
9446
+ "since": "0.8.0",
9447
+ "content": {
9448
+ "value": {
9449
+ "meaning": "The name of the facts aggregate package, the only facts package of the repository that has components to aggregate and is published. A shared facts package with no components to aggregate is published on its own as a single layer (see blueprint-shared.naming.unit-name, shared) and is not an aggregate.",
9450
+ "productRepository": "<RepoName>-facts",
9451
+ "factsRepository": "<SourceTypeName>-facts",
9452
+ "noSuffix": "The aggregate never takes a publish target suffix.",
9453
+ "scope": "see blueprint-shared.naming.scope-prefix",
9454
+ "examples": [
9455
+ "acme-facts",
9456
+ "@my-org/orbit-facts",
9457
+ "orbit-pkg-facts",
9458
+ "@my-org/fleet-facts"
9459
+ ],
9460
+ "repositoryPrefix": "The aggregate package is named after the repository: its prefix is the RepoName, not a ProductName. A repository of the organization layer, which belongs to no product, names it <RepoName>-facts too.",
9461
+ "templateHolderPackages": "The repository that holds the templates names the facts package of its duty of showing the templates <RepoName>-demos-facts, in demos/_facts, and its docs package <RepoName>-demos-docs, in demos/_docs (blueprint-shared.naming.unit-name, dutyPackages). <RepoName>-demos-facts is a facts package of its own and not an aggregate. The <RepoName>-facts aggregate holds the organization values and the repository list only, with the rules of the organization itself."
9462
+ }
9463
+ }
8786
9464
  }
8787
9465
  ],
8788
9466
  "source": {
@@ -8801,7 +9479,8 @@
8801
9479
  "orbit-pkg-facts",
8802
9480
  "@my-org/fleet-facts"
8803
9481
  ],
8804
- "repositoryPrefix": "The aggregate package is named after the repository: its prefix is the RepoName, not a ProductName. A repository of the organization layer, which belongs to no product, names it <RepoName>-facts too."
9482
+ "repositoryPrefix": "The aggregate package is named after the repository: its prefix is the RepoName, not a ProductName. A repository of the organization layer, which belongs to no product, names it <RepoName>-facts too.",
9483
+ "templateHolderPackages": "The repository that holds the templates names the facts package of its duty of showing the templates <RepoName>-demos-facts, in demos/_facts, and its docs package <RepoName>-demos-docs, in demos/_docs (blueprint-shared.naming.unit-name, dutyPackages). <RepoName>-demos-facts is a facts package of its own and not an aggregate. The <RepoName>-facts aggregate holds the organization values and the repository list only, with the rules of the organization itself."
8805
9484
  }
8806
9485
  }
8807
9486
  },
@@ -8913,6 +9592,21 @@
8913
9592
  ]
8914
9593
  }
8915
9594
  }
9595
+ },
9596
+ {
9597
+ "since": "0.8.0",
9598
+ "content": {
9599
+ "value": {
9600
+ "pattern": "<RepoName>-docs",
9601
+ "scope": "see blueprint-shared.naming.scope-prefix: follows the access of the docs unit",
9602
+ "examples": [
9603
+ "@my-org/acme-docs",
9604
+ "@my-org/acme-toolkit-docs",
9605
+ "@my-org/orbit-hub-docs"
9606
+ ],
9607
+ "templateHolderPackages": "The repository that holds the templates has a second docs package for its duty of showing the templates: <RepoName>-demos-docs, in demos/_docs, next to <RepoName>-demos-facts in demos/_facts (blueprint-shared.naming.unit-name, dutyPackages). <RepoName>-docs, in docs/, stays the docs package of the organization layer."
9608
+ }
9609
+ }
8916
9610
  }
8917
9611
  ],
8918
9612
  "source": {
@@ -8926,7 +9620,8 @@
8926
9620
  "@my-org/acme-docs",
8927
9621
  "@my-org/acme-toolkit-docs",
8928
9622
  "@my-org/orbit-hub-docs"
8929
- ]
9623
+ ],
9624
+ "templateHolderPackages": "The repository that holds the templates has a second docs package for its duty of showing the templates: <RepoName>-demos-docs, in demos/_docs, next to <RepoName>-demos-facts in demos/_facts (blueprint-shared.naming.unit-name, dutyPackages). <RepoName>-docs, in docs/, stays the docs package of the organization layer."
8930
9625
  }
8931
9626
  }
8932
9627
  },
@@ -9673,6 +10368,117 @@
9673
10368
  "publishOrder": "The publish-github-packages job needs plan, build and publish, and runs only when none of them failed or was cancelled (a skipped publish, when the run has nothing for npm, PyPI or crates.io, does not stop it). So a private package goes up after the public packages of the same run, because a private package can depend on a public one (a peer dependency on the shared facts, for example) and the other way round cannot happen. A private package published first would not install until the public one is up"
9674
10369
  }
9675
10370
  }
10371
+ },
10372
+ {
10373
+ "since": "0.9.0",
10374
+ "content": {
10375
+ "value": {
10376
+ "file": "publish/.github/workflows/publish.yml",
10377
+ "role": "publish",
10378
+ "triggers": [
10379
+ "workflow_dispatch"
10380
+ ],
10381
+ "inputs": [
10382
+ {
10383
+ "name": "paths",
10384
+ "meaning": "JSON array of released unit paths"
10385
+ },
10386
+ {
10387
+ "name": "stage",
10388
+ "meaning": "alpha, beta, rc or ga; every unit version must belong to it"
10389
+ },
10390
+ {
10391
+ "name": "dry_run",
10392
+ "meaning": "every publishing job prints the commands it would run and writes nothing"
10393
+ }
10394
+ ],
10395
+ "jobs": [
10396
+ {
10397
+ "id": "plan",
10398
+ "runner": "self-hosted",
10399
+ "does": "picks the units to publish and their targets, and runs every check that writes nothing"
10400
+ },
10401
+ {
10402
+ "id": "build",
10403
+ "runner": "self-hosted",
10404
+ "does": "packs npm tarballs and PyPI distributions, verifies the crate, uploads them with retention-days 1",
10405
+ "permissions": {
10406
+ "contents": "read"
10407
+ }
10408
+ },
10409
+ {
10410
+ "id": "publish",
10411
+ "runner": "ubuntu-latest",
10412
+ "does": "Trusted Publishing to npm, PyPI and crates.io from the downloaded artifact",
10413
+ "permissions": {
10414
+ "contents": "read",
10415
+ "id-token": "write"
10416
+ },
10417
+ "secrets": "none"
10418
+ },
10419
+ {
10420
+ "id": "publish-github-packages",
10421
+ "runner": "self-hosted",
10422
+ "does": "packs and publishes the private packages in one job",
10423
+ "permissions": {
10424
+ "contents": "read",
10425
+ "packages": "write"
10426
+ },
10427
+ "token": "GITHUB_TOKEN on the publish step only"
10428
+ },
10429
+ {
10430
+ "id": "mirror",
10431
+ "runner": "self-hosted",
10432
+ "does": "pushes each Go and Swift unit to its mirror repository and tags it",
10433
+ "token": "GitHub App token of blueprint-shared.templates.github-app, narrowed to the mirror repositories, contents: write"
10434
+ }
10435
+ ],
10436
+ "publicRepository": "In a public repository every runner label becomes ubuntu-latest when the repository is composed.",
10437
+ "checkedBy": "the workflow checks of the repository: manual-only, tp-publish, tp-no-secrets and gh-packages",
10438
+ "platformFacts": [
10439
+ "npm.npm-trusted-publishing-runner",
10440
+ "npm.npm-trusted-publishing-caller",
10441
+ "npm.npm-trusted-publishing-workflow-filename",
10442
+ "crates-io.cratesio-trusted-publishing-first-publish"
10443
+ ],
10444
+ "valuesFrom": [
10445
+ "blueprint-shared.publishing.trusted-publishing",
10446
+ "blueprint-shared.publishing.github-packages",
10447
+ "blueprint-shared.publishing.go-swift-mirror",
10448
+ "blueprint-shared.templates.github-app"
10449
+ ],
10450
+ "stepRequirements": [
10451
+ {
10452
+ "step": "rust-lang/crates-io-auth-action",
10453
+ "needs": "id-token: write on the job; the crate already exists on crates.io; the step exposes the token as its output token and revokes it when the job ends (the later step passes it as CARGO_REGISTRY_TOKEN)"
10454
+ },
10455
+ {
10456
+ "step": "npm and PyPI upload",
10457
+ "needs": "id-token: write on the job and no npm or PyPI token; npm CLI 11.5.1 or later"
10458
+ },
10459
+ {
10460
+ "step": "upload to GitHub Packages",
10461
+ "needs": "permissions contents: read and packages: write on the job; NODE_AUTH_TOKEN set to secrets.GITHUB_TOKEN on the upload step only; setup-node with registry-url https://npm.pkg.github.com"
10462
+ },
10463
+ {
10464
+ "step": "actions/create-github-app-token (mirror job)",
10465
+ "needs": "client-id, private-key, owner, repositories (the mirror repositories) and permission-contents: write; the token is revoked when the job ends"
10466
+ }
10467
+ ],
10468
+ "sources": [
10469
+ "https://github.com/rust-lang/crates-io-auth-action",
10470
+ "https://docs.npmjs.com/trusted-publishers",
10471
+ "https://docs.pypi.org/trusted-publishers/using-a-publisher/",
10472
+ "https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions",
10473
+ "https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md",
10474
+ "https://github.com/actions/create-github-app-token"
10475
+ ],
10476
+ "readOn": "2026-11-06",
10477
+ "enableCondition": "The build, publish, publish-github-packages and mirror jobs have only their own plan condition (needs.plan.outputs.tp, github-packages or mirror) in the template. The plan job has none: it only checks and keeps the run from having no job that runs. Only a demonstration repository has vars.PUBLISH_ENABLED == 'true' after the plan condition of each of the four jobs, added by compose, and the variable is unset there so none of these jobs runs. A repository in real use does not carry the condition, and adds one only to control when publishing runs.",
10478
+ "mirrorConcurrency": "The mirror job keeps the concurrency group mirror (one writer at a time, no cancel-in-progress). The group keeps one pending run and cancels an older pending one, so a run can be cancelled before it mirrors its version. The next run makes it up, because mirror-units.sh mirrors every version the mirror lacks, not only the version of its own checkout",
10479
+ "publishOrder": "The publish-github-packages job needs plan, build and publish, and runs only when none of them failed or was cancelled (a skipped publish, when the run has nothing for npm, PyPI or crates.io, does not stop it). So a private package goes up after the public packages of the same run, because a private package can depend on a public one (a peer dependency on the shared facts, for example) and the other way round cannot happen. A private package published first would not install until the public one is up"
10480
+ }
10481
+ }
9676
10482
  }
9677
10483
  ],
9678
10484
  "source": {
@@ -9781,7 +10587,7 @@
9781
10587
  "https://github.com/actions/create-github-app-token"
9782
10588
  ],
9783
10589
  "readOn": "2026-11-06",
9784
- "enableCondition": "The build, publish, publish-github-packages and mirror jobs each have vars.PUBLISH_ENABLED == 'true' after their own plan condition (needs.plan.outputs.tp, github-packages or mirror). The plan job has none: it only checks and keeps the run from having no job that runs. vars.PUBLISH_ENABLED is for the demo repositories and for a repository just copied from the template, where the variable is unset so none of these jobs runs. A repository in real use removes the condition, and keeps it only to control when publishing runs.",
10590
+ "enableCondition": "The build, publish, publish-github-packages and mirror jobs have only their own plan condition (needs.plan.outputs.tp, github-packages or mirror) in the template. The plan job has none: it only checks and keeps the run from having no job that runs. Only a demonstration repository has vars.PUBLISH_ENABLED == 'true' after the plan condition of each of the four jobs, added by compose, and the variable is unset there so none of these jobs runs. A repository in real use does not carry the condition, and adds one only to control when publishing runs.",
9785
10591
  "mirrorConcurrency": "The mirror job keeps the concurrency group mirror (one writer at a time, no cancel-in-progress). The group keeps one pending run and cancels an older pending one, so a run can be cancelled before it mirrors its version. The next run makes it up, because mirror-units.sh mirrors every version the mirror lacks, not only the version of its own checkout",
9786
10592
  "publishOrder": "The publish-github-packages job needs plan, build and publish, and runs only when none of them failed or was cancelled (a skipped publish, when the run has nothing for npm, PyPI or crates.io, does not stop it). So a private package goes up after the public packages of the same run, because a private package can depend on a public one (a peer dependency on the shared facts, for example) and the other way round cannot happen. A private package published first would not install until the public one is up"
9787
10593
  }
@@ -12888,6 +13694,43 @@
12888
13694
  ]
12889
13695
  }
12890
13696
  }
13697
+ },
13698
+ {
13699
+ "since": "0.9.0",
13700
+ "content": {
13701
+ "value": {
13702
+ "file": "pnpm-workspace.yaml",
13703
+ "onlyIn": "pnpm-workspace.yaml",
13704
+ "notIn": "release-policy.json",
13705
+ "key": "minimumReleaseAgeExclude",
13706
+ "required": [
13707
+ {
13708
+ "entry": "@<scope>/*",
13709
+ "derivedFrom": "the scope field of release-policy.json",
13710
+ "whenNoScope": "no such entry"
13711
+ },
13712
+ {
13713
+ "entry": "*-facts",
13714
+ "derivedFrom": "every FactName and MetaFactName ends with -facts (blueprint-shared.naming.fact-name)"
13715
+ },
13716
+ {
13717
+ "entry": "<packageName>",
13718
+ "meaning": "each package the organization publishes without a scope, listed one by one",
13719
+ "listedIn": "unscopedPublicPackages"
13720
+ },
13721
+ {
13722
+ "entry": "blueprint-shared-*",
13723
+ "kind": "shared-packages",
13724
+ "meaning": "the shared packages blueprint-shared-facts, blueprint-shared-docs and blueprint-shared-templates, which a repository that pins them as dependencies installs, so the organization does not list them in expectedExclude. blueprint-shared-templates is a public reference implementation and specification that can be pinned and read, not a source to fetch files from"
13725
+ }
13726
+ ],
13727
+ "checkedBy": "each repository compares its pnpm-workspace.yaml with the entries derived from its release-policy.json and unscopedPublicPackages, with the shared-packages entry, and with expectedExclude when the organization gives it",
13728
+ "orgValues": [
13729
+ "unscopedPublicPackages",
13730
+ "expectedExclude"
13731
+ ]
13732
+ }
13733
+ }
12891
13734
  }
12892
13735
  ],
12893
13736
  "source": {
@@ -12917,7 +13760,7 @@
12917
13760
  {
12918
13761
  "entry": "blueprint-shared-*",
12919
13762
  "kind": "shared-packages",
12920
- "meaning": "the shared packages blueprint-shared-facts, blueprint-shared-docs and blueprint-shared-templates, which every repository that adopts the shared layer installs, so the organization does not list them in expectedExclude"
13763
+ "meaning": "the shared packages blueprint-shared-facts, blueprint-shared-docs and blueprint-shared-templates, which a repository that pins them as dependencies installs, so the organization does not list them in expectedExclude. blueprint-shared-templates is a public reference implementation and specification that can be pinned and read, not a source to fetch files from"
12921
13764
  }
12922
13765
  ],
12923
13766
  "checkedBy": "each repository compares its pnpm-workspace.yaml with the entries derived from its release-policy.json and unscopedPublicPackages, with the shared-packages entry, and with expectedExclude when the organization gives it",
@@ -12935,7 +13778,7 @@
12935
13778
  "templates"
12936
13779
  ],
12937
13780
  "title": "角色與每個角色帶的檔",
12938
- "description": "七個角色各自的目錄、依賴、給哪種倉用,以及 base 與 release 兩個角色帶的檔。其他五個角色的檔見各自的 fact。",
13781
+ "description": "七個角色各自的目錄、依賴、給哪種倉用,以及 base 與 release 兩個角色帶的檔,是各角色規則的參考實作。其他五個角色的檔見各自的 fact。佔位符與 compose 是 blueprint 產生參考實作的做法,倉要符合的是欄位值。",
12939
13782
  "variants": [
12940
13783
  {
12941
13784
  "since": "0.1.0",
@@ -13249,80 +14092,396 @@
13249
14092
  "blueprintRoot": "The repository that holds the templates is not composed from roles, except for the files its own root assembly lists."
13250
14093
  }
13251
14094
  }
13252
- }
13253
- ],
13254
- "source": {
13255
- "kind": "published"
13256
- },
13257
- "content": {
13258
- "value": {
13259
- "rule": "A role is a directory of the templates package. A composed repository gets the files of the roles listed for it, in that order, and a file of the repository itself wins over a role file. The compose script refuses roles that disagree with the repository list or the units.",
13260
- "roles": [
13261
- {
13262
- "role": "base",
13263
- "dir": "base/",
13264
- "needs": [],
13265
- "for": "every repository",
13266
- "carries": "commit and pull request checks, git hooks, CI, the auto-merge workflow, the Issue and pull request templates, the repository settings script, common.sh"
13267
- },
13268
- {
13269
- "role": "release",
13270
- "dir": "release/",
13271
- "needs": [
13272
- "base"
13273
- ],
13274
- "for": "a repository with a release-policy.json (its repository declaration has releasePolicy: true)",
13275
- "carries": "release-please settings and workflow, the release policy and its schema, the release scripts, the facts and docs pin scripts, the nightly workflow"
13276
- },
13277
- {
13278
- "role": "publish",
13279
- "dir": "publish/",
13280
- "needs": [
13281
- "base",
13282
- "release"
13283
- ],
13284
- "for": "a repository that publishes a unit or the facts or docs package",
13285
- "carries": "see blueprint-shared.templates.publish-role"
13286
- },
13287
- {
13288
- "role": "deploy",
13289
- "dir": "deploy/",
13290
- "needs": [
13291
- "base",
13292
- "release"
13293
- ],
13294
- "for": "a repository with a Workers unit: a unit whose stack lang is workers, kind web, service or backend",
13295
- "carries": "see blueprint-shared.templates.deploy-role"
13296
- },
13297
- {
13298
- "role": "ops",
13299
- "dir": "ops/",
13300
- "needs": [
13301
- "base"
13302
- ],
13303
- "for": "the repository that puts the declared bundles online",
13304
- "carries": "see blueprint-shared.templates.ops-role"
13305
- },
13306
- {
13307
- "role": "hub",
13308
- "dir": "hub/",
13309
- "needs": [
13310
- "base",
13311
- "release"
13312
- ],
13313
- "for": "the repository that holds the product version of a product with several repositories",
13314
- "carries": "see blueprint-shared.templates.hub-role"
13315
- },
13316
- {
13317
- "role": "verify",
13318
- "dir": "verify/",
13319
- "needs": [
13320
- "base",
13321
- "release"
13322
- ],
13323
- "for": "the repository that holds the Release Plans of a product that deploys: it checks prod against the Release Plan after a release",
13324
- "carries": "see blueprint-shared.templates.verify-role"
13325
- }
14095
+ },
14096
+ {
14097
+ "since": "0.8.0",
14098
+ "content": {
14099
+ "value": {
14100
+ "rule": "A role is a directory of the templates package. A composed repository gets the files of the roles listed for it, in that order, and a file of the repository itself wins over a role file. The compose script refuses roles that disagree with the repository list or the units.",
14101
+ "roles": [
14102
+ {
14103
+ "role": "base",
14104
+ "dir": "base/",
14105
+ "needs": [],
14106
+ "for": "every repository",
14107
+ "carries": "commit and pull request checks, git hooks, CI, the auto-merge workflow, the Issue and pull request templates, the repository settings script, common.sh"
14108
+ },
14109
+ {
14110
+ "role": "release",
14111
+ "dir": "release/",
14112
+ "needs": [
14113
+ "base"
14114
+ ],
14115
+ "for": "a repository with a release-policy.json (its repository declaration has releasePolicy: true)",
14116
+ "carries": "release-please settings and workflow, the release policy and its schema, the release scripts, the facts and docs pin scripts, the nightly workflow"
14117
+ },
14118
+ {
14119
+ "role": "publish",
14120
+ "dir": "publish/",
14121
+ "needs": [
14122
+ "base",
14123
+ "release"
14124
+ ],
14125
+ "for": "a repository that publishes a unit or the facts or docs package",
14126
+ "carries": "see blueprint-shared.templates.publish-role"
14127
+ },
14128
+ {
14129
+ "role": "deploy",
14130
+ "dir": "deploy/",
14131
+ "needs": [
14132
+ "base",
14133
+ "release"
14134
+ ],
14135
+ "for": "a repository with a Workers unit: a unit whose stack lang is workers, kind web, service or backend",
14136
+ "carries": "see blueprint-shared.templates.deploy-role"
14137
+ },
14138
+ {
14139
+ "role": "ops",
14140
+ "dir": "ops/",
14141
+ "needs": [
14142
+ "base"
14143
+ ],
14144
+ "for": "the repository that puts the declared bundles online",
14145
+ "carries": "see blueprint-shared.templates.ops-role"
14146
+ },
14147
+ {
14148
+ "role": "hub",
14149
+ "dir": "hub/",
14150
+ "needs": [
14151
+ "base",
14152
+ "release"
14153
+ ],
14154
+ "for": "the repository that holds the product version of a product with several repositories",
14155
+ "carries": "see blueprint-shared.templates.hub-role"
14156
+ },
14157
+ {
14158
+ "role": "verify",
14159
+ "dir": "verify/",
14160
+ "needs": [
14161
+ "base",
14162
+ "release"
14163
+ ],
14164
+ "for": "the repository that holds the Release Plans of a product that deploys: it checks prod against the Release Plan after a release",
14165
+ "carries": "see blueprint-shared.templates.verify-role"
14166
+ }
14167
+ ],
14168
+ "files": {
14169
+ "base": [
14170
+ "LICENSE",
14171
+ ".gitignore",
14172
+ ".github/CODEOWNERS.example",
14173
+ ".github/ISSUE_TEMPLATE/bug.yml",
14174
+ ".github/ISSUE_TEMPLATE/feature.yml",
14175
+ ".github/ISSUE_TEMPLATE/hotfix.yml",
14176
+ ".github/PULL_REQUEST_TEMPLATE.md",
14177
+ ".github/actions/setup-workspace/action.yml",
14178
+ ".github/version-control.md",
14179
+ ".github/workflows/auto-merge.yml",
14180
+ ".github/workflows/ci.yml",
14181
+ ".github/workflows/main-commit-check.yml",
14182
+ ".github/workflows/pr-message.yml",
14183
+ ".oxlintrc.json",
14184
+ "releases/release-plan.md",
14185
+ "scripts/ci/affected.sh",
14186
+ "scripts/ci/ai-attribution-list.txt",
14187
+ "scripts/ci/check-commit-body.sh",
14188
+ "scripts/ci/check-main-commits.sh",
14189
+ "scripts/ci/check-pr-title.sh",
14190
+ "scripts/ci/ci-scope.conf",
14191
+ "scripts/ci/ci-scope.sh",
14192
+ "scripts/ci/native-build.sh",
14193
+ "scripts/ci/run-affected.sh",
14194
+ "scripts/ci/run-units.sh",
14195
+ "scripts/hooks/commit-msg",
14196
+ "scripts/hooks/pre-push",
14197
+ "scripts/lib/common.sh",
14198
+ "scripts/merge/decide.mjs",
14199
+ "scripts/setup/git-hooks.sh",
14200
+ "scripts/setup/github-repo-settings.json",
14201
+ "scripts/setup/github-repo-settings.sh"
14202
+ ],
14203
+ "release": [
14204
+ ".github/workflows/advance-release.yml",
14205
+ ".github/workflows/close-release.yml",
14206
+ ".github/workflows/merge-back.yml",
14207
+ ".github/workflows/merge-release-pr.yml",
14208
+ ".github/workflows/nightly.yml",
14209
+ ".github/workflows/open-release-line.yml",
14210
+ ".github/workflows/release-line-finalize.yml",
14211
+ ".github/workflows/release-please.yml",
14212
+ ".github/workflows/sync-release-tools.yml",
14213
+ "release-please-config.json",
14214
+ "release-policy.json",
14215
+ "schemas/release-policy.schema.json",
14216
+ "scripts/ci/branch-exists.sh",
14217
+ "scripts/ci/check-facts-describes.sh",
14218
+ "scripts/ci/check-facts.sh",
14219
+ "scripts/ci/check-release-policy-schema.sh",
14220
+ "scripts/ci/check-release-policy.sh",
14221
+ "scripts/ci/pin-train.sh",
14222
+ "scripts/ci/release-train.sh",
14223
+ "scripts/ci/validate-json-schema.mjs",
14224
+ "scripts/lib/docs.sh",
14225
+ "scripts/lib/facts.sh",
14226
+ "scripts/lib/release-plan.sh",
14227
+ "scripts/lib/release-pr.sh",
14228
+ "scripts/lib/release-stages.sh",
14229
+ "scripts/release/advance-release.sh",
14230
+ "scripts/release/check-trigger-actor.sh",
14231
+ "scripts/release/close-ready.mjs",
14232
+ "scripts/release/close-ready.sh",
14233
+ "scripts/release/cut-release.sh",
14234
+ "scripts/release/dispatch-publish.sh",
14235
+ "scripts/release/ensure-stage-deploys.sh",
14236
+ "scripts/release/finalize-release.sh",
14237
+ "scripts/release/merge-back-ready.sh",
14238
+ "scripts/release/merge-release-pr.sh",
14239
+ "scripts/release/open-release-line.sh",
14240
+ "scripts/release/pin-release-pr.sh",
14241
+ "scripts/release/plan.sh",
14242
+ "scripts/release/product-release-notes.sh",
14243
+ "scripts/release/snapshot.sh",
14244
+ "scripts/release/sync-release-tools.sh",
14245
+ "scripts/release/verify-prod.sh"
14246
+ ]
14247
+ },
14248
+ "otherRoleFiles": "The files of publish, deploy, ops, hub and verify are listed in their own facts (publish-role, deploy-role, ops-role, hub-role, verify-role).",
14249
+ "sameFileInTwoRoles": "A file with the same path in two roles is taken from the later role, so the two have to be the same file (scripts/lib/bundle.sh is the same file in deploy and ops, and scripts/deploy/clone-ops.sh the same file in deploy and hub).",
14250
+ "blueprintRoot": "The repository that holds the templates is also a repository of the organization layer (blueprint-shared.templates.org-role). It is not composed from roles, except for the files its own root assembly lists."
14251
+ }
14252
+ }
14253
+ },
14254
+ {
14255
+ "since": "0.9.0",
14256
+ "content": {
14257
+ "value": {
14258
+ "rule": "A role is a group of rules about the files a repository needs, with a reference implementation in a directory of the templates package. A repository follows the rules of the roles listed for it, and writes its files itself or reads the reference implementation. blueprint assembles its own root and its demonstration repositories from these directories in that order, and a file of the repository itself wins over a role file; its compose script refuses roles that disagree with the repository list or the units. The placeholders and the role blocks of the files are how blueprint generates that reference implementation; a repository has to match the field values (blueprint-shared.templates.fields), not the placeholders or the compose script.",
14259
+ "roles": [
14260
+ {
14261
+ "role": "base",
14262
+ "dir": "base/",
14263
+ "needs": [],
14264
+ "for": "every repository",
14265
+ "carries": "commit and pull request checks, git hooks, CI, the auto-merge workflow, the Issue and pull request templates, the repository settings script, common.sh"
14266
+ },
14267
+ {
14268
+ "role": "release",
14269
+ "dir": "release/",
14270
+ "needs": [
14271
+ "base"
14272
+ ],
14273
+ "for": "a repository with a release-policy.json (its repository declaration has releasePolicy: true)",
14274
+ "carries": "release-please settings and workflow, the release policy and its schema, the release scripts, the facts and docs pin scripts, the nightly workflow"
14275
+ },
14276
+ {
14277
+ "role": "publish",
14278
+ "dir": "publish/",
14279
+ "needs": [
14280
+ "base",
14281
+ "release"
14282
+ ],
14283
+ "for": "a repository that publishes a unit or the facts or docs package",
14284
+ "carries": "see blueprint-shared.templates.publish-role"
14285
+ },
14286
+ {
14287
+ "role": "deploy",
14288
+ "dir": "deploy/",
14289
+ "needs": [
14290
+ "base",
14291
+ "release"
14292
+ ],
14293
+ "for": "a repository with a Workers unit: a unit whose stack lang is workers, kind web, service or backend",
14294
+ "carries": "see blueprint-shared.templates.deploy-role"
14295
+ },
14296
+ {
14297
+ "role": "ops",
14298
+ "dir": "ops/",
14299
+ "needs": [
14300
+ "base"
14301
+ ],
14302
+ "for": "the repository that puts the declared bundles online",
14303
+ "carries": "see blueprint-shared.templates.ops-role"
14304
+ },
14305
+ {
14306
+ "role": "hub",
14307
+ "dir": "hub/",
14308
+ "needs": [
14309
+ "base",
14310
+ "release"
14311
+ ],
14312
+ "for": "the repository that holds the product version of a product with several repositories",
14313
+ "carries": "see blueprint-shared.templates.hub-role"
14314
+ },
14315
+ {
14316
+ "role": "verify",
14317
+ "dir": "verify/",
14318
+ "needs": [
14319
+ "base",
14320
+ "release"
14321
+ ],
14322
+ "for": "the repository that holds the Release Plans of a product that deploys: it checks prod against the Release Plan after a release",
14323
+ "carries": "see blueprint-shared.templates.verify-role"
14324
+ }
14325
+ ],
14326
+ "files": {
14327
+ "base": [
14328
+ "LICENSE",
14329
+ ".gitignore",
14330
+ ".github/CODEOWNERS.example",
14331
+ ".github/ISSUE_TEMPLATE/bug.yml",
14332
+ ".github/ISSUE_TEMPLATE/feature.yml",
14333
+ ".github/ISSUE_TEMPLATE/hotfix.yml",
14334
+ ".github/PULL_REQUEST_TEMPLATE.md",
14335
+ ".github/actions/setup-workspace/action.yml",
14336
+ ".github/version-control.md",
14337
+ ".github/workflows/auto-merge.yml",
14338
+ ".github/workflows/ci.yml",
14339
+ ".github/workflows/main-commit-check.yml",
14340
+ ".github/workflows/pr-message.yml",
14341
+ ".oxlintrc.json",
14342
+ "releases/release-plan.md",
14343
+ "scripts/ci/affected.sh",
14344
+ "scripts/ci/ai-attribution-list.txt",
14345
+ "scripts/ci/check-commit-body.sh",
14346
+ "scripts/ci/check-main-commits.sh",
14347
+ "scripts/ci/check-pr-title.sh",
14348
+ "scripts/ci/ci-scope.conf",
14349
+ "scripts/ci/ci-scope.sh",
14350
+ "scripts/ci/native-build.sh",
14351
+ "scripts/ci/run-affected.sh",
14352
+ "scripts/ci/run-units.sh",
14353
+ "scripts/hooks/commit-msg",
14354
+ "scripts/hooks/pre-push",
14355
+ "scripts/lib/common.sh",
14356
+ "scripts/merge/decide.mjs",
14357
+ "scripts/setup/git-hooks.sh",
14358
+ "scripts/setup/github-repo-settings.json",
14359
+ "scripts/setup/github-repo-settings.sh"
14360
+ ],
14361
+ "release": [
14362
+ ".github/workflows/advance-release.yml",
14363
+ ".github/workflows/close-release.yml",
14364
+ ".github/workflows/merge-back.yml",
14365
+ ".github/workflows/merge-release-pr.yml",
14366
+ ".github/workflows/nightly.yml",
14367
+ ".github/workflows/open-release-line.yml",
14368
+ ".github/workflows/release-line-finalize.yml",
14369
+ ".github/workflows/release-please.yml",
14370
+ ".github/workflows/sync-release-tools.yml",
14371
+ "release-please-config.json",
14372
+ "release-policy.json",
14373
+ "schemas/release-policy.schema.json",
14374
+ "scripts/ci/branch-exists.sh",
14375
+ "scripts/ci/check-facts-describes.sh",
14376
+ "scripts/ci/check-facts.sh",
14377
+ "scripts/ci/check-release-policy-schema.sh",
14378
+ "scripts/ci/check-release-policy.sh",
14379
+ "scripts/ci/pin-train.sh",
14380
+ "scripts/ci/release-train.sh",
14381
+ "scripts/ci/validate-json-schema.mjs",
14382
+ "scripts/lib/docs.sh",
14383
+ "scripts/lib/facts.sh",
14384
+ "scripts/lib/release-plan.sh",
14385
+ "scripts/lib/release-pr.sh",
14386
+ "scripts/lib/release-stages.sh",
14387
+ "scripts/release/advance-release.sh",
14388
+ "scripts/release/check-trigger-actor.sh",
14389
+ "scripts/release/close-ready.mjs",
14390
+ "scripts/release/close-ready.sh",
14391
+ "scripts/release/cut-release.sh",
14392
+ "scripts/release/dispatch-publish.sh",
14393
+ "scripts/release/ensure-stage-deploys.sh",
14394
+ "scripts/release/finalize-release.sh",
14395
+ "scripts/release/merge-back-ready.sh",
14396
+ "scripts/release/merge-release-pr.sh",
14397
+ "scripts/release/open-release-line.sh",
14398
+ "scripts/release/pin-release-pr.sh",
14399
+ "scripts/release/plan.sh",
14400
+ "scripts/release/product-release-notes.sh",
14401
+ "scripts/release/snapshot.sh",
14402
+ "scripts/release/sync-release-tools.sh",
14403
+ "scripts/release/verify-prod.sh"
14404
+ ]
14405
+ },
14406
+ "otherRoleFiles": "The files of publish, deploy, ops, hub and verify are listed in their own facts (publish-role, deploy-role, ops-role, hub-role, verify-role).",
14407
+ "sameFileInTwoRoles": "A file with the same path in two roles is taken from the later role, so the two have to be the same file (scripts/lib/bundle.sh is the same file in deploy and ops, and scripts/deploy/clone-ops.sh the same file in deploy and hub).",
14408
+ "blueprintRoot": "The repository that holds the templates is also a repository of the organization layer (blueprint-shared.templates.org-role). It is not composed from roles, except for the files its own root assembly lists."
14409
+ }
14410
+ }
14411
+ }
14412
+ ],
14413
+ "source": {
14414
+ "kind": "published"
14415
+ },
14416
+ "content": {
14417
+ "value": {
14418
+ "rule": "A role is a group of rules about the files a repository needs, with a reference implementation in a directory of the templates package. A repository follows the rules of the roles listed for it, and writes its files itself or reads the reference implementation. blueprint assembles its own root and its demonstration repositories from these directories in that order, and a file of the repository itself wins over a role file; its compose script refuses roles that disagree with the repository list or the units. The placeholders and the role blocks of the files are how blueprint generates that reference implementation; a repository has to match the field values (blueprint-shared.templates.fields), not the placeholders or the compose script.",
14419
+ "roles": [
14420
+ {
14421
+ "role": "base",
14422
+ "dir": "base/",
14423
+ "needs": [],
14424
+ "for": "every repository",
14425
+ "carries": "commit and pull request checks, git hooks, CI, the auto-merge workflow, the Issue and pull request templates, the repository settings script, common.sh"
14426
+ },
14427
+ {
14428
+ "role": "release",
14429
+ "dir": "release/",
14430
+ "needs": [
14431
+ "base"
14432
+ ],
14433
+ "for": "a repository with a release-policy.json (its repository declaration has releasePolicy: true)",
14434
+ "carries": "release-please settings and workflow, the release policy and its schema, the release scripts, the facts and docs pin scripts, the nightly workflow"
14435
+ },
14436
+ {
14437
+ "role": "publish",
14438
+ "dir": "publish/",
14439
+ "needs": [
14440
+ "base",
14441
+ "release"
14442
+ ],
14443
+ "for": "a repository that publishes a unit or the facts or docs package",
14444
+ "carries": "see blueprint-shared.templates.publish-role"
14445
+ },
14446
+ {
14447
+ "role": "deploy",
14448
+ "dir": "deploy/",
14449
+ "needs": [
14450
+ "base",
14451
+ "release"
14452
+ ],
14453
+ "for": "a repository with a Workers unit: a unit whose stack lang is workers, kind web, service or backend",
14454
+ "carries": "see blueprint-shared.templates.deploy-role"
14455
+ },
14456
+ {
14457
+ "role": "ops",
14458
+ "dir": "ops/",
14459
+ "needs": [
14460
+ "base"
14461
+ ],
14462
+ "for": "the repository that puts the declared bundles online",
14463
+ "carries": "see blueprint-shared.templates.ops-role"
14464
+ },
14465
+ {
14466
+ "role": "hub",
14467
+ "dir": "hub/",
14468
+ "needs": [
14469
+ "base",
14470
+ "release"
14471
+ ],
14472
+ "for": "the repository that holds the product version of a product with several repositories",
14473
+ "carries": "see blueprint-shared.templates.hub-role"
14474
+ },
14475
+ {
14476
+ "role": "verify",
14477
+ "dir": "verify/",
14478
+ "needs": [
14479
+ "base",
14480
+ "release"
14481
+ ],
14482
+ "for": "the repository that holds the Release Plans of a product that deploys: it checks prod against the Release Plan after a release",
14483
+ "carries": "see blueprint-shared.templates.verify-role"
14484
+ }
13326
14485
  ],
13327
14486
  "files": {
13328
14487
  "base": [
@@ -13406,7 +14565,7 @@
13406
14565
  },
13407
14566
  "otherRoleFiles": "The files of publish, deploy, ops, hub and verify are listed in their own facts (publish-role, deploy-role, ops-role, hub-role, verify-role).",
13408
14567
  "sameFileInTwoRoles": "A file with the same path in two roles is taken from the later role, so the two have to be the same file (scripts/lib/bundle.sh is the same file in deploy and ops, and scripts/deploy/clone-ops.sh the same file in deploy and hub).",
13409
- "blueprintRoot": "The repository that holds the templates is not composed from roles, except for the files its own root assembly lists."
14568
+ "blueprintRoot": "The repository that holds the templates is also a repository of the organization layer (blueprint-shared.templates.org-role). It is not composed from roles, except for the files its own root assembly lists."
13410
14569
  }
13411
14570
  }
13412
14571
  },
@@ -13932,34 +15091,112 @@
13932
15091
  "description": "每個倉共用的頂層目錄與檔案,只留用得到的。",
13933
15092
  "variants": [
13934
15093
  {
13935
- "since": "0.1.0",
15094
+ "since": "0.1.0",
15095
+ "content": {
15096
+ "value": {
15097
+ "keep": "A repository keeps only the directories it uses.",
15098
+ "entries": [
15099
+ {
15100
+ "path": "apps/<AppName>/",
15101
+ "holds": "deployable front ends and clients"
15102
+ },
15103
+ {
15104
+ "path": "services/<ServiceName>/",
15105
+ "holds": "deployable back-end services"
15106
+ },
15107
+ {
15108
+ "path": "packages/<PackageName>/",
15109
+ "holds": "packages published to a registry"
15110
+ },
15111
+ {
15112
+ "path": "libs/<LibName>/",
15113
+ "holds": "internal shared libraries"
15114
+ },
15115
+ {
15116
+ "path": "infra/",
15117
+ "holds": "declarations of cloud resources: environments, domains, token scopes; and infra/<InfraName>/, a unit that provides an interface to the units that use it"
15118
+ },
15119
+ {
15120
+ "path": "ops/",
15121
+ "holds": "declarations of which version runs in each environment; and ops/<OpsName>/, a unit that provides an interface (the URL patterns of the environments) to the units that use it"
15122
+ },
15123
+ {
15124
+ "path": "facts/",
15125
+ "holds": "the facts aggregate package at the root, one sub-directory per component package, and facts/<RepoName>-shared-facts, a facts package published on its own and shared by several products"
15126
+ },
15127
+ {
15128
+ "path": "docs/",
15129
+ "holds": "the clarify docs package"
15130
+ },
15131
+ {
15132
+ "path": "templates/",
15133
+ "holds": "the template package published on its own and shared by several products, with its own package.json; the repository that owns the templates keeps them here"
15134
+ },
15135
+ {
15136
+ "path": "releases/",
15137
+ "holds": "Release Plans, only in the repository that holds the product version"
15138
+ },
15139
+ {
15140
+ "path": "scripts/",
15141
+ "holds": "governance scripts synced from the shared templates"
15142
+ },
15143
+ {
15144
+ "path": ".github/workflows/",
15145
+ "holds": "workflows synced from the shared templates"
15146
+ },
15147
+ {
15148
+ "path": "release-please-config.json",
15149
+ "holds": "release-please packages"
15150
+ },
15151
+ {
15152
+ "path": ".release-please-manifest.json",
15153
+ "holds": "released version of each package"
15154
+ },
15155
+ {
15156
+ "path": "release-policy.json",
15157
+ "holds": "the release policy of the repository"
15158
+ },
15159
+ {
15160
+ "path": "package.json",
15161
+ "holds": "the root package"
15162
+ },
15163
+ {
15164
+ "path": "pnpm-workspace.yaml",
15165
+ "holds": "the pnpm workspace"
15166
+ }
15167
+ ]
15168
+ }
15169
+ }
15170
+ },
15171
+ {
15172
+ "since": "0.4.0",
13936
15173
  "content": {
13937
15174
  "value": {
13938
15175
  "keep": "A repository keeps only the directories it uses.",
13939
15176
  "entries": [
13940
15177
  {
13941
15178
  "path": "apps/<AppName>/",
13942
- "holds": "deployable front ends and clients"
15179
+ "holds": "front ends and programs that run at the edge"
13943
15180
  },
13944
15181
  {
13945
15182
  "path": "services/<ServiceName>/",
13946
- "holds": "deployable back-end services"
15183
+ "holds": "long-running programs deployed by a configuration repository"
13947
15184
  },
13948
15185
  {
13949
15186
  "path": "packages/<PackageName>/",
13950
- "holds": "packages published to a registry"
15187
+ "holds": "what is published for others to use at a fixed version and is not run by this repository itself, the building blocks (OpenTofu modules, Ansible roles, charts) included (blueprint-shared.infra-layout.tools)"
13951
15188
  },
13952
15189
  {
13953
15190
  "path": "libs/<LibName>/",
13954
- "holds": "internal shared libraries"
15191
+ "holds": "libraries shared inside the repository; another repository takes them from a registry"
13955
15192
  },
13956
15193
  {
13957
15194
  "path": "infra/",
13958
- "holds": "declarations of cloud resources: environments, domains, token scopes; and infra/<InfraName>/, a unit that provides an interface to the units that use it"
15195
+ "holds": "capability interfaces only: infra/<InfraName>/, an interface that the code of other units depends on and that stays the same in every environment (blueprint-shared.infra-layout.capability-interface). Cloud resources are declared and applied under ops/"
13959
15196
  },
13960
15197
  {
13961
15198
  "path": "ops/",
13962
- "holds": "declarations of which version runs in each environment; and ops/<OpsName>/, a unit that provides an interface (the URL patterns of the environments) to the units that use it"
15199
+ "holds": "the configuration of a configuration repository: targets.json, versions.json, needs.json, iac/ and workloads/ (blueprint-shared.infra-layout.ops-dirs); and ops/<OpsName>/, a unit that provides an interface that changes with the environment (the address of each environment) to the units that use it"
13963
15200
  },
13964
15201
  {
13965
15202
  "path": "facts/",
@@ -14010,7 +15247,7 @@
14010
15247
  }
14011
15248
  },
14012
15249
  {
14013
- "since": "0.4.0",
15250
+ "since": "0.8.0",
14014
15251
  "content": {
14015
15252
  "value": {
14016
15253
  "keep": "A repository keeps only the directories it uses.",
@@ -14045,12 +15282,16 @@
14045
15282
  },
14046
15283
  {
14047
15284
  "path": "docs/",
14048
- "holds": "the clarify docs package"
15285
+ "holds": "the clarify docs package of the repository, <RepoName>-docs"
14049
15286
  },
14050
15287
  {
14051
15288
  "path": "templates/",
14052
15289
  "holds": "the template package published on its own and shared by several products, with its own package.json; the repository that owns the templates keeps them here"
14053
15290
  },
15291
+ {
15292
+ "path": "demos/",
15293
+ "holds": "only in the repository that holds the templates (blueprint-shared.templates.org-role): the files of its duty of showing the templates, one sub-directory per demonstration repository, and the packages of that duty, <RepoName>-demos-facts in demos/_facts and <RepoName>-demos-docs in demos/_docs (blueprint-shared.naming.unit-name, dutyPackages). The names _facts and _docs are those packages and no demonstration repository"
15294
+ },
14054
15295
  {
14055
15296
  "path": "releases/",
14056
15297
  "holds": "Release Plans, only in the repository that holds the product version"
@@ -14086,6 +15327,88 @@
14086
15327
  ]
14087
15328
  }
14088
15329
  }
15330
+ },
15331
+ {
15332
+ "since": "0.9.0",
15333
+ "content": {
15334
+ "value": {
15335
+ "keep": "A repository keeps only the directories it uses.",
15336
+ "entries": [
15337
+ {
15338
+ "path": "apps/<AppName>/",
15339
+ "holds": "front ends and programs that run at the edge"
15340
+ },
15341
+ {
15342
+ "path": "services/<ServiceName>/",
15343
+ "holds": "long-running programs deployed by a configuration repository"
15344
+ },
15345
+ {
15346
+ "path": "packages/<PackageName>/",
15347
+ "holds": "what is published for others to use at a fixed version and is not run by this repository itself, the building blocks (OpenTofu modules, Ansible roles, charts) included (blueprint-shared.infra-layout.tools)"
15348
+ },
15349
+ {
15350
+ "path": "libs/<LibName>/",
15351
+ "holds": "libraries shared inside the repository; another repository takes them from a registry"
15352
+ },
15353
+ {
15354
+ "path": "infra/",
15355
+ "holds": "capability interfaces only: infra/<InfraName>/, an interface that the code of other units depends on and that stays the same in every environment (blueprint-shared.infra-layout.capability-interface). Cloud resources are declared and applied under ops/"
15356
+ },
15357
+ {
15358
+ "path": "ops/",
15359
+ "holds": "the configuration of a configuration repository: targets.json, versions.json, needs.json, iac/ and workloads/ (blueprint-shared.infra-layout.ops-dirs); and ops/<OpsName>/, a unit that provides an interface that changes with the environment (the address of each environment) to the units that use it"
15360
+ },
15361
+ {
15362
+ "path": "facts/",
15363
+ "holds": "the facts aggregate package at the root, one sub-directory per component package, and facts/<RepoName>-shared-facts, a facts package published on its own and shared by several products"
15364
+ },
15365
+ {
15366
+ "path": "docs/",
15367
+ "holds": "the clarify docs package of the repository, <RepoName>-docs"
15368
+ },
15369
+ {
15370
+ "path": "templates/",
15371
+ "holds": "the template package published on its own and shared by several products, with its own package.json; the repository that owns the templates keeps them here"
15372
+ },
15373
+ {
15374
+ "path": "demos/",
15375
+ "holds": "only in the repository that holds the templates (blueprint-shared.templates.org-role): the files of its duty of showing the templates, one sub-directory per demonstration repository, and the packages of that duty, <RepoName>-demos-facts in demos/_facts and <RepoName>-demos-docs in demos/_docs (blueprint-shared.naming.unit-name, dutyPackages). The names _facts and _docs are those packages and no demonstration repository"
15376
+ },
15377
+ {
15378
+ "path": "releases/",
15379
+ "holds": "Release Plans, only in the repository that holds the product version"
15380
+ },
15381
+ {
15382
+ "path": "scripts/",
15383
+ "holds": "governance scripts: commit and pull request checks, release scripts and local hooks (what a repository needs is in blueprint-shared.templates.*)"
15384
+ },
15385
+ {
15386
+ "path": ".github/workflows/",
15387
+ "holds": "the workflows of the repository: CI, auto-merge, release and, where the repository publishes or deploys, publish and deploy"
15388
+ },
15389
+ {
15390
+ "path": "release-please-config.json",
15391
+ "holds": "release-please packages"
15392
+ },
15393
+ {
15394
+ "path": ".release-please-manifest.json",
15395
+ "holds": "released version of each package"
15396
+ },
15397
+ {
15398
+ "path": "release-policy.json",
15399
+ "holds": "the release policy of the repository"
15400
+ },
15401
+ {
15402
+ "path": "package.json",
15403
+ "holds": "the root package"
15404
+ },
15405
+ {
15406
+ "path": "pnpm-workspace.yaml",
15407
+ "holds": "the pnpm workspace"
15408
+ }
15409
+ ]
15410
+ }
15411
+ }
14089
15412
  }
14090
15413
  ],
14091
15414
  "source": {
@@ -14125,23 +15448,27 @@
14125
15448
  },
14126
15449
  {
14127
15450
  "path": "docs/",
14128
- "holds": "the clarify docs package"
15451
+ "holds": "the clarify docs package of the repository, <RepoName>-docs"
14129
15452
  },
14130
15453
  {
14131
15454
  "path": "templates/",
14132
15455
  "holds": "the template package published on its own and shared by several products, with its own package.json; the repository that owns the templates keeps them here"
14133
15456
  },
15457
+ {
15458
+ "path": "demos/",
15459
+ "holds": "only in the repository that holds the templates (blueprint-shared.templates.org-role): the files of its duty of showing the templates, one sub-directory per demonstration repository, and the packages of that duty, <RepoName>-demos-facts in demos/_facts and <RepoName>-demos-docs in demos/_docs (blueprint-shared.naming.unit-name, dutyPackages). The names _facts and _docs are those packages and no demonstration repository"
15460
+ },
14134
15461
  {
14135
15462
  "path": "releases/",
14136
15463
  "holds": "Release Plans, only in the repository that holds the product version"
14137
15464
  },
14138
15465
  {
14139
15466
  "path": "scripts/",
14140
- "holds": "governance scripts synced from the shared templates"
15467
+ "holds": "governance scripts: commit and pull request checks, release scripts and local hooks (what a repository needs is in blueprint-shared.templates.*)"
14141
15468
  },
14142
15469
  {
14143
15470
  "path": ".github/workflows/",
14144
- "holds": "workflows synced from the shared templates"
15471
+ "holds": "the workflows of the repository: CI, auto-merge, release and, where the repository publishes or deploys, publish and deploy"
14145
15472
  },
14146
15473
  {
14147
15474
  "path": "release-please-config.json",
@@ -14412,6 +15739,28 @@
14412
15739
  ]
14413
15740
  }
14414
15741
  }
15742
+ },
15743
+ {
15744
+ "since": "0.9.0",
15745
+ "content": {
15746
+ "value": {
15747
+ "days": 7,
15748
+ "meaning": "The repository-level retention of artifacts and logs is 7 days.",
15749
+ "repositories": "Every repository sets it explicitly, before it first creates artifacts or logs.",
15750
+ "api": "PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention",
15751
+ "setBy": "Any way the repository chooses: the repository settings, a script (the base role of blueprint-shared-templates has one as a reference implementation) or the API above.",
15752
+ "effect": "The setting only applies to what is created afterwards.",
15753
+ "notShorter": "Since 2026-10-01 the same setting also covers workflow runs, checks and commit statuses, so a pull request left longer than the retention loses its CI result and has to run again.",
15754
+ "notSet": [
15755
+ "logs and job summaries",
15756
+ "Actions cache"
15757
+ ],
15758
+ "platformFacts": [
15759
+ "github-actions.artifact-retention-days"
15760
+ ],
15761
+ "checkedBy": "What counts is the value the API above reads back, and it must be 7. How it was set does not matter."
15762
+ }
15763
+ }
14415
15764
  }
14416
15765
  ],
14417
15766
  "source": {
@@ -14423,7 +15772,7 @@
14423
15772
  "meaning": "The repository-level retention of artifacts and logs is 7 days.",
14424
15773
  "repositories": "Every repository sets it explicitly, before it first creates artifacts or logs.",
14425
15774
  "api": "PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention",
14426
- "setBy": "the repository settings script of the base role in blueprint-shared-templates",
15775
+ "setBy": "Any way the repository chooses: the repository settings, a script (the base role of blueprint-shared-templates has one as a reference implementation) or the API above.",
14427
15776
  "effect": "The setting only applies to what is created afterwards.",
14428
15777
  "notShorter": "Since 2026-10-01 the same setting also covers workflow runs, checks and commit statuses, so a pull request left longer than the retention loses its CI result and has to run again.",
14429
15778
  "notSet": [
@@ -14432,7 +15781,8 @@
14432
15781
  ],
14433
15782
  "platformFacts": [
14434
15783
  "github-actions.artifact-retention-days"
14435
- ]
15784
+ ],
15785
+ "checkedBy": "What counts is the value the API above reads back, and it must be 7. How it was set does not matter."
14436
15786
  }
14437
15787
  }
14438
15788
  },
@@ -14443,7 +15793,7 @@
14443
15793
  "retention"
14444
15794
  ],
14445
15795
  "title": "上傳 artifact 的保留天數",
14446
- "description": "每個 `actions/upload-artifact` 步驟都寫明 `retention-days`:Trusted Publishing 的建置 artifact 1 天(只在有 build job 執行的倉產生),其他 artifact 7 天,照範本。",
15796
+ "description": "每個 `actions/upload-artifact` 步驟都寫明 `retention-days`:Trusted Publishing 的建置 artifact 1 天(只在有 build job 執行的倉產生),其他 artifact 7 天。",
14447
15797
  "variants": [
14448
15798
  {
14449
15799
  "since": "0.1.0",
@@ -14468,6 +15818,30 @@
14468
15818
  ]
14469
15819
  }
14470
15820
  }
15821
+ },
15822
+ {
15823
+ "since": "0.9.0",
15824
+ "content": {
15825
+ "value": {
15826
+ "appliesTo": "every actions/upload-artifact step",
15827
+ "retentionDays": [
15828
+ {
15829
+ "artifact": "trusted-publishing-build",
15830
+ "days": 1,
15831
+ "meaning": "the build artifact of a Trusted Publishing release, downloaded only by the separate publish job of the same run. It exists only where the build job runs. A demonstration repository has a PUBLISH_ENABLED condition on the build job, added by compose, and leaves the variable unset, so the job does not run there. A repository in real use has no such condition"
15832
+ },
15833
+ {
15834
+ "artifact": "other",
15835
+ "days": 7,
15836
+ "meaning": "every other uploaded artifact"
15837
+ }
15838
+ ],
15839
+ "checkedBy": "A CI check scans the workflows and rejects an upload-artifact step without retention-days.",
15840
+ "platformFacts": [
15841
+ "github-actions.artifact-retention-days"
15842
+ ]
15843
+ }
15844
+ }
14471
15845
  }
14472
15846
  ],
14473
15847
  "source": {
@@ -14480,7 +15854,7 @@
14480
15854
  {
14481
15855
  "artifact": "trusted-publishing-build",
14482
15856
  "days": 1,
14483
- "meaning": "the build artifact of a Trusted Publishing release, downloaded only by the separate publish job of the same run. It exists only where the build job runs. The template gives the build job a PUBLISH_ENABLED condition only for the demonstration repositories and a repository just copied from them. A repository in real use removes the condition"
15857
+ "meaning": "the build artifact of a Trusted Publishing release, downloaded only by the separate publish job of the same run. It exists only where the build job runs. A demonstration repository has a PUBLISH_ENABLED condition on the build job, added by compose, and leaves the variable unset, so the job does not run there. A repository in real use has no such condition"
14484
15858
  },
14485
15859
  {
14486
15860
  "artifact": "other",
@@ -14517,6 +15891,20 @@
14517
15891
  "cleanedBy": "blueprint-shared.templates.private-package-cleanup"
14518
15892
  }
14519
15893
  }
15894
+ },
15895
+ {
15896
+ "since": "0.9.0",
15897
+ "content": {
15898
+ "value": {
15899
+ "rule": "Each private package keeps its latest GA version and every prerelease newer than it. Every older GA version and every prerelease older than the latest GA are deleted.",
15900
+ "when": "When the cleanup script of the publish role runs against a repository that publishes private packages, which is a repository where the publish jobs run. A demonstration repository has a PUBLISH_ENABLED condition on the publish jobs, added by compose, and leaves the variable unset, so they do not run there. A repository in real use has no such condition.",
15901
+ "noGaVersion": "A package with no GA version keeps every version.",
15902
+ "exceptions": "None. A version that a repository still references is deleted like any other older version.",
15903
+ "restore": "A deleted version can be restored within 30 days.",
15904
+ "patchReleases": "A patch starts from the latest product tag, so it never uses an older version.",
15905
+ "cleanedBy": "blueprint-shared.templates.private-package-cleanup"
15906
+ }
15907
+ }
14520
15908
  }
14521
15909
  ],
14522
15910
  "source": {
@@ -14525,7 +15913,7 @@
14525
15913
  "content": {
14526
15914
  "value": {
14527
15915
  "rule": "Each private package keeps its latest GA version and every prerelease newer than it. Every older GA version and every prerelease older than the latest GA are deleted.",
14528
- "when": "When the cleanup script of the publish role runs against a repository that publishes private packages, which is a repository where the publish jobs run. The template gives the publish jobs a PUBLISH_ENABLED condition only for the demonstration repositories and a repository just copied from them. A repository in real use removes the condition.",
15916
+ "when": "When the cleanup script of the publish role runs against a repository that publishes private packages, which is a repository where the publish jobs run. A demonstration repository has a PUBLISH_ENABLED condition on the publish jobs, added by compose, and leaves the variable unset, so they do not run there. A repository in real use has no such condition.",
14529
15917
  "noGaVersion": "A package with no GA version keeps every version.",
14530
15918
  "exceptions": "None. A version that a repository still references is deleted like any other older version.",
14531
15919
  "restore": "A deleted version can be restored within 30 days.",
@@ -15070,18 +16458,246 @@
15070
16458
  "kind": "published"
15071
16459
  },
15072
16460
  "content": {
15073
- "value": {
15074
- "dir": "ops/workloads/templates/",
15075
- "environments": [
15076
- "dev",
15077
- "stg",
15078
- "prod"
15079
- ],
15080
- "filePattern": "^ops/workloads/templates/(dev|stg|prod)/(_org|(?!shared(?![a-z0-9-]))[a-z0-9][a-z0-9-]*)/(_shared|(?!shared(?![a-z0-9-]))[a-z0-9][a-z0-9-]*)\\.yml$",
15081
- "form": "ops/workloads/templates/<environment>/<product>/<unit>.yml",
15082
- "mapping": "The <environment> directory is dev, stg or prod only, and it decides which instance the CI writes to. The template path is what follows <environment>/ with the .yml removed, put after <namespace>/templates/ in that instance. The namespace is the organization that owns the configuration repository.",
15083
- "computedBy": "CI works the instance and the path out from the file position, so nobody writes either twice. A directory that is not dev, stg or prod, including shared, is not a template file.",
15084
- "why": "A template mixes config values with references to secrets, so it sits under workloads/ (blueprint-shared.infra-layout.ops-dirs). templates is the name of this directory, so it is not used as a purpose name under workloads/."
16461
+ "value": {
16462
+ "dir": "ops/workloads/templates/",
16463
+ "environments": [
16464
+ "dev",
16465
+ "stg",
16466
+ "prod"
16467
+ ],
16468
+ "filePattern": "^ops/workloads/templates/(dev|stg|prod)/(_org|(?!shared(?![a-z0-9-]))[a-z0-9][a-z0-9-]*)/(_shared|(?!shared(?![a-z0-9-]))[a-z0-9][a-z0-9-]*)\\.yml$",
16469
+ "form": "ops/workloads/templates/<environment>/<product>/<unit>.yml",
16470
+ "mapping": "The <environment> directory is dev, stg or prod only, and it decides which instance the CI writes to. The template path is what follows <environment>/ with the .yml removed, put after <namespace>/templates/ in that instance. The namespace is the organization that owns the configuration repository.",
16471
+ "computedBy": "CI works the instance and the path out from the file position, so nobody writes either twice. A directory that is not dev, stg or prod, including shared, is not a template file.",
16472
+ "why": "A template mixes config values with references to secrets, so it sits under workloads/ (blueprint-shared.infra-layout.ops-dirs). templates is the name of this directory, so it is not used as a purpose name under workloads/."
16473
+ }
16474
+ }
16475
+ },
16476
+ {
16477
+ "id": "blueprint-shared.secrets.secret-list-location",
16478
+ "tool": "blueprint-shared",
16479
+ "topics": [
16480
+ "secrets"
16481
+ ],
16482
+ "title": "組態倉裡密鑰清單的位置與同步",
16483
+ "description": "每條密鑰路徑在組態倉的密鑰清單宣告一次,清單放 `ops/workloads/secrets/<環境>/<產品>/<單元>.yml`,一個單元一份。`<環境>` 決定寫進哪個實例,`<環境>/` 之後的位置去掉 `.yml` 是 `kv/<產品>/<單元>/`,檔案裡的 key 是最後一段 `<名稱>`,所以路徑不寫兩次。模板只能引用清單宣告過的路徑與欄位。CI 把清單寫進 KV v2 的 `custom_metadata`,key 和清單欄位同名,`fields` 用逗號連成一個字串,每個值最長 512 字元。說明只寫用途與負責人,不寫密鑰內容。同步的規則寫在 `sync`:CI 不碰 `kv/data`、整份寫入帶 `metadata_cas`、不刪 metadata。`filePattern` 是可機讀的檔案位置規則。",
16484
+ "variants": [
16485
+ {
16486
+ "since": "0.9.0",
16487
+ "content": {
16488
+ "value": {
16489
+ "dir": "ops/workloads/secrets/",
16490
+ "environments": [
16491
+ "dev",
16492
+ "stg",
16493
+ "prod"
16494
+ ],
16495
+ "filePattern": "^ops/workloads/secrets/(dev|stg|prod)/(_org|(?!shared(?![a-z0-9-]))[a-z0-9][a-z0-9-]*)/(_shared|(?!shared(?![a-z0-9-]))[a-z0-9][a-z0-9-]*)\\.yml$",
16496
+ "form": "ops/workloads/secrets/<environment>/<product>/<unit>.yml",
16497
+ "mapping": "One file for each unit in each environment. The <environment> directory is dev, stg or prod only, and it decides which instance the list is written to. What follows <environment>/ with the .yml removed is the product and unit segments of the KV path, kv/<product>/<unit>/, and each key of the file is the last segment, <name>. A path is therefore never written twice.",
16498
+ "computedBy": "CI works the instance and the path out from the file position. A directory that is not dev, stg or prod, including shared, is not a list file.",
16499
+ "declares": "Every KV path is declared once in the list of its environment, with its field names, what it is for and who answers for it, and never a value (blueprint-shared.secrets.secret-list-file). A person writes only the value.",
16500
+ "templates": "A template may reference only a path, and a field of it, that the list of the same environment declares (blueprint-shared.secrets.template-file).",
16501
+ "customMetadata": {
16502
+ "where": "The custom_metadata of the KV v2 metadata of the path, in the instance of the environment.",
16503
+ "keys": [
16504
+ "fields",
16505
+ "purpose",
16506
+ "owner",
16507
+ "source",
16508
+ "rotation"
16509
+ ],
16510
+ "naming": "Each key has the name of the list field it comes from. An optional field that the list leaves out is not written.",
16511
+ "fields": "fields is stored as one string, the field names joined by commas, because a field name holds no comma.",
16512
+ "limits": {
16513
+ "maxKeys": 64,
16514
+ "maxKeyLength": 128,
16515
+ "maxValueLength": 512,
16516
+ "rule": "These are the limits of the secret service, so each value written is at most 512 characters, fields included after the join."
16517
+ },
16518
+ "content": "Only what the secret is for and who answers for it is written. A role that can read a value gets custom_metadata in the same response, so nothing of the secret itself goes into it."
16519
+ },
16520
+ "sync": [
16521
+ "The sync subcommand of the CLI, run by the CI of the configuration repository, writes the list into custom_metadata. It never touches kv/data, so it cannot read a value and no value enters the state (blueprint-shared.secrets.metadata-access).",
16522
+ "On a pull request it compares the list with the instance and prints the paths it would add, update or remove. It blocks when a template references a path or a field that the list does not declare, or a path that has no value yet in that environment, which it tells by the number of versions.",
16523
+ "After the merge a new path gets its metadata and is shown as waiting for a value until a person writes one.",
16524
+ "A changed description is written with POST carrying the whole custom_metadata and metadata_cas set to the current_metadata_version it last read, because POST replaces custom_metadata as a whole and PATCH is a merge-patch. The write fails when someone changed the metadata in between.",
16525
+ "When the description in the instance differs from the previous version of the list, it stops and reports instead of overwriting.",
16526
+ "A path removed from the list keeps its metadata. The sync lists it as declared removed, with the number of versions it still has, and a person deletes it.",
16527
+ "A path that the list does not declare is listed in the preview and in the result, and does not block the merge."
16528
+ ]
16529
+ }
16530
+ }
16531
+ }
16532
+ ],
16533
+ "source": {
16534
+ "kind": "published"
16535
+ },
16536
+ "content": {
16537
+ "value": {
16538
+ "dir": "ops/workloads/secrets/",
16539
+ "environments": [
16540
+ "dev",
16541
+ "stg",
16542
+ "prod"
16543
+ ],
16544
+ "filePattern": "^ops/workloads/secrets/(dev|stg|prod)/(_org|(?!shared(?![a-z0-9-]))[a-z0-9][a-z0-9-]*)/(_shared|(?!shared(?![a-z0-9-]))[a-z0-9][a-z0-9-]*)\\.yml$",
16545
+ "form": "ops/workloads/secrets/<environment>/<product>/<unit>.yml",
16546
+ "mapping": "One file for each unit in each environment. The <environment> directory is dev, stg or prod only, and it decides which instance the list is written to. What follows <environment>/ with the .yml removed is the product and unit segments of the KV path, kv/<product>/<unit>/, and each key of the file is the last segment, <name>. A path is therefore never written twice.",
16547
+ "computedBy": "CI works the instance and the path out from the file position. A directory that is not dev, stg or prod, including shared, is not a list file.",
16548
+ "declares": "Every KV path is declared once in the list of its environment, with its field names, what it is for and who answers for it, and never a value (blueprint-shared.secrets.secret-list-file). A person writes only the value.",
16549
+ "templates": "A template may reference only a path, and a field of it, that the list of the same environment declares (blueprint-shared.secrets.template-file).",
16550
+ "customMetadata": {
16551
+ "where": "The custom_metadata of the KV v2 metadata of the path, in the instance of the environment.",
16552
+ "keys": [
16553
+ "fields",
16554
+ "purpose",
16555
+ "owner",
16556
+ "source",
16557
+ "rotation"
16558
+ ],
16559
+ "naming": "Each key has the name of the list field it comes from. An optional field that the list leaves out is not written.",
16560
+ "fields": "fields is stored as one string, the field names joined by commas, because a field name holds no comma.",
16561
+ "limits": {
16562
+ "maxKeys": 64,
16563
+ "maxKeyLength": 128,
16564
+ "maxValueLength": 512,
16565
+ "rule": "These are the limits of the secret service, so each value written is at most 512 characters, fields included after the join."
16566
+ },
16567
+ "content": "Only what the secret is for and who answers for it is written. A role that can read a value gets custom_metadata in the same response, so nothing of the secret itself goes into it."
16568
+ },
16569
+ "sync": [
16570
+ "The sync subcommand of the CLI, run by the CI of the configuration repository, writes the list into custom_metadata. It never touches kv/data, so it cannot read a value and no value enters the state (blueprint-shared.secrets.metadata-access).",
16571
+ "On a pull request it compares the list with the instance and prints the paths it would add, update or remove. It blocks when a template references a path or a field that the list does not declare, or a path that has no value yet in that environment, which it tells by the number of versions.",
16572
+ "After the merge a new path gets its metadata and is shown as waiting for a value until a person writes one.",
16573
+ "A changed description is written with POST carrying the whole custom_metadata and metadata_cas set to the current_metadata_version it last read, because POST replaces custom_metadata as a whole and PATCH is a merge-patch. The write fails when someone changed the metadata in between.",
16574
+ "When the description in the instance differs from the previous version of the list, it stops and reports instead of overwriting.",
16575
+ "A path removed from the list keeps its metadata. The sync lists it as declared removed, with the number of versions it still has, and a person deletes it.",
16576
+ "A path that the list does not declare is listed in the preview and in the result, and does not block the merge."
16577
+ ]
16578
+ }
16579
+ }
16580
+ },
16581
+ {
16582
+ "id": "blueprint-shared.secrets.secret-list-file",
16583
+ "tool": "blueprint-shared",
16584
+ "topics": [
16585
+ "secrets"
16586
+ ],
16587
+ "title": "密鑰清單的格式",
16588
+ "description": "清單檔的每個 key 是 KV 路徑的最後一段 `<名稱>`。每條必填 `fields`(欄位名清單,不含值)、`purpose`(密鑰本身的用途)、`owner`(負責人),選填 `source`(值從哪裡來)與 `rotation`(輪替週期,寫天數如 `90d`)。字串欄位最長 512 字元,因為會原樣寫進 `custom_metadata`。",
16589
+ "variants": [
16590
+ {
16591
+ "since": "0.9.0",
16592
+ "content": {
16593
+ "schema": {
16594
+ "description": "The secret list of one unit in one environment, kept in the configuration repository. Each key is the last segment <name> of a KV path, and the file position gives the rest (blueprint-shared.secrets.secret-list-location). It holds field names and descriptions, never a value.",
16595
+ "type": "object",
16596
+ "propertyNames": {
16597
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
16598
+ },
16599
+ "additionalProperties": {
16600
+ "type": "object",
16601
+ "required": [
16602
+ "fields",
16603
+ "purpose",
16604
+ "owner"
16605
+ ],
16606
+ "additionalProperties": false,
16607
+ "properties": {
16608
+ "fields": {
16609
+ "type": "array",
16610
+ "minItems": 1,
16611
+ "uniqueItems": true,
16612
+ "items": {
16613
+ "type": "string",
16614
+ "pattern": "^[A-Za-z0-9_.-]+$"
16615
+ },
16616
+ "description": "the names of the fields that the path holds, never their values. Stored in custom_metadata as one string, joined by commas, of at most 512 characters"
16617
+ },
16618
+ "purpose": {
16619
+ "type": "string",
16620
+ "minLength": 1,
16621
+ "maxLength": 512,
16622
+ "description": "what the secret itself is for"
16623
+ },
16624
+ "owner": {
16625
+ "type": "string",
16626
+ "minLength": 1,
16627
+ "maxLength": 512,
16628
+ "description": "who answers for the secret"
16629
+ },
16630
+ "source": {
16631
+ "type": "string",
16632
+ "minLength": 1,
16633
+ "maxLength": 512,
16634
+ "description": "optional: where the value comes from, for example who issues it"
16635
+ },
16636
+ "rotation": {
16637
+ "type": "string",
16638
+ "pattern": "^[1-9][0-9]*d$",
16639
+ "description": "optional: how often the value is replaced, in days, for example 90d"
16640
+ }
16641
+ }
16642
+ }
16643
+ }
16644
+ }
16645
+ }
16646
+ ],
16647
+ "source": {
16648
+ "kind": "published"
16649
+ },
16650
+ "content": {
16651
+ "schema": {
16652
+ "description": "The secret list of one unit in one environment, kept in the configuration repository. Each key is the last segment <name> of a KV path, and the file position gives the rest (blueprint-shared.secrets.secret-list-location). It holds field names and descriptions, never a value.",
16653
+ "type": "object",
16654
+ "propertyNames": {
16655
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
16656
+ },
16657
+ "additionalProperties": {
16658
+ "type": "object",
16659
+ "required": [
16660
+ "fields",
16661
+ "purpose",
16662
+ "owner"
16663
+ ],
16664
+ "additionalProperties": false,
16665
+ "properties": {
16666
+ "fields": {
16667
+ "type": "array",
16668
+ "minItems": 1,
16669
+ "uniqueItems": true,
16670
+ "items": {
16671
+ "type": "string",
16672
+ "pattern": "^[A-Za-z0-9_.-]+$"
16673
+ },
16674
+ "description": "the names of the fields that the path holds, never their values. Stored in custom_metadata as one string, joined by commas, of at most 512 characters"
16675
+ },
16676
+ "purpose": {
16677
+ "type": "string",
16678
+ "minLength": 1,
16679
+ "maxLength": 512,
16680
+ "description": "what the secret itself is for"
16681
+ },
16682
+ "owner": {
16683
+ "type": "string",
16684
+ "minLength": 1,
16685
+ "maxLength": 512,
16686
+ "description": "who answers for the secret"
16687
+ },
16688
+ "source": {
16689
+ "type": "string",
16690
+ "minLength": 1,
16691
+ "maxLength": 512,
16692
+ "description": "optional: where the value comes from, for example who issues it"
16693
+ },
16694
+ "rotation": {
16695
+ "type": "string",
16696
+ "pattern": "^[1-9][0-9]*d$",
16697
+ "description": "optional: how often the value is replaced, in days, for example 90d"
16698
+ }
16699
+ }
16700
+ }
15085
16701
  }
15086
16702
  }
15087
16703
  },
@@ -15092,7 +16708,7 @@
15092
16708
  "secrets"
15093
16709
  ],
15094
16710
  "title": "單元的 env 宣告格式",
15095
- "description": "單元在程式倉宣告需要哪些環境變數,只寫名稱與類別(`kind`)、是否必填(`required`)和預設值(`default`),不寫值也不寫路徑,跟著單元發版。",
16711
+ "description": "單元在程式倉宣告需要哪些環境變數,只寫名稱與類別(`kind`)、是否必填(`required`)、預設值(`default`)和選填的說明(`description`,寫這個環境變數給程式做什麼),不寫值也不寫路徑,跟著單元發版。密鑰本身的用途寫在組態倉的密鑰清單,兩者不重複。",
15096
16712
  "variants": [
15097
16713
  {
15098
16714
  "since": "0.6.0",
@@ -15138,6 +16754,55 @@
15138
16754
  }
15139
16755
  }
15140
16756
  }
16757
+ },
16758
+ {
16759
+ "since": "0.9.0",
16760
+ "content": {
16761
+ "schema": {
16762
+ "description": "The env declaration of a unit, kept in the code repository next to the unit and released with it. It names the variables the unit needs and their kind. It holds no value and no path.",
16763
+ "type": "object",
16764
+ "required": [
16765
+ "env"
16766
+ ],
16767
+ "additionalProperties": false,
16768
+ "properties": {
16769
+ "env": {
16770
+ "type": "object",
16771
+ "propertyNames": {
16772
+ "pattern": "^[A-Z][A-Z0-9_]*$"
16773
+ },
16774
+ "additionalProperties": {
16775
+ "type": "object",
16776
+ "required": [
16777
+ "kind"
16778
+ ],
16779
+ "additionalProperties": false,
16780
+ "properties": {
16781
+ "kind": {
16782
+ "enum": [
16783
+ "secret",
16784
+ "config"
16785
+ ],
16786
+ "description": "secret: the value comes from the secret service. config: the value comes from the template"
16787
+ },
16788
+ "required": {
16789
+ "type": "boolean",
16790
+ "description": "true: when the template gives no value the middleware returns an error that names the variable"
16791
+ },
16792
+ "default": {
16793
+ "type": "string",
16794
+ "description": "the value used when the template gives none"
16795
+ },
16796
+ "description": {
16797
+ "type": "string",
16798
+ "description": "optional: what the program does with this variable. The secret list says what the secret itself is for (blueprint-shared.secrets.secret-list-file), so the two do not repeat each other"
16799
+ }
16800
+ }
16801
+ }
16802
+ }
16803
+ }
16804
+ }
16805
+ }
15141
16806
  }
15142
16807
  ],
15143
16808
  "source": {
@@ -15178,6 +16843,10 @@
15178
16843
  "default": {
15179
16844
  "type": "string",
15180
16845
  "description": "the value used when the template gives none"
16846
+ },
16847
+ "description": {
16848
+ "type": "string",
16849
+ "description": "optional: what the program does with this variable. The secret list says what the secret itself is for (blueprint-shared.secrets.secret-list-file), so the two do not repeat each other"
15181
16850
  }
15182
16851
  }
15183
16852
  }
@@ -15419,7 +17088,7 @@
15419
17088
  "secrets"
15420
17089
  ],
15421
17090
  "title": "身分與權限規則",
15422
- "description": "預設拒絕。取用端角色唯讀,名稱 `<倉庫>`,環境看角色建在哪個環境的實例,所以名稱不帶環境,能讀的路徑由模板產生。GitHub 登入綁 claim 不綁 `sub`,每個 JWT 角色設 `bound_audiences`。audit 裝置至少兩個,不保留 root token,CI 的 token 只活 10 分鐘。加密匯出用的角色是唯一例外。政策用倉庫的 `owner/name` 組路徑時要設 `allow_slashes_in_identity_templates`,這會放寬路徑穿越防護。路徑段的規則排除了點和斜線,但只管寫下來的路徑,不管代入政策的 claim 值,那一段靠角色綁定倉庫的確切值。`vault_policy` 不支援這個屬性,要改用 `vault_generic_endpoint`。",
17091
+ "description": "預設拒絕。取用端角色唯讀,名稱 `<倉庫>`,環境看角色建在哪個環境的實例,所以名稱不帶環境,能讀的路徑由模板產生。GitHub 登入綁 claim 不綁 `sub`,每個 JWT 角色設 `bound_audiences`。audit 裝置至少兩個,不保留 root token,CI 的 token 只活 10 分鐘。加密匯出用的角色是唯一例外。政策用倉庫的 `owner/name` 組路徑時要設 `allow_slashes_in_identity_templates`,這會放寬路徑穿越防護。路徑段的規則排除了點和斜線,但只管寫下來的路徑,不管代入政策的 claim 值,那一段靠角色綁定倉庫的確切值。`vault_policy` 不支援這個屬性,要改用 `vault_generic_endpoint`。CI 也寫密鑰清單宣告的 metadata,仍不碰 `kv/data`。",
15423
17092
  "variants": [
15424
17093
  {
15425
17094
  "since": "0.6.0",
@@ -15468,6 +17137,33 @@
15468
17137
  }
15469
17138
  }
15470
17139
  }
17140
+ },
17141
+ {
17142
+ "since": "0.9.0",
17143
+ "content": {
17144
+ "value": {
17145
+ "default": "Deny. A path no policy allows cannot be read.",
17146
+ "roles": [
17147
+ "A consumer role is read-only. A repository has at most one role in the instance of each environment, named <repository>. The environment of the role is the instance it is created in, so the name carries no environment, the same way a KV path carries none.",
17148
+ "The paths a role may read come from the paths its template lists, never by hand. The sources of the template and of the policy are both the configuration repository."
17149
+ ],
17150
+ "values": "The value of a secret is written by a person only. IaC and CI manage namespaces, mounts, roles, policies, templates and the metadata that the secret list declares, cannot read a value, and no value enters the state. The CI that writes the metadata never touches kv/data (blueprint-shared.secrets.metadata-access).",
17151
+ "github": [
17152
+ "The login for GitHub binds claims (the owner, the repository, and for prod the branch or tag), never sub, because the format of sub differs between repositories created or renamed after a date in 2026-07 and older ones.",
17153
+ "Every JWT role sets bound_audiences, because the secret service refuses a login whose token has an aud when the role sets none."
17154
+ ],
17155
+ "token": "The token that CI gets lives 10 minutes, is not renewed, and is revoked by the middleware after use.",
17156
+ "audit": "At least two audit devices, because the secret service stops answering when all of them fail.",
17157
+ "root": "No root token is kept.",
17158
+ "exception": "The role for the encrypted export reads every secret. It is the only exception to \"a consumer reads only the paths its template lists\". It is bound to the service account of the VM, its token lives a few minutes, and each run leaves an audit record.",
17159
+ "identityTemplate": {
17160
+ "rule": "A policy that builds a path from the owner/name of the repository (the repository claim of the GitHub token, which holds a slash) must set allow_slashes_in_identity_templates, because the secret service refuses by default a substituted value that holds a slash. The setting loosens the guard against path traversal for that policy: a substituted value with a slash or a .. is no longer refused by the service.",
17161
+ "segmentRules": "The segment rules of this unit exclude the dot and the slash. NAME is [a-z0-9][a-z0-9-]* and SCOPE_NAME is NAME that is not shared, so a product, unit or name segment can neither be .. nor hold a slash. Where the pattern is anchored (extends and secret in the template file, TEMPLATE_PATH, filePattern) the whole path is held to this form. The patterns of the segments field are not anchored, so a consumer must match a whole segment.",
17162
+ "limit": "Those rules check the paths that are written (KV paths and template paths). They do not check the value substituted into a policy, which comes from the repository claim of the token. What guards that value is the role binding repository to its exact value through bound_claims (blueprint-shared.secrets.login-methods), and whatever GitHub allows in a repository name. Neither the naming rules of GitHub nor whether the secret service refuses a .. in a substituted value was checked.",
17163
+ "provider": "vault_policy of the hashicorp/vault provider (5.13.0) has no allow_slashes_in_identity_templates, so such a policy is written with vault_generic_endpoint on sys/policies/acl/ (blueprint-shared.secrets.access-scenarios)."
17164
+ }
17165
+ }
17166
+ }
15471
17167
  }
15472
17168
  ],
15473
17169
  "source": {
@@ -15480,7 +17176,7 @@
15480
17176
  "A consumer role is read-only. A repository has at most one role in the instance of each environment, named <repository>. The environment of the role is the instance it is created in, so the name carries no environment, the same way a KV path carries none.",
15481
17177
  "The paths a role may read come from the paths its template lists, never by hand. The sources of the template and of the policy are both the configuration repository."
15482
17178
  ],
15483
- "values": "The value of a secret is written by a person only. IaC and CI manage namespaces, mounts, roles, policies and templates, cannot read a value, and no value enters the state.",
17179
+ "values": "The value of a secret is written by a person only. IaC and CI manage namespaces, mounts, roles, policies, templates and the metadata that the secret list declares, cannot read a value, and no value enters the state. The CI that writes the metadata never touches kv/data (blueprint-shared.secrets.metadata-access).",
15484
17180
  "github": [
15485
17181
  "The login for GitHub binds claims (the owner, the repository, and for prod the branch or tag), never sub, because the format of sub differs between repositories created or renamed after a date in 2026-07 and older ones.",
15486
17182
  "Every JWT role sets bound_audiences, because the secret service refuses a login whose token has an aud when the role sets none."
@@ -15498,6 +17194,115 @@
15498
17194
  }
15499
17195
  }
15500
17196
  },
17197
+ {
17198
+ "id": "blueprint-shared.secrets.metadata-access",
17199
+ "tool": "blueprint-shared",
17200
+ "topics": [
17201
+ "secrets"
17202
+ ],
17203
+ "title": "兩種角色在 kv/data 與 kv/metadata 的權限",
17204
+ "description": "同步角色(組態倉 CI 經指令工具的同步子指令)在 `kv/metadata/*` 給 create、update、patch、read、list,不給 delete,`kv/data/*` 什麼都不給,所以讀不到值。人用角色在 `kv/data/*` 給 create、read、update、patch、delete,在 `kv/metadata/*` 只給 read、list、delete,所以改不了說明,說明只有清單一個來源。同步角色不刪 metadata,因為刪 metadata 會永久刪掉所有版本。KV v2 其他路徑、唯讀的人用角色與 PR 預覽用的唯讀角色不在這筆。",
17205
+ "variants": [
17206
+ {
17207
+ "since": "0.9.0",
17208
+ "content": {
17209
+ "value": {
17210
+ "scope": "The capabilities of the two roles on kv/data/* and kv/metadata/* of the kv/ mount, in every instance. The other KV v2 paths (delete, undelete, destroy), the read-only human role and the read-only role that previews a pull request are not set here.",
17211
+ "roles": [
17212
+ {
17213
+ "role": "sync",
17214
+ "who": "the CI of the configuration repository, through the sync subcommand of the CLI",
17215
+ "kvData": [],
17216
+ "kvMetadata": [
17217
+ "create",
17218
+ "update",
17219
+ "patch",
17220
+ "read",
17221
+ "list"
17222
+ ],
17223
+ "notGiven": "delete on kv/metadata/*, and every capability on kv/data/*"
17224
+ },
17225
+ {
17226
+ "role": "person",
17227
+ "who": "a person who writes values, logged in by OIDC",
17228
+ "kvData": [
17229
+ "create",
17230
+ "read",
17231
+ "update",
17232
+ "patch",
17233
+ "delete"
17234
+ ],
17235
+ "kvMetadata": [
17236
+ "read",
17237
+ "list",
17238
+ "delete"
17239
+ ],
17240
+ "notGiven": "create, update and patch on kv/metadata/*"
17241
+ }
17242
+ ],
17243
+ "rules": [
17244
+ "The description has one source, the secret list. A person cannot change it, because the human role has no create, update or patch on kv/metadata/*.",
17245
+ "The sync role reads and lists kv/metadata/* because a write carries metadata_cas, which takes the current_metadata_version it read, and because the preview compares the list with the paths in the instance.",
17246
+ "The sync role never deletes metadata, because DELETE on kv/metadata/<path> removes every version of the path for good. A person deletes a path that the list no longer declares.",
17247
+ "The sync role writes with POST and the whole custom_metadata, because POST replaces custom_metadata as a whole and PATCH is a merge-patch that removes a key set to null.",
17248
+ "The human role reads and lists kv/metadata/* to see the description and the number of versions before it deletes a path.",
17249
+ "Writing a value cannot carry a description. Only the metadata endpoint takes custom_metadata, so the capabilities on kv/metadata/* alone decide who can change it.",
17250
+ "LIST on kv/metadata/ returns path names only and is not filtered by policy, so a role with list sees the names of every path under it, never a value."
17251
+ ]
17252
+ }
17253
+ }
17254
+ }
17255
+ ],
17256
+ "source": {
17257
+ "kind": "published"
17258
+ },
17259
+ "content": {
17260
+ "value": {
17261
+ "scope": "The capabilities of the two roles on kv/data/* and kv/metadata/* of the kv/ mount, in every instance. The other KV v2 paths (delete, undelete, destroy), the read-only human role and the read-only role that previews a pull request are not set here.",
17262
+ "roles": [
17263
+ {
17264
+ "role": "sync",
17265
+ "who": "the CI of the configuration repository, through the sync subcommand of the CLI",
17266
+ "kvData": [],
17267
+ "kvMetadata": [
17268
+ "create",
17269
+ "update",
17270
+ "patch",
17271
+ "read",
17272
+ "list"
17273
+ ],
17274
+ "notGiven": "delete on kv/metadata/*, and every capability on kv/data/*"
17275
+ },
17276
+ {
17277
+ "role": "person",
17278
+ "who": "a person who writes values, logged in by OIDC",
17279
+ "kvData": [
17280
+ "create",
17281
+ "read",
17282
+ "update",
17283
+ "patch",
17284
+ "delete"
17285
+ ],
17286
+ "kvMetadata": [
17287
+ "read",
17288
+ "list",
17289
+ "delete"
17290
+ ],
17291
+ "notGiven": "create, update and patch on kv/metadata/*"
17292
+ }
17293
+ ],
17294
+ "rules": [
17295
+ "The description has one source, the secret list. A person cannot change it, because the human role has no create, update or patch on kv/metadata/*.",
17296
+ "The sync role reads and lists kv/metadata/* because a write carries metadata_cas, which takes the current_metadata_version it read, and because the preview compares the list with the paths in the instance.",
17297
+ "The sync role never deletes metadata, because DELETE on kv/metadata/<path> removes every version of the path for good. A person deletes a path that the list no longer declares.",
17298
+ "The sync role writes with POST and the whole custom_metadata, because POST replaces custom_metadata as a whole and PATCH is a merge-patch that removes a key set to null.",
17299
+ "The human role reads and lists kv/metadata/* to see the description and the number of versions before it deletes a path.",
17300
+ "Writing a value cannot carry a description. Only the metadata endpoint takes custom_metadata, so the capabilities on kv/metadata/* alone decide who can change it.",
17301
+ "LIST on kv/metadata/ returns path names only and is not filtered by policy, so a role with list sees the names of every path under it, never a value."
17302
+ ]
17303
+ }
17304
+ }
17305
+ },
15501
17306
  {
15502
17307
  "id": "blueprint-shared.secrets.login-methods",
15503
17308
  "tool": "blueprint-shared",
@@ -16191,7 +17996,7 @@
16191
17996
  "token": "The checkout of the release branch and the script run with the token of the GitHub App (blueprint-shared.templates.github-app), because a push or a merge made with GITHUB_TOKEN starts no later workflow.",
16192
17997
  "needsApp": "A manual workflow needs the GitHub App. Its first step is actions/create-github-app-token, so a repository without the App (the variable named by @@clientIdVariable@@ not set) fails the run there, before anything is written. The steps that events start skip instead of failing when the repository has no App (blueprint-shared.templates.release-event-steps, blueprint-shared.templates.release-tool-sync-and-close); a repository without the App runs the scripts on a machine.",
16193
17998
  "concurrency": "One group per release line, release-line-<line>, shared by the three workflows (advance-release, merge-release-pr, merge-back), with cancel-in-progress false: two writers never work on one line at once, and a running one is not cancelled.",
16194
- "noWaiting": "POLL_TRIES, CI_GATE_TRIES and CI_GATE_QUEUE_TRIES are set and none is above 2 (blueprint.ci.wait-loops). A condition that does not hold yet (the CI gate, release-please not done) fails the run and prints what to wait for. The person starts the workflow again later.",
17999
+ "noWaiting": "POLL_TRIES, CI_GATE_TRIES and CI_GATE_QUEUE_TRIES are set and none is above 2 (blueprint-shared.ci.wait-loops). A condition that does not hold yet (the CI gate, release-please not done) fails the run and prints what to wait for. The person starts the workflow again later.",
16195
18000
  "triggerCheck": {
16196
18001
  "script": "scripts/release/check-trigger-actor.sh",
16197
18002
  "list": "the repository variable RELEASE_TRIGGER_ACTORS: accounts separated by commas, spaces or new lines. A GitHub App appears as <slug>[bot]. When the variable is not set nobody is excluded.",
@@ -16243,7 +18048,7 @@
16243
18048
  "token": "The checkout of the release branch and the script run with the token of the GitHub App (blueprint-shared.templates.github-app), because a push or a merge made with GITHUB_TOKEN starts no later workflow.",
16244
18049
  "needsApp": "A manual workflow needs the GitHub App. Its first step is actions/create-github-app-token, so a repository without the App (the variable named by @@clientIdVariable@@ not set) fails the run there, before anything is written. The steps that events start skip instead of failing when the repository has no App (blueprint-shared.templates.release-event-steps, blueprint-shared.templates.release-tool-sync-and-close); a repository without the App runs the scripts on a machine.",
16245
18050
  "concurrency": "One group per release line, release-line-<line>, shared by the three workflows (advance-release, merge-release-pr, merge-back), with cancel-in-progress false: two writers never work on one line at once, and a running one is not cancelled.",
16246
- "noWaiting": "POLL_TRIES, CI_GATE_TRIES and CI_GATE_QUEUE_TRIES are set and none is above 2 (blueprint.ci.wait-loops). A condition that does not hold yet (the CI gate, release-please not done) fails the run and prints what to wait for. The person starts the workflow again later.",
18051
+ "noWaiting": "POLL_TRIES, CI_GATE_TRIES and CI_GATE_QUEUE_TRIES are set and none is above 2 (blueprint-shared.ci.wait-loops). A condition that does not hold yet (the CI gate, release-please not done) fails the run and prints what to wait for. The person starts the workflow again later.",
16247
18052
  "triggerCheck": {
16248
18053
  "script": "scripts/release/check-trigger-actor.sh",
16249
18054
  "list": "the repository variable RELEASE_TRIGGER_ACTORS: accounts separated by commas, spaces or new lines. A GitHub App appears as <slug>[bot]. When the variable is not set nobody is excluded.",
@@ -16421,7 +18226,7 @@
16421
18226
  "every path equals main's"
16422
18227
  ],
16423
18228
  "ownFix": "A path with commits of the branch that main does not have fails the line, lists the commits with their files, and overwrites nothing. The other lines are still done and the run fails at the end. The fix is to cherry-pick the commits to main and merge them, then run the sync again.",
16424
- "refusedPush": "A refused push fetches the branches and does the whole look and sync once more. A second refusal fails the line. The retry is written out, no loop sleeps (blueprint.ci.wait-loops has no new row for it).",
18229
+ "refusedPush": "A refused push fetches the branches and does the whole look and sync once more. A second refusal fails the line. The retry is written out, no loop sleeps (blueprint-shared.ci.wait-loops has no new row for it).",
16425
18230
  "concurrency": "One group, release-tool-sync, with cancel-in-progress false. It is not the release-line-<line> group of the manual workflows, because one run covers every line and a push event names no line."
16426
18231
  },
16427
18232
  "close": {
@@ -16434,7 +18239,7 @@
16434
18239
  "manual": "workflow_dispatch with the line: the same decision with --strict, so a PR that is not ready fails the run and prints why, then the same close."
16435
18240
  },
16436
18241
  "triggerCheck": "A manual run checks github.triggering_actor against RELEASE_TRIGGER_ACTORS with scripts/release/check-trigger-actor.sh before the App token is made, from a read-only checkout of the default branch (blueprint-shared.templates.release-manual-workflows).",
16437
- "noWaiting": "POLL_TRIES, CI_GATE_TRIES and CI_GATE_QUEUE_TRIES are set and none is above 2 (blueprint.ci.wait-loops). The new scripts have no loop that sleeps, so blueprint.ci.wait-loops has no new row for them.",
18242
+ "noWaiting": "POLL_TRIES, CI_GATE_TRIES and CI_GATE_QUEUE_TRIES are set and none is above 2 (blueprint-shared.ci.wait-loops). The new scripts have no loop that sleeps, so blueprint-shared.ci.wait-loops has no new row for them.",
16438
18243
  "decision": "release-tool-sync-and-close-by-events"
16439
18244
  }
16440
18245
  }
@@ -16474,7 +18279,7 @@
16474
18279
  "every path equals main's"
16475
18280
  ],
16476
18281
  "ownFix": "A path with commits of the branch that main does not have fails the line, lists the commits with their files, and overwrites nothing. The other lines are still done and the run fails at the end. The fix is to cherry-pick the commits to main and merge them, then run the sync again.",
16477
- "refusedPush": "A refused push fetches the branches and does the whole look and sync once more. A second refusal fails the line. The retry is written out, no loop sleeps (blueprint.ci.wait-loops has no new row for it).",
18282
+ "refusedPush": "A refused push fetches the branches and does the whole look and sync once more. A second refusal fails the line. The retry is written out, no loop sleeps (blueprint-shared.ci.wait-loops has no new row for it).",
16478
18283
  "concurrency": "One group, release-tool-sync, with cancel-in-progress false. It is not the release-line-<line> group of the manual workflows, because one run covers every line and a push event names no line."
16479
18284
  },
16480
18285
  "close": {
@@ -16487,7 +18292,7 @@
16487
18292
  "manual": "workflow_dispatch with the line: the same decision with --strict, so a PR that is not ready fails the run and prints why, then the same close."
16488
18293
  },
16489
18294
  "triggerCheck": "A manual run checks github.triggering_actor against RELEASE_TRIGGER_ACTORS with scripts/release/check-trigger-actor.sh before the App token is made, from a read-only checkout of the default branch (blueprint-shared.templates.release-manual-workflows).",
16490
- "noWaiting": "POLL_TRIES, CI_GATE_TRIES and CI_GATE_QUEUE_TRIES are set and none is above 2 (blueprint.ci.wait-loops). The new scripts have no loop that sleeps, so blueprint.ci.wait-loops has no new row for them.",
18295
+ "noWaiting": "POLL_TRIES, CI_GATE_TRIES and CI_GATE_QUEUE_TRIES are set and none is above 2 (blueprint-shared.ci.wait-loops). The new scripts have no loop that sleeps, so blueprint-shared.ci.wait-loops has no new row for them.",
16491
18296
  "decision": "release-tool-sync-and-close-by-events"
16492
18297
  }
16493
18298
  }
@@ -17035,7 +18840,7 @@
17035
18840
  "templates"
17036
18841
  ],
17037
18842
  "title": "GitHub App 的名稱與設定名稱",
17038
- "description": "合併與 release-please 用一個 GitHub App 的權杖。App 的名稱、存 client id 的 variable 名稱與存私鑰的 secret 名稱都由使用範本的組織自己決定,欄位說明見 `blueprint-shared.templates.fields`。範本檔只寫佔位符,組裝時寫入名稱。放在哪一層見 `blueprint-shared.templates.github-app-placement`。",
18843
+ "description": "合併與 release-please 用一個 GitHub App 的權杖。App 的名稱、存 client id 的 variable 名稱與存私鑰的 secret 名稱都由使用範本的組織自己決定,欄位說明見 `blueprint-shared.templates.fields`。範本檔只寫佔位符,組裝時寫入名稱。放在哪一層見 `blueprint-shared.templates.github-app-placement`。佔位符與 compose 是 blueprint 產生參考實作的做法,倉要符合的是名稱的值。",
17039
18844
  "variants": [
17040
18845
  {
17041
18846
  "since": "0.1.0",
@@ -17086,7 +18891,7 @@
17086
18891
  "templates"
17087
18892
  ],
17088
18893
  "title": "自動合併 workflow 範本",
17089
- "description": "判斷邏輯在 `decide.mjs`,workflow 只負責讀 PR 與檢查、呼叫它、再依輸出合併。必要檢查與 label 在組裝時寫進 `scripts/merge/merge-config.json`。",
18894
+ "description": "範本是 `merge.workflow` 規則的一個參考實作,只描述它的檔案路徑與佔位符。判斷邏輯在 `decide.mjs`,workflow 只負責讀 PR 與檢查、呼叫它、再依輸出合併。必要檢查與 label 在組裝時寫進 `scripts/merge/merge-config.json`。",
17090
18895
  "variants": [
17091
18896
  {
17092
18897
  "since": "0.1.0",
@@ -17176,6 +18981,56 @@
17176
18981
  }
17177
18982
  }
17178
18983
  }
18984
+ },
18985
+ {
18986
+ "since": "0.9.0",
18987
+ "content": {
18988
+ "value": {
18989
+ "file": "base/.github/workflows/auto-merge.yml",
18990
+ "role": "base",
18991
+ "decideScript": "base/scripts/merge/decide.mjs",
18992
+ "configFile": "scripts/merge/merge-config.json",
18993
+ "configFrom": "blueprint-shared.merge.required-checks, blueprint-shared.git-flow.review-paths and, only when the repository declares one, syncPr: a kind of pull request the repository itself declares (its author is a named App and its head branch has a given name)",
18994
+ "reviewGate": "A pull request that changes one of config.reviewPaths is skipped until a review approves it and none asks for changes (blueprint-shared.merge.workflow). A Release PR and a pull request that matches config.syncPr are not held back by it. A repository that declares no syncPr has no such pull request.",
18995
+ "label": "auto-merge",
18996
+ "triggers": [
18997
+ {
18998
+ "event": "pull_request_target",
18999
+ "types": [
19000
+ "labeled"
19001
+ ]
19002
+ },
19003
+ {
19004
+ "event": "workflow_run",
19005
+ "workflows": [
19006
+ "ci",
19007
+ "pr-message"
19008
+ ],
19009
+ "types": [
19010
+ "completed"
19011
+ ]
19012
+ }
19013
+ ],
19014
+ "jobs": [
19015
+ "decide",
19016
+ "merge"
19017
+ ],
19018
+ "actions": [
19019
+ "merge",
19020
+ "skip"
19021
+ ],
19022
+ "mergeCommand": "gh pr merge <number> --squash --match-head-commit <sha> --delete-branch",
19023
+ "valuesFrom": [
19024
+ "blueprint-shared.merge.workflow",
19025
+ "blueprint-shared.merge.required-checks",
19026
+ "blueprint-shared.merge.method",
19027
+ "blueprint-shared.merge.fork",
19028
+ "blueprint-shared.merge.release-pr"
19029
+ ],
19030
+ "behavior": "The rules the workflow follows (triggers and filter, skip conditions, review paths, the 405 retry, no checks yet, concurrency) are in blueprint-shared.merge.workflow. This fact only describes the files of the reference implementation.",
19031
+ "labelPlaceholder": "The template holds the placeholder @@mergeLabel@@ where the label goes, and scripts/merge/merge-config.json gets the same label."
19032
+ }
19033
+ }
17179
19034
  }
17180
19035
  ],
17181
19036
  "source": {
@@ -17187,9 +19042,8 @@
17187
19042
  "role": "base",
17188
19043
  "decideScript": "base/scripts/merge/decide.mjs",
17189
19044
  "configFile": "scripts/merge/merge-config.json",
17190
- "configFrom": "blueprint-shared.merge.required-checks, blueprint-shared.git-flow.review-paths and the settings of a sync pull request (the App name and the branch), written when the repository is composed",
17191
- "reviewGate": "A pull request that changes one of config.reviewPaths is skipped until a review approves it and none asks for changes. A sync pull request (opened by the synchronisation of the demo repositories) and a Release PR are not held back by it. The platform only enforces CODEOWNERS with branch protection, which a private repository on a plan without branch protection (the GitHub Free plan is one) does not have (blueprint-shared.merge.no-platform-auto-merge), so the decision reads the reviews itself.",
17192
- "blueprintRoot": "A repository whose root merge-config.json has reviewPaths empty (the repository that holds the templates is one) merges its own pull requests as before.",
19045
+ "configFrom": "blueprint-shared.merge.required-checks, blueprint-shared.git-flow.review-paths and, only when the repository declares one, syncPr: a kind of pull request the repository itself declares (its author is a named App and its head branch has a given name)",
19046
+ "reviewGate": "A pull request that changes one of config.reviewPaths is skipped until a review approves it and none asks for changes (blueprint-shared.merge.workflow). A Release PR and a pull request that matches config.syncPr are not held back by it. A repository that declares no syncPr has no such pull request.",
17193
19047
  "label": "auto-merge",
17194
19048
  "triggers": [
17195
19049
  {
@@ -17218,18 +19072,6 @@
17218
19072
  "skip"
17219
19073
  ],
17220
19074
  "mergeCommand": "gh pr merge <number> --squash --match-head-commit <sha> --delete-branch",
17221
- "skipWhen": [
17222
- "the pull request is not open",
17223
- "the pull request comes from a fork",
17224
- "the pull request has no auto-merge label",
17225
- "the pull request is a draft",
17226
- "a commit was pushed after the checks were read",
17227
- "a required check failed or was cancelled",
17228
- "a required check is still running",
17229
- "a required check has not run",
17230
- "the pull request changes a review path, is not a sync pull request or a Release PR, and has no approving review or has a review that asks for changes"
17231
- ],
17232
- "passWhen": "A required check that passed or was skipped by scope counts as passed. A required check that does not appear because its workflow has a path filter that no changed file matches counts as skipped (config.pathFiltered).",
17233
19075
  "valuesFrom": [
17234
19076
  "blueprint-shared.merge.workflow",
17235
19077
  "blueprint-shared.merge.required-checks",
@@ -17237,34 +19079,8 @@
17237
19079
  "blueprint-shared.merge.fork",
17238
19080
  "blueprint-shared.merge.release-pr"
17239
19081
  ],
17240
- "failedList": "A skip because a required check failed or was cancelled also lists those checks in failed, so a caller can tell a failure from a wait. The synchronisation of the demo repositories uses it for the sync pull requests it merges itself.",
17241
- "releasePr": "The workflow does not merge a Release PR (the decision is skip). A person runs bash scripts/release/merge-release-pr.sh --line X.Y --yes on a machine.",
17242
- "mergeRetry": {
17243
- "on": "HTTP 405 \"Base branch was modified\": pull requests merged at the same moment into one base can get it for the one that lost the race. Only gh output containing \"Base branch was modified\" is retried; any other error fails at once.",
17244
- "attempts": 5,
17245
- "intervalSeconds": 3,
17246
- "lastAttempt": "The fifth attempt that gets the same error fails the job with the gh exit status.",
17247
- "source": "Not in the GitHub documentation. Reported by users: ridedott/merge-me-action issue 458, and Zuul (openstack-infra/zuul commit 49bff07) retries after about 2 seconds when it merges at the same moment.",
17248
- "where": "The run script of the merge job, so the repositories get it through the template."
17249
- },
17250
- "noChecksYet": {
17251
- "on": "gh pr checks exits 1 with nothing on stdout and \"no checks reported on the '<branch>' branch\" on stderr, as it does for a pull request that has no check yet (service-facts github gh-pr-checks-exit-status).",
17252
- "result": "The decide job writes [] as the checks, so the decision is that a required check has not run (skip) and a later workflow_run looks again.",
17253
- "otherErrors": "Exit status 1 with an empty stdout and any other stderr (for example the token lacks actions: read), or an exit status other than 0, 1 and 8, still fails the step with ::error:: and writes no [].",
17254
- "where": "The decide job, so the repositories get it through the template."
17255
- },
17256
- "skipWithoutPr": "The decide job has an if. For pull_request_target it runs only when the label that was added is the auto-merge label (the label of this value, written in as @@mergeLabel@@ when the repository is composed) and the pull request branch does not start with release-please--. For a workflow_run it runs only when the run belongs to a pull request (workflow_run.pull_requests[0]) and its head_branch does not start with release-please--. Any other label (release-please adds autorelease: pending and autorelease: tagged), a Release PR, a ci or pr-message that ran on a push to main or a release branch, and a run for a fork are skipped there and take no runner. A ci that did not succeed still runs the decision, because native, a job of ci that is not a required check, can fail while the required checks pass.",
17257
- "concurrency": {
17258
- "decide": "auto-merge-decide-<pull request number>, cancel-in-progress true: a newer event of the same pull request reads the checks again, so an older decide still running is cancelled.",
17259
- "merge": "auto-merge-merge-<pull request number>, cancel-in-progress false: a merge is never cancelled halfway.",
17260
- "decision": "auto-merge-skip-and-cancel"
17261
- },
17262
- "skipOtherLabelsAndReleasePr": {
17263
- "label": "The if compares github.event.label.name with the label of this value; the placeholder is @@mergeLabel@@ in the template and scripts/merge/merge-config.json gets the same label.",
17264
- "releasePrBranchPrefix": "release-please--",
17265
- "releasePrWhy": "A Release PR is merged by scripts/release/merge-release-pr.sh and never by this workflow, so its decision could only be skip.",
17266
- "decision": "auto-merge-label-and-release-pr-filter"
17267
- }
19082
+ "behavior": "The rules the workflow follows (triggers and filter, skip conditions, review paths, the 405 retry, no checks yet, concurrency) are in blueprint-shared.merge.workflow. This fact only describes the files of the reference implementation.",
19083
+ "labelPlaceholder": "The template holds the placeholder @@mergeLabel@@ where the label goes, and scripts/merge/merge-config.json gets the same label."
17268
19084
  }
17269
19085
  }
17270
19086
  },
@@ -17611,6 +19427,40 @@
17611
19427
  "ci": "ci.yml has the step \"organization values against blueprint-shared.org-values\" in its facts job between role blocks (# @if org), after the steps that build and check the facts. The role has no workflow of its own"
17612
19428
  }
17613
19429
  }
19430
+ },
19431
+ {
19432
+ "since": "0.8.0",
19433
+ "content": {
19434
+ "value": {
19435
+ "role": "org",
19436
+ "dir": "org/",
19437
+ "needs": [
19438
+ "base",
19439
+ "release",
19440
+ "publish"
19441
+ ],
19442
+ "for": "the repository of the organization layer that holds the values of the organization: its facts package <RepoName>-facts and its docs package <RepoName>-docs. It belongs to no product. A repository that adopts the shared layer has one. The repository that holds the templates is also a repository of the organization layer, so the rule here is the one for every repository of that layer",
19443
+ "files": [
19444
+ "README.md",
19445
+ "scripts/ci/check-org-values.mjs"
19446
+ ],
19447
+ "composed": {
19448
+ "facts": "facts/ is the aggregate package named <MetaFactName> (blueprint-shared.naming.meta-fact-name) with one component, <RepoName>-facts.npm in facts/<RepoName>-facts/. The component holds at least the organization values (<RepoName>.org-values, validatedBy blueprint-shared.org-values) and the repositories of the organization layer (<RepoName>.org-layout.repos, shaped like the repository list that scripts/naming/check-names.mjs reads). The organization may add its own rules to it. It does not hold the duties of the repository that holds the templates (see templateHolder)",
19449
+ "docs": "docs/ is the docs package named <RepoName>-docs (blueprint-shared.naming.docs-package-name) with the entry docs/<RepoName>-docs/<RepoName>/ of the layer org, which cites the facts of the organization and the shared facts, and takes the shared documents as docSources. The entry holds the document layer-names.doc.ts, which the compose step writes from the repository list: the facts and docs package of every repository of the list, named from the scope of the organization",
19450
+ "names": "Every name is worked out from the organization values and the repository list given to the compose step, so the role names no organization: the scope is the one of aggregatePackageName, the packages are <scope>/<RepoName>-facts and <scope>/<RepoName>-docs",
19451
+ "dependencies": "The component depends on blueprint-shared-facts and the docs package on blueprint-shared-docs and blueprint-shared-facts, at the version of those packages in the repository that holds the templates, because the repository installs them from the public registry",
19452
+ "readme": "README.md comes from the role template. The compose step fills the organization (the scope without the @), the repository name, aggregatePackageName and aggregateRegistry of the organization values (fields organization, repoName, aggregatePackageName and aggregateRegistry of blueprint-shared.templates.fields). It says the repository is the organization layer of an organization, which holds the organization values and the repository list, names no organization, and lists the permissions the App of the organization needs from blueprint-shared.templates.github-app-placement"
19453
+ },
19454
+ "schema": "The fact of the organization values carries validatedBy blueprint-shared.org-values, so fact-kit check (pnpm check, the facts job of ci.yml) fails when a required field is missing or an unknown field is present, and names the field. scripts/ci/check-org-values.mjs reads the built value and the same schema, prints each missing, unknown or wrongly typed field, and also fails when aggregatePackageName is not the name of the aggregate package of the repository",
19455
+ "ci": "ci.yml has the step \"organization values against blueprint-shared.org-values\" in its facts job between role blocks (# @if org), after the steps that build and check the facts. The role has no workflow of its own",
19456
+ "templateHolder": {
19457
+ "rule": "The repository that holds the templates is also a repository of the organization layer. It holds the values of its organization and the list of the repositories of that layer like any other repository of the layer, and it has the duties of the template holder (showing the templates in demonstration repositories, and managing the templates) that no other repository of the layer has.",
19458
+ "factsPackage": "The facts package of an organization layer repository, <RepoName>-facts, holds at least the organization values and the repository list. It may hold more, such as rules the organization sets for itself. It holds nothing of the duties of the repository that holds the templates, whatever the repository is.",
19459
+ "demos": "The repository that holds the templates may have packages of its own duties under demos/: <RepoName>-demos-facts in demos/_facts and <RepoName>-demos-docs in demos/_docs (blueprint-shared.naming.unit-name, dutyPackages; blueprint-shared.repo-layout.directories).",
19460
+ "dependency": "A package under demos/ may depend on the packages of the organization layer and on the shared packages. They do not depend on a package under demos/, so a repository of the organization layer that holds no templates has the same packages without it."
19461
+ }
19462
+ }
19463
+ }
17614
19464
  }
17615
19465
  ],
17616
19466
  "source": {
@@ -17625,20 +19475,26 @@
17625
19475
  "release",
17626
19476
  "publish"
17627
19477
  ],
17628
- "for": "the repository of the organization layer that holds the values of the organization: its facts package <RepoName>-facts and its docs package <RepoName>-docs. It belongs to no product. A repository that adopts the shared layer has one, and it is not a copy of the repository that owns the templates",
19478
+ "for": "the repository of the organization layer that holds the values of the organization: its facts package <RepoName>-facts and its docs package <RepoName>-docs. It belongs to no product. A repository that adopts the shared layer has one. The repository that holds the templates is also a repository of the organization layer, so the rule here is the one for every repository of that layer",
17629
19479
  "files": [
17630
19480
  "README.md",
17631
19481
  "scripts/ci/check-org-values.mjs"
17632
19482
  ],
17633
19483
  "composed": {
17634
- "facts": "facts/ is the aggregate package named <MetaFactName> (blueprint-shared.naming.meta-fact-name) with one component, <RepoName>-facts.npm in facts/<RepoName>-facts/, which holds two facts: the organization values (<RepoName>.org-values, validatedBy blueprint-shared.org-values) and the repositories of the organization layer (<RepoName>.org-layout.repos, shaped like the repository list that scripts/naming/check-names.mjs reads)",
19484
+ "facts": "facts/ is the aggregate package named <MetaFactName> (blueprint-shared.naming.meta-fact-name) with one component, <RepoName>-facts.npm in facts/<RepoName>-facts/. The component holds at least the organization values (<RepoName>.org-values, validatedBy blueprint-shared.org-values) and the repositories of the organization layer (<RepoName>.org-layout.repos, shaped like the repository list that scripts/naming/check-names.mjs reads). The organization may add its own rules to it. It does not hold the duties of the repository that holds the templates (see templateHolder)",
17635
19485
  "docs": "docs/ is the docs package named <RepoName>-docs (blueprint-shared.naming.docs-package-name) with the entry docs/<RepoName>-docs/<RepoName>/ of the layer org, which cites the facts of the organization and the shared facts, and takes the shared documents as docSources. The entry holds the document layer-names.doc.ts, which the compose step writes from the repository list: the facts and docs package of every repository of the list, named from the scope of the organization",
17636
19486
  "names": "Every name is worked out from the organization values and the repository list given to the compose step, so the role names no organization: the scope is the one of aggregatePackageName, the packages are <scope>/<RepoName>-facts and <scope>/<RepoName>-docs",
17637
19487
  "dependencies": "The component depends on blueprint-shared-facts and the docs package on blueprint-shared-docs and blueprint-shared-facts, at the version of those packages in the repository that holds the templates, because the repository installs them from the public registry",
17638
- "readme": "README.md comes from the role template. The compose step fills the organization (the scope without the @), the repository name, aggregatePackageName and aggregateRegistry of the organization values (fields organization, repoName, aggregatePackageName and aggregateRegistry of blueprint-shared.templates.fields). It says the repository is the organization layer of an adopter and not a copy of the repository that manages the shared packages (the management hub), names no organization, and lists the permissions the App of the organization needs from blueprint-shared.templates.github-app-placement"
19488
+ "readme": "README.md comes from the role template. The compose step fills the organization (the scope without the @), the repository name, aggregatePackageName and aggregateRegistry of the organization values (fields organization, repoName, aggregatePackageName and aggregateRegistry of blueprint-shared.templates.fields). It says the repository is the organization layer of an organization, which holds the organization values and the repository list, names no organization, and lists the permissions the App of the organization needs from blueprint-shared.templates.github-app-placement"
17639
19489
  },
17640
19490
  "schema": "The fact of the organization values carries validatedBy blueprint-shared.org-values, so fact-kit check (pnpm check, the facts job of ci.yml) fails when a required field is missing or an unknown field is present, and names the field. scripts/ci/check-org-values.mjs reads the built value and the same schema, prints each missing, unknown or wrongly typed field, and also fails when aggregatePackageName is not the name of the aggregate package of the repository",
17641
- "ci": "ci.yml has the step \"organization values against blueprint-shared.org-values\" in its facts job between role blocks (# @if org), after the steps that build and check the facts. The role has no workflow of its own"
19491
+ "ci": "ci.yml has the step \"organization values against blueprint-shared.org-values\" in its facts job between role blocks (# @if org), after the steps that build and check the facts. The role has no workflow of its own",
19492
+ "templateHolder": {
19493
+ "rule": "The repository that holds the templates is also a repository of the organization layer. It holds the values of its organization and the list of the repositories of that layer like any other repository of the layer, and it has the duties of the template holder (showing the templates in demonstration repositories, and managing the templates) that no other repository of the layer has.",
19494
+ "factsPackage": "The facts package of an organization layer repository, <RepoName>-facts, holds at least the organization values and the repository list. It may hold more, such as rules the organization sets for itself. It holds nothing of the duties of the repository that holds the templates, whatever the repository is.",
19495
+ "demos": "The repository that holds the templates may have packages of its own duties under demos/: <RepoName>-demos-facts in demos/_facts and <RepoName>-demos-docs in demos/_docs (blueprint-shared.naming.unit-name, dutyPackages; blueprint-shared.repo-layout.directories).",
19496
+ "dependency": "A package under demos/ may depend on the packages of the organization layer and on the shared packages. They do not depend on a package under demos/, so a repository of the organization layer that holds no templates has the same packages without it."
19497
+ }
17642
19498
  }
17643
19499
  }
17644
19500
  },
@@ -17980,7 +19836,7 @@
17980
19836
  "templates"
17981
19837
  ],
17982
19838
  "title": "範本的組織欄位",
17983
- "description": "範本裡要由使用的組織自己填的值:GitHub App 的 client id variable 名稱與私鑰 secret 名稱、auto-merge 的 label、npm scope、授權的版權人,以及 ops 回寫 commit 作者用的 App bot 名稱與 user id。org 角色的 README 另用組織名、倉名、facts 匯總套件名與 registry 名稱。每個欄位寫名稱、說明、範本裡的形式,以及用在哪些範本檔。",
19839
+ "description": "範本裡要由使用的組織自己填的值:GitHub App 的 client id variable 名稱與私鑰 secret 名稱、auto-merge 的 label、npm scope、授權的版權人,以及 ops 回寫 commit 作者用的 App bot 名稱與 user id。org 角色的 README 另用組織名、倉名、facts 匯總套件名與 registry 名稱。每個欄位寫名稱、說明、範本裡的形式,以及用在哪些範本檔。佔位符與 compose 是 blueprint 產生參考實作的做法,倉要符合的是欄位的值。",
17984
19840
  "variants": [
17985
19841
  {
17986
19842
  "since": "0.1.0",