blueprint-shared-facts 0.8.0 → 0.10.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.
- package/dist/blueprint-shared/index.json +1455 -105
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"package": "blueprint-shared-facts",
|
|
5
5
|
"entry": "blueprint-shared",
|
|
6
6
|
"describes": {
|
|
7
|
-
"blueprint-shared-facts": "0.
|
|
7
|
+
"blueprint-shared-facts": "0.10.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
|
|
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.
|
|
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",
|
|
@@ -860,6 +893,128 @@
|
|
|
860
893
|
]
|
|
861
894
|
}
|
|
862
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
|
+
}
|
|
863
1018
|
}
|
|
864
1019
|
],
|
|
865
1020
|
"source": {
|
|
@@ -867,7 +1022,7 @@
|
|
|
867
1022
|
},
|
|
868
1023
|
"content": {
|
|
869
1024
|
"value": {
|
|
870
|
-
"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
|
|
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.",
|
|
871
1026
|
"repos": [
|
|
872
1027
|
{
|
|
873
1028
|
"kind": "single repository of a monorepo product",
|
|
@@ -958,7 +1113,7 @@
|
|
|
958
1113
|
"referencedBy": "cloudflareSecretRepos lists where a product repository that deploys sets the Cloudflare secret. A demo repository sets none.",
|
|
959
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",
|
|
960
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.",
|
|
961
|
-
"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)
|
|
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.",
|
|
962
1117
|
"stateBackend": {
|
|
963
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",
|
|
964
1119
|
"variable": [
|
|
@@ -1728,6 +1883,37 @@
|
|
|
1728
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."
|
|
1729
1884
|
}
|
|
1730
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
|
+
}
|
|
1731
1917
|
}
|
|
1732
1918
|
],
|
|
1733
1919
|
"when": {
|
|
@@ -1761,7 +1947,7 @@
|
|
|
1761
1947
|
],
|
|
1762
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",
|
|
1763
1949
|
"credentials": "Only the infra job reads CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. The release job does not",
|
|
1764
|
-
"enableCondition": "The infra job has
|
|
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.",
|
|
1765
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."
|
|
1766
1952
|
}
|
|
1767
1953
|
}
|
|
@@ -1900,6 +2086,41 @@
|
|
|
1900
2086
|
"prod": "The workflow deploys what is declared. Only deploy-prod.yml writes the prod declaration"
|
|
1901
2087
|
}
|
|
1902
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
|
+
}
|
|
1903
2124
|
}
|
|
1904
2125
|
],
|
|
1905
2126
|
"source": {
|
|
@@ -1926,7 +2147,7 @@
|
|
|
1926
2147
|
"https://developers.cloudflare.com/workers/wrangler/system-environment-variables/"
|
|
1927
2148
|
],
|
|
1928
2149
|
"readOn": "2026-11-06",
|
|
1929
|
-
"enableCondition": "
|
|
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.",
|
|
1930
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",
|
|
1931
2152
|
"jobs": [
|
|
1932
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",
|
|
@@ -3441,13 +3662,19 @@
|
|
|
3441
3662
|
"content": {
|
|
3442
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。"
|
|
3443
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
|
+
}
|
|
3444
3671
|
}
|
|
3445
3672
|
],
|
|
3446
3673
|
"source": {
|
|
3447
3674
|
"kind": "published"
|
|
3448
3675
|
},
|
|
3449
3676
|
"content": {
|
|
3450
|
-
"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
|
|
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 直接執行,要用變數控制是否部署時才自己加。"
|
|
3451
3678
|
}
|
|
3452
3679
|
},
|
|
3453
3680
|
{
|
|
@@ -4460,13 +4687,19 @@
|
|
|
4460
4687
|
"content": {
|
|
4461
4688
|
"statement": "套件單元在政策檔 `stages` 記下的每個階段都發布。npm 的 dist-tag 是階段名,ga 才是 `latest`。每個單元的版號必須屬於派送時帶的階段,不符就停下。登記中心上已有的版號略過,匯總套件是例外:已有的版號內容不同時停下,見 `facts-package-publish`。範本的發布 job 帶 `PUBLISH_ENABLED` 判斷,保留給示範倉與剛複製的倉,這些倉的變數不是 `true` 時發布 job 顯示 skipped,不寫登記中心。正式使用的倉移除這個判斷,發布 job 直接執行。只有要用變數控制是否發布時才保留判斷。"
|
|
4462
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
|
+
}
|
|
4463
4696
|
}
|
|
4464
4697
|
],
|
|
4465
4698
|
"source": {
|
|
4466
4699
|
"kind": "published"
|
|
4467
4700
|
},
|
|
4468
4701
|
"content": {
|
|
4469
|
-
"statement": "套件單元在政策檔 `stages` 記下的每個階段都發布。npm 的 dist-tag 是階段名,ga 才是 `latest`。每個單元的版號必須屬於派送時帶的階段,不符就停下。登記中心上已有的版號略過,匯總套件是例外:已有的版號內容不同時停下,見 `facts-package-publish
|
|
4702
|
+
"statement": "套件單元在政策檔 `stages` 記下的每個階段都發布。npm 的 dist-tag 是階段名,ga 才是 `latest`。每個單元的版號必須屬於派送時帶的階段,不符就停下。登記中心上已有的版號略過,匯總套件是例外:已有的版號內容不同時停下,見 `facts-package-publish`。範本是參考實作,發布 job 不帶判斷。判斷只在示範倉:示範倉的發布 job 帶 `PUBLISH_ENABLED` 判斷,由 compose 加進去,變數不是 `true` 時發布 job 顯示 skipped,不寫登記中心。示範倉不設這個變數,所以顯示 skipped。正式使用的倉不帶這個判斷,發布 job 直接執行,要用變數控制是否發布時才自己加。"
|
|
4470
4703
|
}
|
|
4471
4704
|
},
|
|
4472
4705
|
{
|
|
@@ -4632,13 +4865,19 @@
|
|
|
4632
4865
|
"content": {
|
|
4633
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)時不取,行為照舊。"
|
|
4634
4867
|
}
|
|
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
|
+
}
|
|
4635
4874
|
}
|
|
4636
4875
|
],
|
|
4637
4876
|
"source": {
|
|
4638
4877
|
"kind": "published"
|
|
4639
4878
|
},
|
|
4640
4879
|
"content": {
|
|
4641
|
-
"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
|
|
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)時不取,行為照舊。"
|
|
4642
4881
|
}
|
|
4643
4882
|
},
|
|
4644
4883
|
{
|
|
@@ -7925,7 +8164,7 @@
|
|
|
7925
8164
|
"merge"
|
|
7926
8165
|
],
|
|
7927
8166
|
"title": "自動合併 workflow",
|
|
7928
|
-
"description": "
|
|
8167
|
+
"description": "每個倉都跑一個做到本 fact 所列行為的 auto-merge workflow:PR 加上 label 與 CI workflow 跑完時觸發,每次重查最新 commit 的必要檢查,squash 並帶 `--match-head-commit`,不用 `--auto`。",
|
|
7929
8168
|
"variants": [
|
|
7930
8169
|
{
|
|
7931
8170
|
"since": "0.1.0",
|
|
@@ -7961,6 +8200,59 @@
|
|
|
7961
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."
|
|
7962
8201
|
}
|
|
7963
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
|
+
}
|
|
7964
8256
|
}
|
|
7965
8257
|
],
|
|
7966
8258
|
"source": {
|
|
@@ -7969,18 +8261,53 @@
|
|
|
7969
8261
|
"content": {
|
|
7970
8262
|
"value": {
|
|
7971
8263
|
"file": "auto-merge.yml",
|
|
7972
|
-
"
|
|
7973
|
-
"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.",
|
|
7974
8265
|
"ownWork": "The workflow merges the pull requests that carry the auto-merge label.",
|
|
8266
|
+
"label": "auto-merge",
|
|
7975
8267
|
"triggers": [
|
|
7976
|
-
"A pull request gets the auto-merge label.",
|
|
7977
|
-
"The CI workflow
|
|
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)."
|
|
7978
8270
|
],
|
|
7979
|
-
"
|
|
7980
|
-
"
|
|
7981
|
-
"
|
|
7982
|
-
|
|
7983
|
-
|
|
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"
|
|
8287
|
+
],
|
|
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
|
+
},
|
|
8306
|
+
"sameBranchOnly": "Only a pull request from a branch in the same repository is handled.",
|
|
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"
|
|
8309
|
+
}
|
|
8310
|
+
}
|
|
7984
8311
|
},
|
|
7985
8312
|
{
|
|
7986
8313
|
"id": "blueprint-shared.merge.required-checks",
|
|
@@ -8712,6 +9039,93 @@
|
|
|
8712
9039
|
}
|
|
8713
9040
|
}
|
|
8714
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
|
+
}
|
|
8715
9129
|
}
|
|
8716
9130
|
],
|
|
8717
9131
|
"source": {
|
|
@@ -8742,7 +9156,7 @@
|
|
|
8742
9156
|
"api"
|
|
8743
9157
|
],
|
|
8744
9158
|
"shared": {
|
|
8745
|
-
"meaning": "A shared unit is published on its own
|
|
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.",
|
|
8746
9160
|
"names": [
|
|
8747
9161
|
"<RepoName>-shared-facts",
|
|
8748
9162
|
"<RepoName>-shared-docs",
|
|
@@ -9954,6 +10368,117 @@
|
|
|
9954
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"
|
|
9955
10369
|
}
|
|
9956
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
|
+
}
|
|
9957
10482
|
}
|
|
9958
10483
|
],
|
|
9959
10484
|
"source": {
|
|
@@ -10062,7 +10587,7 @@
|
|
|
10062
10587
|
"https://github.com/actions/create-github-app-token"
|
|
10063
10588
|
],
|
|
10064
10589
|
"readOn": "2026-11-06",
|
|
10065
|
-
"enableCondition": "The build, publish, publish-github-packages and mirror jobs
|
|
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.",
|
|
10066
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",
|
|
10067
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"
|
|
10068
10593
|
}
|
|
@@ -13169,6 +13694,43 @@
|
|
|
13169
13694
|
]
|
|
13170
13695
|
}
|
|
13171
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
|
+
}
|
|
13172
13734
|
}
|
|
13173
13735
|
],
|
|
13174
13736
|
"source": {
|
|
@@ -13198,7 +13760,7 @@
|
|
|
13198
13760
|
{
|
|
13199
13761
|
"entry": "blueprint-shared-*",
|
|
13200
13762
|
"kind": "shared-packages",
|
|
13201
|
-
"meaning": "the shared packages blueprint-shared-facts, blueprint-shared-docs and blueprint-shared-templates, which
|
|
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"
|
|
13202
13764
|
}
|
|
13203
13765
|
],
|
|
13204
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",
|
|
@@ -13216,7 +13778,7 @@
|
|
|
13216
13778
|
"templates"
|
|
13217
13779
|
],
|
|
13218
13780
|
"title": "角色與每個角色帶的檔",
|
|
13219
|
-
"description": "七個角色各自的目錄、依賴、給哪種倉用,以及 base 與 release
|
|
13781
|
+
"description": "七個角色各自的目錄、依賴、給哪種倉用,以及 base 與 release 兩個角色帶的檔,是各角色規則的參考實作。其他五個角色的檔見各自的 fact。佔位符與 compose 是 blueprint 產生參考實作的做法,倉要符合的是欄位值。",
|
|
13220
13782
|
"variants": [
|
|
13221
13783
|
{
|
|
13222
13784
|
"since": "0.1.0",
|
|
@@ -13688,14 +14250,172 @@
|
|
|
13688
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."
|
|
13689
14251
|
}
|
|
13690
14252
|
}
|
|
13691
|
-
}
|
|
13692
|
-
|
|
13693
|
-
|
|
13694
|
-
|
|
13695
|
-
|
|
13696
|
-
|
|
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": {
|
|
13697
14417
|
"value": {
|
|
13698
|
-
"rule": "A role is a directory of the templates package. A
|
|
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.",
|
|
13699
14419
|
"roles": [
|
|
13700
14420
|
{
|
|
13701
14421
|
"role": "base",
|
|
@@ -14607,6 +15327,88 @@
|
|
|
14607
15327
|
]
|
|
14608
15328
|
}
|
|
14609
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
|
+
}
|
|
14610
15412
|
}
|
|
14611
15413
|
],
|
|
14612
15414
|
"source": {
|
|
@@ -14662,11 +15464,11 @@
|
|
|
14662
15464
|
},
|
|
14663
15465
|
{
|
|
14664
15466
|
"path": "scripts/",
|
|
14665
|
-
"holds": "governance scripts
|
|
15467
|
+
"holds": "governance scripts: commit and pull request checks, release scripts and local hooks (what a repository needs is in blueprint-shared.templates.*)"
|
|
14666
15468
|
},
|
|
14667
15469
|
{
|
|
14668
15470
|
"path": ".github/workflows/",
|
|
14669
|
-
"holds": "workflows
|
|
15471
|
+
"holds": "the workflows of the repository: CI, auto-merge, release and, where the repository publishes or deploys, publish and deploy"
|
|
14670
15472
|
},
|
|
14671
15473
|
{
|
|
14672
15474
|
"path": "release-please-config.json",
|
|
@@ -14937,6 +15739,28 @@
|
|
|
14937
15739
|
]
|
|
14938
15740
|
}
|
|
14939
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
|
+
}
|
|
14940
15764
|
}
|
|
14941
15765
|
],
|
|
14942
15766
|
"source": {
|
|
@@ -14948,7 +15772,7 @@
|
|
|
14948
15772
|
"meaning": "The repository-level retention of artifacts and logs is 7 days.",
|
|
14949
15773
|
"repositories": "Every repository sets it explicitly, before it first creates artifacts or logs.",
|
|
14950
15774
|
"api": "PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention",
|
|
14951
|
-
"setBy": "the repository settings script
|
|
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.",
|
|
14952
15776
|
"effect": "The setting only applies to what is created afterwards.",
|
|
14953
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.",
|
|
14954
15778
|
"notSet": [
|
|
@@ -14957,7 +15781,8 @@
|
|
|
14957
15781
|
],
|
|
14958
15782
|
"platformFacts": [
|
|
14959
15783
|
"github-actions.artifact-retention-days"
|
|
14960
|
-
]
|
|
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."
|
|
14961
15786
|
}
|
|
14962
15787
|
}
|
|
14963
15788
|
},
|
|
@@ -14968,7 +15793,7 @@
|
|
|
14968
15793
|
"retention"
|
|
14969
15794
|
],
|
|
14970
15795
|
"title": "上傳 artifact 的保留天數",
|
|
14971
|
-
"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 天。",
|
|
14972
15797
|
"variants": [
|
|
14973
15798
|
{
|
|
14974
15799
|
"since": "0.1.0",
|
|
@@ -14993,6 +15818,30 @@
|
|
|
14993
15818
|
]
|
|
14994
15819
|
}
|
|
14995
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
|
+
}
|
|
14996
15845
|
}
|
|
14997
15846
|
],
|
|
14998
15847
|
"source": {
|
|
@@ -15005,7 +15854,7 @@
|
|
|
15005
15854
|
{
|
|
15006
15855
|
"artifact": "trusted-publishing-build",
|
|
15007
15856
|
"days": 1,
|
|
15008
|
-
"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.
|
|
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"
|
|
15009
15858
|
},
|
|
15010
15859
|
{
|
|
15011
15860
|
"artifact": "other",
|
|
@@ -15042,6 +15891,20 @@
|
|
|
15042
15891
|
"cleanedBy": "blueprint-shared.templates.private-package-cleanup"
|
|
15043
15892
|
}
|
|
15044
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
|
+
}
|
|
15045
15908
|
}
|
|
15046
15909
|
],
|
|
15047
15910
|
"source": {
|
|
@@ -15050,7 +15913,7 @@
|
|
|
15050
15913
|
"content": {
|
|
15051
15914
|
"value": {
|
|
15052
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.",
|
|
15053
|
-
"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.
|
|
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.",
|
|
15054
15917
|
"noGaVersion": "A package with no GA version keeps every version.",
|
|
15055
15918
|
"exceptions": "None. A version that a repository still references is deleted like any other older version.",
|
|
15056
15919
|
"restore": "A deleted version can be restored within 30 days.",
|
|
@@ -15590,24 +16453,252 @@
|
|
|
15590
16453
|
}
|
|
15591
16454
|
}
|
|
15592
16455
|
}
|
|
15593
|
-
],
|
|
15594
|
-
"source": {
|
|
15595
|
-
"kind": "published"
|
|
15596
|
-
},
|
|
15597
|
-
"content": {
|
|
15598
|
-
"value": {
|
|
15599
|
-
"dir": "ops/workloads/templates/",
|
|
15600
|
-
"environments": [
|
|
15601
|
-
"dev",
|
|
15602
|
-
"stg",
|
|
15603
|
-
"prod"
|
|
15604
|
-
],
|
|
15605
|
-
"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$",
|
|
15606
|
-
"form": "ops/workloads/templates/<environment>/<product>/<unit>.yml",
|
|
15607
|
-
"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.",
|
|
15608
|
-
"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.",
|
|
15609
|
-
"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/."
|
|
15610
|
-
}
|
|
16456
|
+
],
|
|
16457
|
+
"source": {
|
|
16458
|
+
"kind": "published"
|
|
16459
|
+
},
|
|
16460
|
+
"content": {
|
|
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
|
+
}
|
|
16701
|
+
}
|
|
15611
16702
|
}
|
|
15612
16703
|
},
|
|
15613
16704
|
{
|
|
@@ -15617,7 +16708,7 @@
|
|
|
15617
16708
|
"secrets"
|
|
15618
16709
|
],
|
|
15619
16710
|
"title": "單元的 env 宣告格式",
|
|
15620
|
-
"description": "單元在程式倉宣告需要哪些環境變數,只寫名稱與類別(`kind`)、是否必填(`required
|
|
16711
|
+
"description": "單元在程式倉宣告需要哪些環境變數,只寫名稱與類別(`kind`)、是否必填(`required`)、預設值(`default`)、值是否交給程式成檔案(選填的 `file`,預設 false)和選填的說明(`description`,寫這個環境變數給程式做什麼),不寫值也不寫路徑,跟著單元發版。密鑰本身的用途寫在組態倉的密鑰清單,兩者不重複。",
|
|
15621
16712
|
"variants": [
|
|
15622
16713
|
{
|
|
15623
16714
|
"since": "0.6.0",
|
|
@@ -15663,6 +16754,109 @@
|
|
|
15663
16754
|
}
|
|
15664
16755
|
}
|
|
15665
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
|
+
}
|
|
16806
|
+
},
|
|
16807
|
+
{
|
|
16808
|
+
"since": "0.10.0",
|
|
16809
|
+
"content": {
|
|
16810
|
+
"schema": {
|
|
16811
|
+
"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.",
|
|
16812
|
+
"type": "object",
|
|
16813
|
+
"required": [
|
|
16814
|
+
"env"
|
|
16815
|
+
],
|
|
16816
|
+
"additionalProperties": false,
|
|
16817
|
+
"properties": {
|
|
16818
|
+
"env": {
|
|
16819
|
+
"type": "object",
|
|
16820
|
+
"propertyNames": {
|
|
16821
|
+
"pattern": "^[A-Z][A-Z0-9_]*$"
|
|
16822
|
+
},
|
|
16823
|
+
"additionalProperties": {
|
|
16824
|
+
"type": "object",
|
|
16825
|
+
"required": [
|
|
16826
|
+
"kind"
|
|
16827
|
+
],
|
|
16828
|
+
"additionalProperties": false,
|
|
16829
|
+
"properties": {
|
|
16830
|
+
"kind": {
|
|
16831
|
+
"enum": [
|
|
16832
|
+
"secret",
|
|
16833
|
+
"config"
|
|
16834
|
+
],
|
|
16835
|
+
"description": "secret: the value comes from the secret service. config: the value comes from the template"
|
|
16836
|
+
},
|
|
16837
|
+
"required": {
|
|
16838
|
+
"type": "boolean",
|
|
16839
|
+
"description": "true: when the template gives no value the middleware returns an error that names the variable"
|
|
16840
|
+
},
|
|
16841
|
+
"default": {
|
|
16842
|
+
"type": "string",
|
|
16843
|
+
"description": "the value used when the template gives none"
|
|
16844
|
+
},
|
|
16845
|
+
"description": {
|
|
16846
|
+
"type": "string",
|
|
16847
|
+
"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"
|
|
16848
|
+
},
|
|
16849
|
+
"file": {
|
|
16850
|
+
"type": "boolean",
|
|
16851
|
+
"default": false,
|
|
16852
|
+
"description": "optional: true means the value is handed to the program as a file. The value is returned in base64 when fetched, and the command tool decodes it into a temporary file"
|
|
16853
|
+
}
|
|
16854
|
+
}
|
|
16855
|
+
}
|
|
16856
|
+
}
|
|
16857
|
+
}
|
|
16858
|
+
}
|
|
16859
|
+
}
|
|
15666
16860
|
}
|
|
15667
16861
|
],
|
|
15668
16862
|
"source": {
|
|
@@ -15703,6 +16897,15 @@
|
|
|
15703
16897
|
"default": {
|
|
15704
16898
|
"type": "string",
|
|
15705
16899
|
"description": "the value used when the template gives none"
|
|
16900
|
+
},
|
|
16901
|
+
"description": {
|
|
16902
|
+
"type": "string",
|
|
16903
|
+
"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"
|
|
16904
|
+
},
|
|
16905
|
+
"file": {
|
|
16906
|
+
"type": "boolean",
|
|
16907
|
+
"default": false,
|
|
16908
|
+
"description": "optional: true means the value is handed to the program as a file. The value is returned in base64 when fetched, and the command tool decodes it into a temporary file"
|
|
15706
16909
|
}
|
|
15707
16910
|
}
|
|
15708
16911
|
}
|
|
@@ -15944,7 +17147,7 @@
|
|
|
15944
17147
|
"secrets"
|
|
15945
17148
|
],
|
|
15946
17149
|
"title": "身分與權限規則",
|
|
15947
|
-
"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`。",
|
|
17150
|
+
"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`。",
|
|
15948
17151
|
"variants": [
|
|
15949
17152
|
{
|
|
15950
17153
|
"since": "0.6.0",
|
|
@@ -15993,6 +17196,33 @@
|
|
|
15993
17196
|
}
|
|
15994
17197
|
}
|
|
15995
17198
|
}
|
|
17199
|
+
},
|
|
17200
|
+
{
|
|
17201
|
+
"since": "0.9.0",
|
|
17202
|
+
"content": {
|
|
17203
|
+
"value": {
|
|
17204
|
+
"default": "Deny. A path no policy allows cannot be read.",
|
|
17205
|
+
"roles": [
|
|
17206
|
+
"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.",
|
|
17207
|
+
"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."
|
|
17208
|
+
],
|
|
17209
|
+
"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).",
|
|
17210
|
+
"github": [
|
|
17211
|
+
"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.",
|
|
17212
|
+
"Every JWT role sets bound_audiences, because the secret service refuses a login whose token has an aud when the role sets none."
|
|
17213
|
+
],
|
|
17214
|
+
"token": "The token that CI gets lives 10 minutes, is not renewed, and is revoked by the middleware after use.",
|
|
17215
|
+
"audit": "At least two audit devices, because the secret service stops answering when all of them fail.",
|
|
17216
|
+
"root": "No root token is kept.",
|
|
17217
|
+
"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.",
|
|
17218
|
+
"identityTemplate": {
|
|
17219
|
+
"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.",
|
|
17220
|
+
"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.",
|
|
17221
|
+
"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.",
|
|
17222
|
+
"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)."
|
|
17223
|
+
}
|
|
17224
|
+
}
|
|
17225
|
+
}
|
|
15996
17226
|
}
|
|
15997
17227
|
],
|
|
15998
17228
|
"source": {
|
|
@@ -16005,7 +17235,7 @@
|
|
|
16005
17235
|
"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.",
|
|
16006
17236
|
"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."
|
|
16007
17237
|
],
|
|
16008
|
-
"values": "The value of a secret is written by a person only. IaC and CI manage namespaces, mounts, roles, policies and
|
|
17238
|
+
"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).",
|
|
16009
17239
|
"github": [
|
|
16010
17240
|
"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.",
|
|
16011
17241
|
"Every JWT role sets bound_audiences, because the secret service refuses a login whose token has an aud when the role sets none."
|
|
@@ -16023,6 +17253,115 @@
|
|
|
16023
17253
|
}
|
|
16024
17254
|
}
|
|
16025
17255
|
},
|
|
17256
|
+
{
|
|
17257
|
+
"id": "blueprint-shared.secrets.metadata-access",
|
|
17258
|
+
"tool": "blueprint-shared",
|
|
17259
|
+
"topics": [
|
|
17260
|
+
"secrets"
|
|
17261
|
+
],
|
|
17262
|
+
"title": "兩種角色在 kv/data 與 kv/metadata 的權限",
|
|
17263
|
+
"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 預覽用的唯讀角色不在這筆。",
|
|
17264
|
+
"variants": [
|
|
17265
|
+
{
|
|
17266
|
+
"since": "0.9.0",
|
|
17267
|
+
"content": {
|
|
17268
|
+
"value": {
|
|
17269
|
+
"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.",
|
|
17270
|
+
"roles": [
|
|
17271
|
+
{
|
|
17272
|
+
"role": "sync",
|
|
17273
|
+
"who": "the CI of the configuration repository, through the sync subcommand of the CLI",
|
|
17274
|
+
"kvData": [],
|
|
17275
|
+
"kvMetadata": [
|
|
17276
|
+
"create",
|
|
17277
|
+
"update",
|
|
17278
|
+
"patch",
|
|
17279
|
+
"read",
|
|
17280
|
+
"list"
|
|
17281
|
+
],
|
|
17282
|
+
"notGiven": "delete on kv/metadata/*, and every capability on kv/data/*"
|
|
17283
|
+
},
|
|
17284
|
+
{
|
|
17285
|
+
"role": "person",
|
|
17286
|
+
"who": "a person who writes values, logged in by OIDC",
|
|
17287
|
+
"kvData": [
|
|
17288
|
+
"create",
|
|
17289
|
+
"read",
|
|
17290
|
+
"update",
|
|
17291
|
+
"patch",
|
|
17292
|
+
"delete"
|
|
17293
|
+
],
|
|
17294
|
+
"kvMetadata": [
|
|
17295
|
+
"read",
|
|
17296
|
+
"list",
|
|
17297
|
+
"delete"
|
|
17298
|
+
],
|
|
17299
|
+
"notGiven": "create, update and patch on kv/metadata/*"
|
|
17300
|
+
}
|
|
17301
|
+
],
|
|
17302
|
+
"rules": [
|
|
17303
|
+
"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/*.",
|
|
17304
|
+
"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.",
|
|
17305
|
+
"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.",
|
|
17306
|
+
"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.",
|
|
17307
|
+
"The human role reads and lists kv/metadata/* to see the description and the number of versions before it deletes a path.",
|
|
17308
|
+
"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.",
|
|
17309
|
+
"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."
|
|
17310
|
+
]
|
|
17311
|
+
}
|
|
17312
|
+
}
|
|
17313
|
+
}
|
|
17314
|
+
],
|
|
17315
|
+
"source": {
|
|
17316
|
+
"kind": "published"
|
|
17317
|
+
},
|
|
17318
|
+
"content": {
|
|
17319
|
+
"value": {
|
|
17320
|
+
"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.",
|
|
17321
|
+
"roles": [
|
|
17322
|
+
{
|
|
17323
|
+
"role": "sync",
|
|
17324
|
+
"who": "the CI of the configuration repository, through the sync subcommand of the CLI",
|
|
17325
|
+
"kvData": [],
|
|
17326
|
+
"kvMetadata": [
|
|
17327
|
+
"create",
|
|
17328
|
+
"update",
|
|
17329
|
+
"patch",
|
|
17330
|
+
"read",
|
|
17331
|
+
"list"
|
|
17332
|
+
],
|
|
17333
|
+
"notGiven": "delete on kv/metadata/*, and every capability on kv/data/*"
|
|
17334
|
+
},
|
|
17335
|
+
{
|
|
17336
|
+
"role": "person",
|
|
17337
|
+
"who": "a person who writes values, logged in by OIDC",
|
|
17338
|
+
"kvData": [
|
|
17339
|
+
"create",
|
|
17340
|
+
"read",
|
|
17341
|
+
"update",
|
|
17342
|
+
"patch",
|
|
17343
|
+
"delete"
|
|
17344
|
+
],
|
|
17345
|
+
"kvMetadata": [
|
|
17346
|
+
"read",
|
|
17347
|
+
"list",
|
|
17348
|
+
"delete"
|
|
17349
|
+
],
|
|
17350
|
+
"notGiven": "create, update and patch on kv/metadata/*"
|
|
17351
|
+
}
|
|
17352
|
+
],
|
|
17353
|
+
"rules": [
|
|
17354
|
+
"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/*.",
|
|
17355
|
+
"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.",
|
|
17356
|
+
"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.",
|
|
17357
|
+
"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.",
|
|
17358
|
+
"The human role reads and lists kv/metadata/* to see the description and the number of versions before it deletes a path.",
|
|
17359
|
+
"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.",
|
|
17360
|
+
"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."
|
|
17361
|
+
]
|
|
17362
|
+
}
|
|
17363
|
+
}
|
|
17364
|
+
},
|
|
16026
17365
|
{
|
|
16027
17366
|
"id": "blueprint-shared.secrets.login-methods",
|
|
16028
17367
|
"tool": "blueprint-shared",
|
|
@@ -17560,7 +18899,7 @@
|
|
|
17560
18899
|
"templates"
|
|
17561
18900
|
],
|
|
17562
18901
|
"title": "GitHub App 的名稱與設定名稱",
|
|
17563
|
-
"description": "合併與 release-please 用一個 GitHub App 的權杖。App 的名稱、存 client id 的 variable 名稱與存私鑰的 secret 名稱都由使用範本的組織自己決定,欄位說明見 `blueprint-shared.templates.fields`。範本檔只寫佔位符,組裝時寫入名稱。放在哪一層見 `blueprint-shared.templates.github-app-placement
|
|
18902
|
+
"description": "合併與 release-please 用一個 GitHub App 的權杖。App 的名稱、存 client id 的 variable 名稱與存私鑰的 secret 名稱都由使用範本的組織自己決定,欄位說明見 `blueprint-shared.templates.fields`。範本檔只寫佔位符,組裝時寫入名稱。放在哪一層見 `blueprint-shared.templates.github-app-placement`。佔位符與 compose 是 blueprint 產生參考實作的做法,倉要符合的是名稱的值。",
|
|
17564
18903
|
"variants": [
|
|
17565
18904
|
{
|
|
17566
18905
|
"since": "0.1.0",
|
|
@@ -17611,7 +18950,7 @@
|
|
|
17611
18950
|
"templates"
|
|
17612
18951
|
],
|
|
17613
18952
|
"title": "自動合併 workflow 範本",
|
|
17614
|
-
"description": "
|
|
18953
|
+
"description": "範本是 `merge.workflow` 規則的一個參考實作,只描述它的檔案路徑與佔位符。判斷邏輯在 `decide.mjs`,workflow 只負責讀 PR 與檢查、呼叫它、再依輸出合併。必要檢查與 label 在組裝時寫進 `scripts/merge/merge-config.json`。",
|
|
17615
18954
|
"variants": [
|
|
17616
18955
|
{
|
|
17617
18956
|
"since": "0.1.0",
|
|
@@ -17701,6 +19040,56 @@
|
|
|
17701
19040
|
}
|
|
17702
19041
|
}
|
|
17703
19042
|
}
|
|
19043
|
+
},
|
|
19044
|
+
{
|
|
19045
|
+
"since": "0.9.0",
|
|
19046
|
+
"content": {
|
|
19047
|
+
"value": {
|
|
19048
|
+
"file": "base/.github/workflows/auto-merge.yml",
|
|
19049
|
+
"role": "base",
|
|
19050
|
+
"decideScript": "base/scripts/merge/decide.mjs",
|
|
19051
|
+
"configFile": "scripts/merge/merge-config.json",
|
|
19052
|
+
"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)",
|
|
19053
|
+
"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.",
|
|
19054
|
+
"label": "auto-merge",
|
|
19055
|
+
"triggers": [
|
|
19056
|
+
{
|
|
19057
|
+
"event": "pull_request_target",
|
|
19058
|
+
"types": [
|
|
19059
|
+
"labeled"
|
|
19060
|
+
]
|
|
19061
|
+
},
|
|
19062
|
+
{
|
|
19063
|
+
"event": "workflow_run",
|
|
19064
|
+
"workflows": [
|
|
19065
|
+
"ci",
|
|
19066
|
+
"pr-message"
|
|
19067
|
+
],
|
|
19068
|
+
"types": [
|
|
19069
|
+
"completed"
|
|
19070
|
+
]
|
|
19071
|
+
}
|
|
19072
|
+
],
|
|
19073
|
+
"jobs": [
|
|
19074
|
+
"decide",
|
|
19075
|
+
"merge"
|
|
19076
|
+
],
|
|
19077
|
+
"actions": [
|
|
19078
|
+
"merge",
|
|
19079
|
+
"skip"
|
|
19080
|
+
],
|
|
19081
|
+
"mergeCommand": "gh pr merge <number> --squash --match-head-commit <sha> --delete-branch",
|
|
19082
|
+
"valuesFrom": [
|
|
19083
|
+
"blueprint-shared.merge.workflow",
|
|
19084
|
+
"blueprint-shared.merge.required-checks",
|
|
19085
|
+
"blueprint-shared.merge.method",
|
|
19086
|
+
"blueprint-shared.merge.fork",
|
|
19087
|
+
"blueprint-shared.merge.release-pr"
|
|
19088
|
+
],
|
|
19089
|
+
"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.",
|
|
19090
|
+
"labelPlaceholder": "The template holds the placeholder @@mergeLabel@@ where the label goes, and scripts/merge/merge-config.json gets the same label."
|
|
19091
|
+
}
|
|
19092
|
+
}
|
|
17704
19093
|
}
|
|
17705
19094
|
],
|
|
17706
19095
|
"source": {
|
|
@@ -17712,9 +19101,8 @@
|
|
|
17712
19101
|
"role": "base",
|
|
17713
19102
|
"decideScript": "base/scripts/merge/decide.mjs",
|
|
17714
19103
|
"configFile": "scripts/merge/merge-config.json",
|
|
17715
|
-
"configFrom": "blueprint-shared.merge.required-checks, blueprint-shared.git-flow.review-paths and the
|
|
17716
|
-
"reviewGate": "A pull request that changes one of config.reviewPaths is skipped until a review approves it and none asks for changes. A
|
|
17717
|
-
"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.",
|
|
19104
|
+
"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)",
|
|
19105
|
+
"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.",
|
|
17718
19106
|
"label": "auto-merge",
|
|
17719
19107
|
"triggers": [
|
|
17720
19108
|
{
|
|
@@ -17743,18 +19131,6 @@
|
|
|
17743
19131
|
"skip"
|
|
17744
19132
|
],
|
|
17745
19133
|
"mergeCommand": "gh pr merge <number> --squash --match-head-commit <sha> --delete-branch",
|
|
17746
|
-
"skipWhen": [
|
|
17747
|
-
"the pull request is not open",
|
|
17748
|
-
"the pull request comes from a fork",
|
|
17749
|
-
"the pull request has no auto-merge label",
|
|
17750
|
-
"the pull request is a draft",
|
|
17751
|
-
"a commit was pushed after the checks were read",
|
|
17752
|
-
"a required check failed or was cancelled",
|
|
17753
|
-
"a required check is still running",
|
|
17754
|
-
"a required check has not run",
|
|
17755
|
-
"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"
|
|
17756
|
-
],
|
|
17757
|
-
"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).",
|
|
17758
19134
|
"valuesFrom": [
|
|
17759
19135
|
"blueprint-shared.merge.workflow",
|
|
17760
19136
|
"blueprint-shared.merge.required-checks",
|
|
@@ -17762,34 +19138,8 @@
|
|
|
17762
19138
|
"blueprint-shared.merge.fork",
|
|
17763
19139
|
"blueprint-shared.merge.release-pr"
|
|
17764
19140
|
],
|
|
17765
|
-
"
|
|
17766
|
-
"
|
|
17767
|
-
"mergeRetry": {
|
|
17768
|
-
"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.",
|
|
17769
|
-
"attempts": 5,
|
|
17770
|
-
"intervalSeconds": 3,
|
|
17771
|
-
"lastAttempt": "The fifth attempt that gets the same error fails the job with the gh exit status.",
|
|
17772
|
-
"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.",
|
|
17773
|
-
"where": "The run script of the merge job, so the repositories get it through the template."
|
|
17774
|
-
},
|
|
17775
|
-
"noChecksYet": {
|
|
17776
|
-
"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).",
|
|
17777
|
-
"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.",
|
|
17778
|
-
"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 [].",
|
|
17779
|
-
"where": "The decide job, so the repositories get it through the template."
|
|
17780
|
-
},
|
|
17781
|
-
"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.",
|
|
17782
|
-
"concurrency": {
|
|
17783
|
-
"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.",
|
|
17784
|
-
"merge": "auto-merge-merge-<pull request number>, cancel-in-progress false: a merge is never cancelled halfway.",
|
|
17785
|
-
"decision": "auto-merge-skip-and-cancel"
|
|
17786
|
-
},
|
|
17787
|
-
"skipOtherLabelsAndReleasePr": {
|
|
17788
|
-
"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.",
|
|
17789
|
-
"releasePrBranchPrefix": "release-please--",
|
|
17790
|
-
"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.",
|
|
17791
|
-
"decision": "auto-merge-label-and-release-pr-filter"
|
|
17792
|
-
}
|
|
19141
|
+
"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.",
|
|
19142
|
+
"labelPlaceholder": "The template holds the placeholder @@mergeLabel@@ where the label goes, and scripts/merge/merge-config.json gets the same label."
|
|
17793
19143
|
}
|
|
17794
19144
|
}
|
|
17795
19145
|
},
|
|
@@ -18545,7 +19895,7 @@
|
|
|
18545
19895
|
"templates"
|
|
18546
19896
|
],
|
|
18547
19897
|
"title": "範本的組織欄位",
|
|
18548
|
-
"description": "範本裡要由使用的組織自己填的值:GitHub App 的 client id variable 名稱與私鑰 secret 名稱、auto-merge 的 label、npm scope、授權的版權人,以及 ops 回寫 commit 作者用的 App bot 名稱與 user id。org 角色的 README 另用組織名、倉名、facts 匯總套件名與 registry
|
|
19898
|
+
"description": "範本裡要由使用的組織自己填的值:GitHub App 的 client id variable 名稱與私鑰 secret 名稱、auto-merge 的 label、npm scope、授權的版權人,以及 ops 回寫 commit 作者用的 App bot 名稱與 user id。org 角色的 README 另用組織名、倉名、facts 匯總套件名與 registry 名稱。每個欄位寫名稱、說明、範本裡的形式,以及用在哪些範本檔。佔位符與 compose 是 blueprint 產生參考實作的做法,倉要符合的是欄位的值。",
|
|
18549
19899
|
"variants": [
|
|
18550
19900
|
{
|
|
18551
19901
|
"since": "0.1.0",
|