blueprint-shared-facts 0.1.0 → 0.3.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 +277 -9
- package/package.json +2 -2
|
@@ -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.3.0"
|
|
8
8
|
},
|
|
9
9
|
"layer": "org",
|
|
10
10
|
"facts": [
|
|
@@ -453,6 +453,104 @@
|
|
|
453
453
|
"enableCondition": "The cloudflare field says which repository holds the Cloudflare credentials, not which one deploys. The deploy jobs of the deploy, infra and ops roles have a vars.DEPLOY_ENABLED == 'true' condition for the demo repositories and for a repository just copied from the template, where the variable is unset and nothing goes online. A repository in real use removes the condition, and keeps it only to control when deploying runs. A product with a deploy-role repository and an ops repository that keeps it sets the variable in both."
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"since": "0.2.0",
|
|
459
|
+
"content": {
|
|
460
|
+
"value": {
|
|
461
|
+
"rule": "Only the repositories that put Workers online hold the Cloudflare credentials. A repository uses them only while its deploy jobs run, and the template gives those jobs a vars.DEPLOY_ENABLED condition for the demo repositories and for a repository just copied from it. A repository in real use removes the condition, and keeps it only to control when deploying runs. Every other repository builds, hands a bundle over and writes a declaration.",
|
|
462
|
+
"repos": [
|
|
463
|
+
{
|
|
464
|
+
"kind": "single repository of a monorepo product",
|
|
465
|
+
"roles": [
|
|
466
|
+
"deploy",
|
|
467
|
+
"infra",
|
|
468
|
+
"ops",
|
|
469
|
+
"verify"
|
|
470
|
+
],
|
|
471
|
+
"does": "the release flow of a poly product in one repository: the infra job applies the R2 buckets of its InfraName unit (a prerelease tag to the stage's environment, a product tag to production, before the build), 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 puts it online, and verify-production.yml, started by hand, checks the production declaration against the Release Plan",
|
|
472
|
+
"cloudflare": true
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"kind": "app repository of a poly product",
|
|
476
|
+
"roles": [
|
|
477
|
+
"deploy"
|
|
478
|
+
],
|
|
479
|
+
"does": "builds, attaches the bundle and its hash to its own GitHub Release, writes the declaration into the ops repository",
|
|
480
|
+
"cloudflare": false
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"kind": "service repository of a poly product",
|
|
484
|
+
"roles": [
|
|
485
|
+
"deploy"
|
|
486
|
+
],
|
|
487
|
+
"does": "builds, attaches the bundle and its hash to its own GitHub Release, writes the declaration into the ops repository",
|
|
488
|
+
"cloudflare": false
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"kind": "ops repository of a poly product",
|
|
492
|
+
"roles": [
|
|
493
|
+
"ops"
|
|
494
|
+
],
|
|
495
|
+
"does": "holds ops/versions.json and ops/urls.json (the URL patterns its ops unit publishes) and puts the declared bundles online on every push to main. Its own tags publish its facts package only, they deploy nothing",
|
|
496
|
+
"cloudflare": true
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"kind": "infra repository of a poly product",
|
|
500
|
+
"roles": [
|
|
501
|
+
"infra"
|
|
502
|
+
],
|
|
503
|
+
"does": "applies the R2 buckets that its unit declares: a prerelease tag of the unit creates the buckets of the stage's environment, a product tag creates the buckets of production, a merge to main applies nothing",
|
|
504
|
+
"cloudflare": true
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"kind": "hub repository of a poly product",
|
|
508
|
+
"roles": [
|
|
509
|
+
"hub",
|
|
510
|
+
"verify"
|
|
511
|
+
],
|
|
512
|
+
"does": "holds the Release Plans, opens the release line of the member repositories, and after a product release checks the production declaration of the ops repository against the unit versions of the Release Plan (verify-production.yml). No Cloudflare credential",
|
|
513
|
+
"cloudflare": false
|
|
514
|
+
}
|
|
515
|
+
],
|
|
516
|
+
"cloudflareSecretRepos": [
|
|
517
|
+
"single repository of a monorepo product",
|
|
518
|
+
"ops repository of a poly product",
|
|
519
|
+
"infra repository of a poly product"
|
|
520
|
+
],
|
|
521
|
+
"cloudflareNames": {
|
|
522
|
+
"secret": [
|
|
523
|
+
"CLOUDFLARE_API_TOKEN"
|
|
524
|
+
],
|
|
525
|
+
"variable": [
|
|
526
|
+
"CLOUDFLARE_ACCOUNT_ID"
|
|
527
|
+
]
|
|
528
|
+
},
|
|
529
|
+
"otherVariables": [
|
|
530
|
+
{
|
|
531
|
+
"name": "OPS_REPO",
|
|
532
|
+
"repos": [
|
|
533
|
+
"app repository of a poly product",
|
|
534
|
+
"service repository of a poly product",
|
|
535
|
+
"hub repository of a poly product"
|
|
536
|
+
],
|
|
537
|
+
"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-production.yml); the same workflow in the single repository has it unset and reads ops/versions.json of its own repository"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"name": "BUNDLE_REPOS",
|
|
541
|
+
"repos": [
|
|
542
|
+
"ops repository of a poly product"
|
|
543
|
+
],
|
|
544
|
+
"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"
|
|
545
|
+
}
|
|
546
|
+
],
|
|
547
|
+
"consumedBy": "the roles of a composed repository must follow this fact, and the Cloudflare credentials are read only by the infra job of the two workflows that the deploy and infra roles share, and by ops/",
|
|
548
|
+
"referencedBy": "cloudflareSecretRepos lists where a product repository that deploys sets the Cloudflare secret. A demo repository sets none.",
|
|
549
|
+
"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",
|
|
550
|
+
"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.",
|
|
551
|
+
"enableCondition": "The cloudflare field says which repository holds the Cloudflare credentials, not which one deploys. The deploy jobs of the deploy, infra and ops roles have a vars.DEPLOY_ENABLED == 'true' condition for the demo repositories and for a repository just copied from the template, where the variable is unset and nothing goes online. A repository whose roles are all of one kind needs no other field for it. A repository in real use removes the condition, and keeps it only to control when deploying runs. A product with a deploy-role repository and an ops repository that keeps it sets the variable in both."
|
|
552
|
+
}
|
|
553
|
+
}
|
|
456
554
|
}
|
|
457
555
|
],
|
|
458
556
|
"source": {
|
|
@@ -550,7 +648,7 @@
|
|
|
550
648
|
"referencedBy": "cloudflareSecretRepos lists where a product repository that deploys sets the Cloudflare secret. A demo repository sets none.",
|
|
551
649
|
"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",
|
|
552
650
|
"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.",
|
|
553
|
-
"enableCondition": "The cloudflare field says which repository holds the Cloudflare credentials, not which one deploys. The deploy jobs of the deploy, infra and ops roles have a vars.DEPLOY_ENABLED == 'true' condition for the demo repositories and for a repository just copied from the template, where the variable is unset and nothing goes online. A repository in real use removes the condition, and keeps it only to control when deploying runs. A product with a deploy-role repository and an ops repository that keeps it sets the variable in both."
|
|
651
|
+
"enableCondition": "The cloudflare field says which repository holds the Cloudflare credentials, not which one deploys. The deploy jobs of the deploy, infra and ops roles have a vars.DEPLOY_ENABLED == 'true' condition for the demo repositories and for a repository just copied from the template, where the variable is unset and nothing goes online. A repository whose roles are all of one kind needs no other field for it. A repository in real use removes the condition, and keeps it only to control when deploying runs. A product with a deploy-role repository and an ops repository that keeps it sets the variable in both."
|
|
554
652
|
}
|
|
555
653
|
}
|
|
556
654
|
},
|
|
@@ -4512,6 +4610,99 @@
|
|
|
4512
4610
|
"additionalProperties": false
|
|
4513
4611
|
}
|
|
4514
4612
|
}
|
|
4613
|
+
},
|
|
4614
|
+
{
|
|
4615
|
+
"since": "0.3.0",
|
|
4616
|
+
"content": {
|
|
4617
|
+
"schema": {
|
|
4618
|
+
"type": "object",
|
|
4619
|
+
"description": "The values an organization gives for the facts of blueprint-shared that list field names in `orgValues`. Every field a shared fact lists is a property here, and no other field is allowed.",
|
|
4620
|
+
"properties": {
|
|
4621
|
+
"mergeBotApp": {
|
|
4622
|
+
"type": "string",
|
|
4623
|
+
"description": "The name of the GitHub App whose installation token the auto-merge workflow uses (blueprint-shared.merge.token)."
|
|
4624
|
+
},
|
|
4625
|
+
"privateRepoRunner": {
|
|
4626
|
+
"type": "string",
|
|
4627
|
+
"description": "The kind of runner that the build and deploy jobs of a private repository run on, for example self-hosted."
|
|
4628
|
+
},
|
|
4629
|
+
"selfHostedRunnerLabels": {
|
|
4630
|
+
"type": "object",
|
|
4631
|
+
"description": "The runs-on labels of a self-hosted runner. Needed only when privateRepoRunner is self-hosted.",
|
|
4632
|
+
"properties": {
|
|
4633
|
+
"default": {
|
|
4634
|
+
"type": "string",
|
|
4635
|
+
"description": "The label of a job that has no special need, and of the build job of publish.yml."
|
|
4636
|
+
},
|
|
4637
|
+
"docker": {
|
|
4638
|
+
"type": "string",
|
|
4639
|
+
"description": "The label of a job that needs docker."
|
|
4640
|
+
},
|
|
4641
|
+
"swift": {
|
|
4642
|
+
"type": "string",
|
|
4643
|
+
"description": "The label of a swift job."
|
|
4644
|
+
}
|
|
4645
|
+
},
|
|
4646
|
+
"required": [
|
|
4647
|
+
"default"
|
|
4648
|
+
],
|
|
4649
|
+
"additionalProperties": false
|
|
4650
|
+
},
|
|
4651
|
+
"githubPackagesPublishRunner": {
|
|
4652
|
+
"type": "object",
|
|
4653
|
+
"description": "The runner of the single job that publishes to GitHub Packages.",
|
|
4654
|
+
"properties": {
|
|
4655
|
+
"runner": {
|
|
4656
|
+
"type": "string",
|
|
4657
|
+
"description": "The kind of runner, for example self-hosted."
|
|
4658
|
+
},
|
|
4659
|
+
"label": {
|
|
4660
|
+
"type": "string",
|
|
4661
|
+
"description": "The runs-on label of the job, when the runner kind needs one."
|
|
4662
|
+
}
|
|
4663
|
+
},
|
|
4664
|
+
"required": [
|
|
4665
|
+
"runner"
|
|
4666
|
+
],
|
|
4667
|
+
"additionalProperties": false
|
|
4668
|
+
},
|
|
4669
|
+
"privatePackageRegistry": {
|
|
4670
|
+
"type": "string",
|
|
4671
|
+
"description": "The registry that private packages are published to, for example github-packages."
|
|
4672
|
+
},
|
|
4673
|
+
"aggregatePackageName": {
|
|
4674
|
+
"type": "string",
|
|
4675
|
+
"description": "The package name of the facts aggregate package of the organization, with its scope when it has one. Omitted when the organization has no aggregate package."
|
|
4676
|
+
},
|
|
4677
|
+
"aggregateRegistry": {
|
|
4678
|
+
"type": "string",
|
|
4679
|
+
"description": "The registry that the facts aggregate package is published to. Omitted when the organization has no aggregate package."
|
|
4680
|
+
},
|
|
4681
|
+
"unscopedPublicPackages": {
|
|
4682
|
+
"type": "array",
|
|
4683
|
+
"description": "The packages the organization publishes without an npm scope, each one listed by name.",
|
|
4684
|
+
"items": {
|
|
4685
|
+
"type": "string"
|
|
4686
|
+
}
|
|
4687
|
+
},
|
|
4688
|
+
"expectedExclude": {
|
|
4689
|
+
"type": "array",
|
|
4690
|
+
"description": "The expected entries of minimumReleaseAgeExclude in pnpm-workspace.yaml. Optional, because the entries follow from the scope, the -facts suffix and unscopedPublicPackages.",
|
|
4691
|
+
"items": {
|
|
4692
|
+
"type": "string"
|
|
4693
|
+
}
|
|
4694
|
+
}
|
|
4695
|
+
},
|
|
4696
|
+
"required": [
|
|
4697
|
+
"mergeBotApp",
|
|
4698
|
+
"privateRepoRunner",
|
|
4699
|
+
"githubPackagesPublishRunner",
|
|
4700
|
+
"privatePackageRegistry",
|
|
4701
|
+
"unscopedPublicPackages"
|
|
4702
|
+
],
|
|
4703
|
+
"additionalProperties": false
|
|
4704
|
+
}
|
|
4705
|
+
}
|
|
4515
4706
|
}
|
|
4516
4707
|
],
|
|
4517
4708
|
"source": {
|
|
@@ -4576,11 +4767,11 @@
|
|
|
4576
4767
|
},
|
|
4577
4768
|
"aggregatePackageName": {
|
|
4578
4769
|
"type": "string",
|
|
4579
|
-
"description": "The package name of the facts aggregate package of the organization, with its scope when it has one."
|
|
4770
|
+
"description": "The package name of the facts aggregate package of the organization, with its scope when it has one. Omitted when the organization has no aggregate package."
|
|
4580
4771
|
},
|
|
4581
4772
|
"aggregateRegistry": {
|
|
4582
4773
|
"type": "string",
|
|
4583
|
-
"description": "The registry that the facts aggregate package is published to."
|
|
4774
|
+
"description": "The registry that the facts aggregate package is published to. Omitted when the organization has no aggregate package."
|
|
4584
4775
|
},
|
|
4585
4776
|
"unscopedPublicPackages": {
|
|
4586
4777
|
"type": "array",
|
|
@@ -4602,8 +4793,6 @@
|
|
|
4602
4793
|
"privateRepoRunner",
|
|
4603
4794
|
"githubPackagesPublishRunner",
|
|
4604
4795
|
"privatePackageRegistry",
|
|
4605
|
-
"aggregatePackageName",
|
|
4606
|
-
"aggregateRegistry",
|
|
4607
4796
|
"unscopedPublicPackages"
|
|
4608
4797
|
],
|
|
4609
4798
|
"additionalProperties": false
|
|
@@ -7920,6 +8109,26 @@
|
|
|
7920
8109
|
"exitStatus": "0 consistent, 1 not, 2 wrong arguments"
|
|
7921
8110
|
}
|
|
7922
8111
|
}
|
|
8112
|
+
},
|
|
8113
|
+
{
|
|
8114
|
+
"since": "0.2.0",
|
|
8115
|
+
"content": {
|
|
8116
|
+
"value": {
|
|
8117
|
+
"file": "release/scripts/ci/check-release-policy.sh",
|
|
8118
|
+
"role": "release",
|
|
8119
|
+
"usage": "check-release-policy.sh [--policy <file>] [--config <file>]",
|
|
8120
|
+
"sameAsTemplate": "Every argument of the template this one grew out of keeps its name and meaning",
|
|
8121
|
+
"checks": [
|
|
8122
|
+
"the units of the policy are exactly the components of release-please-config.json; on a release branch the policy may list units the shrunk config no longer has",
|
|
8123
|
+
"the unit directory an index.ts under facts/ passes to describesOf(<component>, <dir>) is the path of that component in release-please-config.json; a missing directory or a different one fails, and on a release branch whose config was shrunk to the train a component the config no longer has is skipped",
|
|
8124
|
+
"a unit that deploys (service, backend, web) finds a target for each stage it walks, and walks at least one prerelease stage when its targets have one",
|
|
8125
|
+
"a unit that ships to store channels (mobile, desktop) names a channel for each stage it walks",
|
|
8126
|
+
"every dependsOn names a unit the policy lists"
|
|
8127
|
+
],
|
|
8128
|
+
"hub": "A hub has no units and no release-please-config.json, so it passes.",
|
|
8129
|
+
"exitStatus": "0 consistent, 1 not, 2 wrong arguments"
|
|
8130
|
+
}
|
|
8131
|
+
}
|
|
7923
8132
|
}
|
|
7924
8133
|
],
|
|
7925
8134
|
"source": {
|
|
@@ -7933,6 +8142,7 @@
|
|
|
7933
8142
|
"sameAsTemplate": "Every argument of the template this one grew out of keeps its name and meaning",
|
|
7934
8143
|
"checks": [
|
|
7935
8144
|
"the units of the policy are exactly the components of release-please-config.json; on a release branch the policy may list units the shrunk config no longer has",
|
|
8145
|
+
"the unit directory an index.ts under facts/ passes to describesOf(<component>, <dir>) is the path of that component in release-please-config.json; a missing directory or a different one fails, and on a release branch whose config was shrunk to the train a component the config no longer has is skipped",
|
|
7936
8146
|
"a unit that deploys (service, backend, web) finds a target for each stage it walks, and walks at least one prerelease stage when its targets have one",
|
|
7937
8147
|
"a unit that ships to store channels (mobile, desktop) names a channel for each stage it walks",
|
|
7938
8148
|
"every dependsOn names a unit the policy lists"
|
|
@@ -9251,6 +9461,52 @@
|
|
|
9251
9461
|
}
|
|
9252
9462
|
}
|
|
9253
9463
|
}
|
|
9464
|
+
},
|
|
9465
|
+
{
|
|
9466
|
+
"since": "0.2.0",
|
|
9467
|
+
"content": {
|
|
9468
|
+
"value": {
|
|
9469
|
+
"workflow": "base/.github/workflows/ci.yml",
|
|
9470
|
+
"role": "base",
|
|
9471
|
+
"job": "facts",
|
|
9472
|
+
"node": 24,
|
|
9473
|
+
"permissions": {
|
|
9474
|
+
"contents": "read"
|
|
9475
|
+
},
|
|
9476
|
+
"persistCredentials": false,
|
|
9477
|
+
"runsWhen": "scope 的 `run` 輸出為 true,與 static、build-test 相同,也是 job 唯一的條件,和範本 `ci.yml:131-135` 相同;facts/ 與單元目錄都算原始碼。scope 沒有 `facts` 輸出,job 不看倉裡有沒有 `facts/`。有 release 角色的倉沒有 `facts/` 時,三支腳本印 `⊘` 並成功",
|
|
9478
|
+
"steps": [
|
|
9479
|
+
{
|
|
9480
|
+
"name": "Train of the open Release PR",
|
|
9481
|
+
"when": "推到 `release/**`,或 PR 的 base 是 `release/**`",
|
|
9482
|
+
"run": "scripts/ci/release-train.sh"
|
|
9483
|
+
},
|
|
9484
|
+
{
|
|
9485
|
+
"name": "Pin the train in the checkout",
|
|
9486
|
+
"when": "推到 `release/**`,或 PR 的 base 是 `release/**`",
|
|
9487
|
+
"run": "scripts/ci/pin-train.sh"
|
|
9488
|
+
},
|
|
9489
|
+
{
|
|
9490
|
+
"name": "fact-kit check (every facts package)",
|
|
9491
|
+
"run": "scripts/ci/check-facts.sh"
|
|
9492
|
+
},
|
|
9493
|
+
{
|
|
9494
|
+
"name": "describes is written with describesOf",
|
|
9495
|
+
"run": "scripts/ci/check-facts-describes.sh"
|
|
9496
|
+
}
|
|
9497
|
+
],
|
|
9498
|
+
"stepScriptsRole": "release",
|
|
9499
|
+
"withoutReleaseRole": {
|
|
9500
|
+
"steps": [
|
|
9501
|
+
{
|
|
9502
|
+
"name": "No facts in this repository",
|
|
9503
|
+
"run": "echo \"⊘ 這個倉沒有 release 角色,沒有 facts 套件,不需要檢查\""
|
|
9504
|
+
}
|
|
9505
|
+
],
|
|
9506
|
+
"why": "沒有 release 角色的倉沒有 facts 腳本(只在 release/scripts/),所以組裝時(組裝步驟的 roleBlocks)換成這一個步驟。job id 與必要檢查的名稱不變。ci.yml 用 `# @if release` 與 `# @if !release` 標出兩組步驟。"
|
|
9507
|
+
}
|
|
9508
|
+
}
|
|
9509
|
+
}
|
|
9254
9510
|
}
|
|
9255
9511
|
],
|
|
9256
9512
|
"source": {
|
|
@@ -9283,7 +9539,7 @@
|
|
|
9283
9539
|
"run": "scripts/ci/check-facts.sh"
|
|
9284
9540
|
},
|
|
9285
9541
|
{
|
|
9286
|
-
"name": "describes
|
|
9542
|
+
"name": "describes is written with describesOf",
|
|
9287
9543
|
"run": "scripts/ci/check-facts-describes.sh"
|
|
9288
9544
|
}
|
|
9289
9545
|
],
|
|
@@ -9348,13 +9604,19 @@
|
|
|
9348
9604
|
"content": {
|
|
9349
9605
|
"statement": "推到 `release/**`,或 PR 的 base 是 `release/**` 時,`scripts/ci/release-train.sh` 抓該發布分支開著的 Release PR 的分支 `release-please--branches--<發布分支>`,比對它的 `.release-please-manifest.json` 和發布分支的差異,對每個版號不同、又有 component 套件的單元輸出一個 `--train <component>=<PR 的版號>`,寫進 `FACT_KIT_TRAIN`。接著 `scripts/ci/pin-train.sh` 在 CI 的檢出把 `--train` 點名的 component 的 `next` 釘成該版號(不提交、不推送),`check-facts.sh` 再把 `FACT_KIT_TRAIN` 交給每次 `fact-kit check`。沒進 `--train` 的 component 不釘。沒有 Release PR,或沒有單元的版號不同,就不帶 `--train`。其他分支沒有 Release PR,不執行這兩步。因為發布分支上的 facts 在 Release PR 合併前就釘到新版號,而 `describes` 還讀舊的 manifest,不帶 `--train` 會報 `since-ahead`;`next` 在合併前尚未釘版,不先釘會報 `train-next`。"
|
|
9350
9606
|
}
|
|
9607
|
+
},
|
|
9608
|
+
{
|
|
9609
|
+
"since": "0.2.0",
|
|
9610
|
+
"content": {
|
|
9611
|
+
"statement": "推到 `release/**`,或 PR 的 base 是 `release/**` 時,`scripts/ci/release-train.sh` 抓該發布分支開著的 Release PR 的分支 `release-please--branches--<發布分支>`,比對它的 `.release-please-manifest.json` 和發布分支的差異,對每個版號不同、又有 component 套件的單元輸出一個 `--train <component>=<PR 的版號>`,寫進 `FACT_KIT_TRAIN`。接著 `scripts/ci/pin-train.sh` 在 CI 的檢出把 `--train` 點名的 component 的 `next` 釘成該版號(不提交、不推送),`check-facts.sh` 再把 `FACT_KIT_TRAIN` 交給每次 `fact-kit check`。沒進 `--train` 的 component 不釘。沒有 Release PR,或沒有單元的版號不同,就不帶 `--train`。其他分支沒有 Release PR,不執行這兩步。因為發布分支上的 facts 在 Release PR 合併前就釘到新版號,而 `describes` 還讀單元目錄裡舊的版本檔(Release PR 合併前還沒改它),不帶 `--train` 會報 `since-ahead`;`next` 在合併前尚未釘版,不先釘會報 `train-next`。"
|
|
9612
|
+
}
|
|
9351
9613
|
}
|
|
9352
9614
|
],
|
|
9353
9615
|
"source": {
|
|
9354
9616
|
"kind": "published"
|
|
9355
9617
|
},
|
|
9356
9618
|
"content": {
|
|
9357
|
-
"statement": "推到 `release/**`,或 PR 的 base 是 `release/**` 時,`scripts/ci/release-train.sh` 抓該發布分支開著的 Release PR 的分支 `release-please--branches--<發布分支>`,比對它的 `.release-please-manifest.json` 和發布分支的差異,對每個版號不同、又有 component 套件的單元輸出一個 `--train <component>=<PR 的版號>`,寫進 `FACT_KIT_TRAIN`。接著 `scripts/ci/pin-train.sh` 在 CI 的檢出把 `--train` 點名的 component 的 `next` 釘成該版號(不提交、不推送),`check-facts.sh` 再把 `FACT_KIT_TRAIN` 交給每次 `fact-kit check`。沒進 `--train` 的 component 不釘。沒有 Release PR,或沒有單元的版號不同,就不帶 `--train`。其他分支沒有 Release PR,不執行這兩步。因為發布分支上的 facts 在 Release PR 合併前就釘到新版號,而 `describes`
|
|
9619
|
+
"statement": "推到 `release/**`,或 PR 的 base 是 `release/**` 時,`scripts/ci/release-train.sh` 抓該發布分支開著的 Release PR 的分支 `release-please--branches--<發布分支>`,比對它的 `.release-please-manifest.json` 和發布分支的差異,對每個版號不同、又有 component 套件的單元輸出一個 `--train <component>=<PR 的版號>`,寫進 `FACT_KIT_TRAIN`。接著 `scripts/ci/pin-train.sh` 在 CI 的檢出把 `--train` 點名的 component 的 `next` 釘成該版號(不提交、不推送),`check-facts.sh` 再把 `FACT_KIT_TRAIN` 交給每次 `fact-kit check`。沒進 `--train` 的 component 不釘。沒有 Release PR,或沒有單元的版號不同,就不帶 `--train`。其他分支沒有 Release PR,不執行這兩步。因為發布分支上的 facts 在 Release PR 合併前就釘到新版號,而 `describes` 還讀單元目錄裡舊的版本檔(Release PR 合併前還沒改它),不帶 `--train` 會報 `since-ahead`;`next` 在合併前尚未釘版,不先釘會報 `train-next`。"
|
|
9358
9620
|
}
|
|
9359
9621
|
},
|
|
9360
9622
|
{
|
|
@@ -9370,13 +9632,19 @@
|
|
|
9370
9632
|
"content": {
|
|
9371
9633
|
"statement": "`scripts/ci/check-facts-describes.sh` 建置後逐一核對 `facts/fact-kit.config.json` 的 `aggregate` 列出的 component 套件,逐一讀每個套件建置後的每個 `dist/*/index.json`(一個 component 套件可以有多個 entry,entry 名不必等於 component 名)。每個 entry 的 `describes` 都必須等於同一個檢出裡 `.release-please-manifest.json` 的版號,也就是 `{ \"<component>\": \"<manifest 版號>\" }`;manifest 沒有該單元時必須是 `{}`。component 取自套件在 `facts/` 底下的目錄名。任一 entry 不等就失敗,並印出 component、entry、`describes` 與 manifest 的值。套件的 `dist/` 底下一個 `index.json` 都沒有也失敗,不會因為空集合而放行。產品層的 `<RepoName>-spec` 套件 `describes` 是 `{}`,manifest 沒有它,所以兩者相等,不需要例外。這一步擋下 index.ts 不用 `describesOf()`、寫死版號而落後 manifest 的 component 套件。"
|
|
9372
9634
|
}
|
|
9635
|
+
},
|
|
9636
|
+
{
|
|
9637
|
+
"since": "0.2.0",
|
|
9638
|
+
"content": {
|
|
9639
|
+
"statement": "`scripts/ci/check-facts-describes.sh` 建置後逐一檢查 `facts/fact-kit.config.json` 的 `aggregate` 列出的 component 套件的 `describes` 寫法,一個 component 套件可以有多個 entry(`dist/<entry>/index.json`,原始碼在 `<套件>/facts/<entry>/index.ts`),entry 名不必等於 component 名,component 取自套件在 `facts/` 底下的目錄名。每個 entry 的 `index.ts` 的 `describes:` 必須是 `describesOf(` 呼叫或 `{}`,寫成字面物件(例如 `{ comp: '1.4.0' }`)就失敗;建置後 `dist/<entry>/index.json` 的 `describes` 鍵必須是 component 名,或沒有鍵(`{}`)。這支腳本不比對版號,也不讀 `.release-please-manifest.json` 與 `release-please-config.json`:版號由 `describesOf` 讀被描述單元目錄的版本檔,單元還沒發布、版本檔沒有版號或是 0.0.0 時 `describes` 是 `{}`,照常通過,沒有 manifest 的倉也一樣檢查。`index.ts` 的單元目錄和 `release-please-config.json` 一致,由 `scripts/ci/check-release-policy.sh` 核對。套件的 `dist/` 底下一個 `index.json` 都沒有、或 entry 找不到 `index.ts` 也失敗,不會因為空集合而放行。產品層的 `<RepoName>-spec` 套件沒有被描述的單元,`describes` 寫 `{}`,照常通過,不需要例外。這一步擋下 index.ts 寫死版號、不用 `describesOf` 的 component 套件。"
|
|
9640
|
+
}
|
|
9373
9641
|
}
|
|
9374
9642
|
],
|
|
9375
9643
|
"source": {
|
|
9376
9644
|
"kind": "published"
|
|
9377
9645
|
},
|
|
9378
9646
|
"content": {
|
|
9379
|
-
"statement": "`scripts/ci/check-facts-describes.sh`
|
|
9647
|
+
"statement": "`scripts/ci/check-facts-describes.sh` 建置後逐一檢查 `facts/fact-kit.config.json` 的 `aggregate` 列出的 component 套件的 `describes` 寫法,一個 component 套件可以有多個 entry(`dist/<entry>/index.json`,原始碼在 `<套件>/facts/<entry>/index.ts`),entry 名不必等於 component 名,component 取自套件在 `facts/` 底下的目錄名。每個 entry 的 `index.ts` 的 `describes:` 必須是 `describesOf(` 呼叫或 `{}`,寫成字面物件(例如 `{ comp: '1.4.0' }`)就失敗;建置後 `dist/<entry>/index.json` 的 `describes` 鍵必須是 component 名,或沒有鍵(`{}`)。這支腳本不比對版號,也不讀 `.release-please-manifest.json` 與 `release-please-config.json`:版號由 `describesOf` 讀被描述單元目錄的版本檔,單元還沒發布、版本檔沒有版號或是 0.0.0 時 `describes` 是 `{}`,照常通過,沒有 manifest 的倉也一樣檢查。`index.ts` 的單元目錄和 `release-please-config.json` 一致,由 `scripts/ci/check-release-policy.sh` 核對。套件的 `dist/` 底下一個 `index.json` 都沒有、或 entry 找不到 `index.ts` 也失敗,不會因為空集合而放行。產品層的 `<RepoName>-spec` 套件沒有被描述的單元,`describes` 寫 `{}`,照常通過,不需要例外。這一步擋下 index.ts 寫死版號、不用 `describesOf` 的 component 套件。"
|
|
9380
9648
|
}
|
|
9381
9649
|
},
|
|
9382
9650
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blueprint-shared-facts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Facts shared by several products, published on its own",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Carlos Space",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"fact-kit": "^0.
|
|
20
|
+
"fact-kit": "^0.14.1",
|
|
21
21
|
"oxc-parser": "^0.155.0"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|