@tablation/crew 0.171.0 → 0.172.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/cli.js +819 -197
- package/dist/sandbox-intel-bridge.cjs +50 -2
- package/docs/repo-setup-prompt.md +2 -1
- package/package.json +1 -1
|
@@ -24829,6 +24829,7 @@ var RELEASE_KEYS = /* @__PURE__ */ new Set([
|
|
|
24829
24829
|
"ship",
|
|
24830
24830
|
"ci",
|
|
24831
24831
|
"verify",
|
|
24832
|
+
"pipeline",
|
|
24832
24833
|
"isolateFailures",
|
|
24833
24834
|
"rightOfWayMinutes",
|
|
24834
24835
|
"rebuildPrimary",
|
|
@@ -24840,6 +24841,7 @@ var RELEASE_KEYS = /* @__PURE__ */ new Set([
|
|
|
24840
24841
|
]);
|
|
24841
24842
|
var VERSIONINGS = ["auto", "none"];
|
|
24842
24843
|
var CI_KEYS = /* @__PURE__ */ new Set(["provider", "ref"]);
|
|
24844
|
+
var PIPELINE_KEYS = /* @__PURE__ */ new Set(["qa", "production", "pipeline", "qaTimeoutSeconds", "qaIntervalSeconds", "startTimeoutSeconds"]);
|
|
24843
24845
|
var VERIFY_KEYS = /* @__PURE__ */ new Set(["match", "timeoutSeconds", "intervalSeconds"]);
|
|
24844
24846
|
var ISOLATE_KEYS = /* @__PURE__ */ new Set(["maxCandidates"]);
|
|
24845
24847
|
function parseRebuildPrimary(raw, fail2) {
|
|
@@ -24860,7 +24862,19 @@ function parseIsolateMax(raw, where, fail2) {
|
|
|
24860
24862
|
return n;
|
|
24861
24863
|
}
|
|
24862
24864
|
var MATCHES = ["commit", "version"];
|
|
24863
|
-
var MODES = ["local", "integrate", "ci_manual", "ci_auto", "external"];
|
|
24865
|
+
var MODES = ["local", "integrate", "ci_manual", "ci_auto", "external", "pipeline"];
|
|
24866
|
+
function parsePipelineRoles(raw, where, fail2) {
|
|
24867
|
+
const url2 = (v, at) => {
|
|
24868
|
+
if (typeof v !== "string" || !/^https?:\/\/[^\s/]+/i.test(v.trim())) throw fail2(`${at} must be an http(s) address (got "${String(v)}")`);
|
|
24869
|
+
return v.trim().replace(/\/+$/, "");
|
|
24870
|
+
};
|
|
24871
|
+
if (typeof raw === "string") return [{ role: "app", url: url2(raw, where) }];
|
|
24872
|
+
if (raw && typeof raw === "object" && !Array.isArray(raw)) {
|
|
24873
|
+
const roles = Object.entries(raw).map(([role, v]) => ({ role, url: url2(v, `${where}.${role}`) }));
|
|
24874
|
+
if (roles.length) return roles;
|
|
24875
|
+
}
|
|
24876
|
+
throw fail2(`${where} must be an address, or a map of role to address`);
|
|
24877
|
+
}
|
|
24864
24878
|
var PROVIDERS = ["github", "buildkite", "other", "none"];
|
|
24865
24879
|
function findRepoConfig(dir) {
|
|
24866
24880
|
for (const name of REPO_CONFIG_FILENAMES) {
|
|
@@ -25059,7 +25073,40 @@ function parseRepoConfig(text, file, opts = {}) {
|
|
|
25059
25073
|
`${file}: release.mode "external" means the crew does not release, but hooks.deploy is defined \u2014 remove one, or use ci_manual/ci_auto if the crew should be involved`
|
|
25060
25074
|
);
|
|
25061
25075
|
}
|
|
25062
|
-
if (mode
|
|
25076
|
+
if (mode === "pipeline" && hooks.deploy) {
|
|
25077
|
+
throw new RepoConfigError(
|
|
25078
|
+
`${file}: release.mode "pipeline" means a pipeline deploys, but hooks.deploy is defined \u2014 the crew never runs a deploy script in this mode. Remove it`
|
|
25079
|
+
);
|
|
25080
|
+
}
|
|
25081
|
+
rejectUnknown(raw.release?.pipeline, PIPELINE_KEYS, "release.pipeline", file, newer);
|
|
25082
|
+
let pipeline;
|
|
25083
|
+
if (raw.release?.pipeline !== void 0 && raw.release?.pipeline !== null) {
|
|
25084
|
+
const pr = raw.release.pipeline;
|
|
25085
|
+
const fail2 = (m) => new RepoConfigError(`${file}: ${m}`);
|
|
25086
|
+
if (typeof pr !== "object" || Array.isArray(pr)) throw fail2("release.pipeline must be a map");
|
|
25087
|
+
if (typeof pr.pipeline !== "string" || !pr.pipeline.trim()) throw fail2("release.pipeline.pipeline must name the CI pipeline (for Buildkite, org/slug)");
|
|
25088
|
+
const pnum = (v, key, dflt) => {
|
|
25089
|
+
if (v === void 0 || v === null) return dflt;
|
|
25090
|
+
const n = Number(v);
|
|
25091
|
+
if (!Number.isFinite(n) || n <= 0) throw fail2(`release.pipeline.${key} must be a positive number (got "${String(v)}")`);
|
|
25092
|
+
return n;
|
|
25093
|
+
};
|
|
25094
|
+
pipeline = {
|
|
25095
|
+
qa: parsePipelineRoles(pr.qa, "release.pipeline.qa", fail2),
|
|
25096
|
+
production: parsePipelineRoles(pr.production, "release.pipeline.production", fail2),
|
|
25097
|
+
pipeline: pr.pipeline.trim(),
|
|
25098
|
+
qaTimeoutSeconds: pnum(pr.qaTimeoutSeconds, "qaTimeoutSeconds", 600),
|
|
25099
|
+
qaIntervalSeconds: pnum(pr.qaIntervalSeconds, "qaIntervalSeconds", 15),
|
|
25100
|
+
startTimeoutSeconds: pnum(pr.startTimeoutSeconds, "startTimeoutSeconds", 1800)
|
|
25101
|
+
};
|
|
25102
|
+
}
|
|
25103
|
+
if (mode === "pipeline" && !pipeline) {
|
|
25104
|
+
throw new RepoConfigError(`${file}: release.mode "pipeline" needs release.pipeline (qa, production and pipeline)`);
|
|
25105
|
+
}
|
|
25106
|
+
if (mode !== "pipeline" && pipeline) {
|
|
25107
|
+
throw new RepoConfigError(`${file}: release.pipeline only applies to release.mode "pipeline" (got "${mode}")`);
|
|
25108
|
+
}
|
|
25109
|
+
if (mode !== "local" && mode !== "external" && mode !== "integrate" && mode !== "pipeline" && !hooks.released) {
|
|
25063
25110
|
throw new RepoConfigError(
|
|
25064
25111
|
`${file}: release.mode "${mode}" needs a hooks.released \u2014 the crew cannot observe a release it did not perform without one`
|
|
25065
25112
|
);
|
|
@@ -25177,6 +25224,7 @@ function parseRepoConfig(text, file, opts = {}) {
|
|
|
25177
25224
|
ship,
|
|
25178
25225
|
ci: { provider, ref: raw.release?.ci?.ref ? String(raw.release.ci.ref) : void 0 },
|
|
25179
25226
|
verify,
|
|
25227
|
+
...pipeline ? { pipeline } : {},
|
|
25180
25228
|
isolateFailures: isolateMax === void 0 ? void 0 : { maxCandidates: isolateMax },
|
|
25181
25229
|
rightOfWayMinutes: rightOfWay,
|
|
25182
25230
|
...parallelGatesRaw ? { parallelGates: true } : {},
|
|
@@ -111,6 +111,7 @@ Ask once, in a single message, with your best reading of the evidence beside eac
|
|
|
111
111
|
- `ci_manual`: Crew triggers CI and waits for it. Needs `hooks.released`.
|
|
112
112
|
- `local`: Crew runs a deploy command itself after merging and pushing, and the command's exit status is the result. Needs `hooks.deploy`. Right when a person ships by running a command today, including one that dispatches a pipeline and waits for it.
|
|
113
113
|
- `external`: Crew does not merge at all. A person or another tool merges pull requests. Needs `hooks.merged`; `hooks.pr` opens the pull request.
|
|
114
|
+
- `pipeline`: pushing the release commit starts a pipeline that deploys to a QA environment by itself, and a person releases production from the same pipeline. Crew pushes, follows the run, marks tickets released to QA, and marks them deployed when production reports their commit. Needs `release.pipeline` (QA and production addresses, the pipeline) and the Buildkite provider; no `hooks.deploy` or `hooks.released`. Do not propose it unless the repo's own instructions describe this two-step release.
|
|
114
115
|
For `local`, also confirm the exact command I run to ship.
|
|
115
116
|
2. **What single command prints what is live right now**, as a version or a commit sha? A registry query and a health endpoint are the usual answers. The `ci_*` modes cannot work without it, so ask whenever one of them is likely; for the other modes it is optional and not worth a question. It becomes `hooks.released`, with `release.verify.match` set to `version` or `commit` to match, and `release.verify.timeoutSeconds` sized to how long the release pipeline takes.
|
|
116
117
|
3. **Should Crew set versions**, if the evidence was mixed? If a lockfile or second file records the version, confirm it has to stay in step.
|
|
@@ -194,7 +195,7 @@ Release (keys under `release`):
|
|
|
194
195
|
|
|
195
196
|
| Key | Values and meaning |
|
|
196
197
|
| --- | --- |
|
|
197
|
-
| `mode` | `local` (default), `integrate`, `ci_manual`, `ci_auto`, `external
|
|
198
|
+
| `mode` | `local` (default), `integrate`, `ci_manual`, `ci_auto`, `external`, `pipeline` (needs `release.pipeline`: `qa`, `production`, `pipeline`). |
|
|
198
199
|
| `versioning` | `auto` (default) or `none`. |
|
|
199
200
|
| `versionFiles` | JSON files with a string `version` field that Crew rewrites. Default `[package.json]`. A plain-text file is refused. |
|
|
200
201
|
| `changelog` | Path of the changelog Crew writes. Default `CHANGELOG.md`. `false` for none. |
|
package/package.json
CHANGED