agentic-sdlc-kit 0.4.0 → 0.4.1
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/CHANGELOG.md +18 -1
- package/INSTALL.md +4 -4
- package/dist/commands/board.js +13 -2
- package/dist/commands/upgrade.js +7 -1
- package/dist/install/detect.js +106 -17
- package/dist/render/instructions.js +1 -0
- package/package.json +1 -1
- package/templates/instructions/block.md +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.4.1] - 2026-11-29
|
|
10
|
+
|
|
11
|
+
Merged work waits for its release: release targets from the install on, `board ensure` adds missing labels, and the release workflow creates the GitHub release.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- The `release` workflow creates the GitHub release `v<version>` after it publishes to npm (#19). The notes are the version's `CHANGELOG.md` section, so that section must exist before the tag is pushed: the `test` job checks it first, so a tag without it fails before anything reaches npm. A hyphenated version is marked as a prerelease, and any other version is left for GitHub to rank as Latest by date and version, so a release of an older line does not take Latest. A release that already exists is left alone, so running a tag again is harmless. The new `github-release` job is the only one with write access to the repository, and it runs no repository code; it refuses a `CHANGELOG.md` that is a symlink.
|
|
16
|
+
- `config suggest` proposes a target with `deploy.via: release` for a workflow that publishes on a tag push or a release (`npm`, `pypi` or `crates` after the registry, else `release`), and keeps `feature` and `bugfix` on (#15). Its note says that tasks wait until a published GitHub Release contains the merge. A publish in a comment or with `--dry-run` does not count.
|
|
17
|
+
- The instruction block says which type ships when a type that ends on a deploy is enabled: work that reaches users is such a type and waits as Awaiting deployment after the merge; `tooling` is for changes that never ship (#15).
|
|
18
|
+
- `sdlc board ensure` also creates the missing `type:<id>` labels, so a task type enabled after the install gets its board options and its label in one step. `sdlc upgrade`, which never touches GitHub, says to run it when it changed files (#15).
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- INSTALL.md always asks about deploy and release targets (question 5), also when none was detected, and says that a release target needs a published GitHub Release, not a tag. The no-target note of `config suggest` says that every merged task then goes straight to Done (#15).
|
|
23
|
+
- The kit's own configuration pins `kit_ref: v0.4.0`.
|
|
24
|
+
|
|
9
25
|
## [0.4.0] - 2026-11-29
|
|
10
26
|
|
|
11
27
|
Free-form owner approvals: decide in your own words, in any language, or with registered `/approve` commands; plus a developer guide.
|
|
@@ -100,7 +116,8 @@ First release. It installs an agentic SDLC into any repository: the task lifecyc
|
|
|
100
116
|
- Secret guard: the pre-commit and pre-push hooks run 76 content rules and 10 file-name rules. Output is masked and the guard fails closed; gitleaks is optional.
|
|
101
117
|
- `sdlc doctor`: preflight and install checks.
|
|
102
118
|
|
|
103
|
-
[Unreleased]: https://github.com/SobSoft-s-r-o/agentic-sdlc-kit/compare/v0.4.
|
|
119
|
+
[Unreleased]: https://github.com/SobSoft-s-r-o/agentic-sdlc-kit/compare/v0.4.1...HEAD
|
|
120
|
+
[0.4.1]: https://github.com/SobSoft-s-r-o/agentic-sdlc-kit/compare/v0.4.0...v0.4.1
|
|
104
121
|
[0.4.0]: https://github.com/SobSoft-s-r-o/agentic-sdlc-kit/compare/v0.3.1...v0.4.0
|
|
105
122
|
[0.3.1]: https://github.com/SobSoft-s-r-o/agentic-sdlc-kit/compare/v0.3.0...v0.3.1
|
|
106
123
|
[0.3.0]: https://github.com/SobSoft-s-r-o/agentic-sdlc-kit/compare/v0.2.0...v0.3.0
|
package/INSTALL.md
CHANGED
|
@@ -54,16 +54,16 @@ Key `mode`: `observe` (default) records gaps and warns; `enforce` blocks. In `en
|
|
|
54
54
|
|
|
55
55
|
#### 4. Task types
|
|
56
56
|
|
|
57
|
-
Key `task_types.enabled`; built-in ids are `feature`, `bugfix`, `tooling`, `analysis`, `production-data`, `artifact`, `spike`. Keep `tooling`: the install PR is a `tooling` task. `feature` and `bugfix` end on a deploy and need at least one target, so
|
|
57
|
+
Key `task_types.enabled`; built-in ids are `feature`, `bugfix`, `tooling`, `analysis`, `production-data`, `artifact`, `spike`. Keep `tooling`: the install PR is a `tooling` task. `feature` and `bugfix` end on a deploy and need at least one target, so `config suggest` turns them off when it found no target; question 5 decides. A type enabled later, after the install, also needs `sdlc upgrade` (the instruction blocks) and `sdlc board ensure` (its board options and its `type:<id>` label). Custom types go under `task_types.custom`; see [the design, Task types](https://github.com/SobSoft-s-r-o/agentic-sdlc-kit/blob/main/docs/superpowers/specs/2026-11-27-agentic-sdlc-design.md#7-task-types).
|
|
58
58
|
|
|
59
59
|
#### 5. Deploy targets
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Always ask, even when nothing was detected: does merged work reach users only after a deploy or a release (a package, a GitHub Release, an app build)? If it does, add a target and enable `feature` and `bugfix`; without one, every merged task goes straight to Done. Key `targets`, for each: `name` (kebab-case), `environment` (the GitHub environment; default `production` for one target, `production-<name>` for several; each must be unique), `deploy.via` and optionally `paths` (globs that suggest which targets a PR touches).
|
|
62
62
|
|
|
63
63
|
- `deploy.via: script` with `command`;
|
|
64
64
|
- `deploy.via: actions` with `workflow` (detected from workflows that name an `environment:`);
|
|
65
65
|
- `deploy.via: manual`;
|
|
66
|
-
- `deploy.via: release` (a GitHub Release).
|
|
66
|
+
- `deploy.via: release`: a published GitHub Release whose commit contains the merge; a tag alone does not count. `config suggest` proposes one for a workflow that publishes on a tag or release (npm, PyPI, crates.io, a GitHub Release).
|
|
67
67
|
|
|
68
68
|
#### 6. Quality gate
|
|
69
69
|
|
|
@@ -382,7 +382,7 @@ Role files are templates: `{{...}}` is filled in when the file is rendered. To w
|
|
|
382
382
|
| `git.legacyHooks` | the repository's own hooks in `.git/hooks` that the kit's hooks run after their own step; a warning names one that is not executable and is skipped: `chmod +x` it |
|
|
383
383
|
| `sdlc.onPath` (warning), `secrets.guard` (failure) | the hooks cannot find `sdlc` (they look on the PATH, then run `npx --no-install sdlc`), so the secret guard is not active: install the dev dependency or a global install (Step 4). Under `npx -y` doctor leaves out the PATH entries npx added for its own run, as a hook does not see them |
|
|
384
384
|
| `kit.ref` | failure: a release `kit_ref` from `v0.3.0` on is not published on npm, so the generated `npx -y agentic-sdlc-kit@<version>` commands fail: set `kit_ref` to a published version or `main`. Warning: a branch (or a tag below `v0.3.0`) `kit_ref` does not exist in the kit's repository, so the generated `npx -y github:...#<kit_ref>` commands fail: set it to `main` or the ref you installed from. `v0.1.0` and `v0.2.0` (never on npm) are looked up in git, pass, and say to move to `v0.3.0` or later. "cannot verify" means `npm view` (release) or `git ls-remote` (branch, old tag) could not reach the registry or GitHub |
|
|
385
|
-
| `board.fields`, `labels` | no board number in the config, or fields, options or
|
|
385
|
+
| `board.fields`, `labels` | no board number in the config, or fields, options, views or labels missing: `sdlc board ensure`. A view the API cannot create is a warning and a manual step |
|
|
386
386
|
| `actions.workflow`, `actions.secret` | the workflow file is missing (`sdlc init`) or `SDLC_TOKEN` is not set (`gh secret set SDLC_TOKEN`); without admin rights the secret cannot be checked and `doctor` only warns |
|
|
387
387
|
| `mcp.token`, `mcp.<harness>` | export `GITHUB_PERSONAL_ACCESS_TOKEN` from the OS keystore in the shell profile ("Secrets"); `mcp.claude`, `mcp.codex` and `mcp.gemini` warn when `<harness> mcp list` does not show the configured servers: approve or add the server, and trust the project in Codex and Gemini |
|
|
388
388
|
| `git.version` | git is older than 2.31, which the hooks and worktrees need: upgrade git |
|
package/dist/commands/board.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { ensureBoard } from '../github/board.js';
|
|
2
|
+
import { ensureLabels } from '../install/provision.js';
|
|
2
3
|
const list = (names) => names.join(', ');
|
|
4
|
+
/** The labels line of `board ensure`. */
|
|
5
|
+
export function formatLabels(created, dryRun) {
|
|
6
|
+
if (created.length === 0)
|
|
7
|
+
return 'Labels are up to date';
|
|
8
|
+
return `${dryRun ? 'Would create labels' : 'Created labels'}: ${list(created)}`;
|
|
9
|
+
}
|
|
3
10
|
/** Human-readable summary of an `ensureBoard` run. */
|
|
4
11
|
export function formatEnsureResult(result, dryRun) {
|
|
5
12
|
const lines = [];
|
|
@@ -43,7 +50,7 @@ export function registerBoardCommand(program, makeContext) {
|
|
|
43
50
|
const board = program.command('board').description('Manage the Projects v2 board');
|
|
44
51
|
board
|
|
45
52
|
.command('ensure')
|
|
46
|
-
.description('Create the board or add its missing fields, options and views (add-only)')
|
|
53
|
+
.description('Create the board or add its missing fields, options and views, and the missing labels (add-only)')
|
|
47
54
|
.option('--dry-run', 'only query GitHub and print what would change')
|
|
48
55
|
.option('--json', 'print machine-readable JSON')
|
|
49
56
|
.action(async (options) => {
|
|
@@ -55,7 +62,11 @@ export function registerBoardCommand(program, makeContext) {
|
|
|
55
62
|
onProjectCreated: project => err(`Created project #${project.number}${project.url ? ` (${project.url})` : ''}; ` +
|
|
56
63
|
`set github.project.number: ${project.number} in sdlc.config.yaml before running this again`),
|
|
57
64
|
});
|
|
58
|
-
|
|
65
|
+
// A task type enabled after the install needs its `type:<id>` label too.
|
|
66
|
+
const labels = await ensureLabels(run, config, { dryRun });
|
|
67
|
+
out(options.json
|
|
68
|
+
? JSON.stringify({ dryRun, ...result, labelsCreated: labels.created }, null, 2)
|
|
69
|
+
: `${formatEnsureResult(result, dryRun)}\n${formatLabels(labels.created, dryRun)}`);
|
|
59
70
|
// A view that failed to create is a failed GitHub write.
|
|
60
71
|
if (result.viewsFailed.length > 0)
|
|
61
72
|
process.exitCode = 1;
|
package/dist/commands/upgrade.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { installFiles, installHooksPath, Reporter, runInstallAction, validateConfig, } from './install.js';
|
|
2
|
+
/** Said after an upgrade that changed files: upgrade itself never touches GitHub. */
|
|
3
|
+
export const UPGRADE_GITHUB_HINT = 'GitHub was not touched: if task types or targets changed, run "sdlc board ensure" to add their board options and labels';
|
|
2
4
|
/**
|
|
3
5
|
* `sdlc upgrade`: render the kit's current templates for the config and bring the repository up to
|
|
4
6
|
* them: update what changed, add what is new and, unlike `init`, remove what the kit no longer
|
|
5
7
|
* generates (while it is unmodified). The first line of the `files` step says which kit version the
|
|
6
|
-
* manifest recorded and which one is running. Never touches GitHub
|
|
8
|
+
* manifest recorded and which one is running. Never touches GitHub; when files changed, the `github` step says to
|
|
9
|
+
* run `sdlc board ensure`.
|
|
7
10
|
*/
|
|
8
11
|
export async function runUpgrade(ctx, options) {
|
|
9
12
|
const dryRun = options.dryRun === true;
|
|
@@ -18,6 +21,9 @@ export async function runUpgrade(ctx, options) {
|
|
|
18
21
|
showKit: true,
|
|
19
22
|
});
|
|
20
23
|
await installHooksPath(ctx, report, dryRun, files.status);
|
|
24
|
+
// A type enabled after the install needs board options and a label, which only `board ensure` adds.
|
|
25
|
+
if (files.status !== 'failed' && report.plan.writes.length > 0)
|
|
26
|
+
report.step('github', 'skipped', [UPGRADE_GITHUB_HINT]);
|
|
21
27
|
return report.finish();
|
|
22
28
|
}
|
|
23
29
|
/** Registers `sdlc upgrade [--dry-run] [--overwrite-modified] [--json]`; `--config` is the program's. */
|
package/dist/install/detect.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { readFileSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { basename, join } from 'node:path';
|
|
3
|
-
import { Document, isMap, isScalar, visit } from 'yaml';
|
|
3
|
+
import { Document, isMap, isScalar, parse as parseYaml, visit } from 'yaml';
|
|
4
4
|
import { BUILTIN_TYPES } from '../core/taskTypes.js';
|
|
5
5
|
import { ghJson, ghText } from '../github/gh.js';
|
|
6
6
|
import { packageVersion } from '../version.js';
|
|
7
7
|
const NO_HARNESS_NOTE = 'no harness files found; defaulting to claude';
|
|
8
8
|
const AGENTS_MD_NOTE = 'AGENTS.md found: choose codex or agents-md';
|
|
9
|
-
const NO_TARGETS_NOTE = 'no deploy
|
|
9
|
+
const NO_TARGETS_NOTE = 'no deploy or release target detected: feature/bugfix are off and every merged task goes straight to Done; ' +
|
|
10
|
+
'add a target if merged work reaches users only after a deploy or a release';
|
|
11
|
+
const releaseTargetNote = (name) => `target "${name}" waits for a published GitHub Release that contains the merge; ` +
|
|
12
|
+
'publish one for every version (a tag alone does not count)';
|
|
10
13
|
/** The script `npm init` writes; running it only fails. */
|
|
11
14
|
const NPM_PLACEHOLDER_TEST = /no test specified/i;
|
|
12
15
|
const DEPLOY_ENDING_TYPES = ['feature', 'bugfix'];
|
|
@@ -42,8 +45,11 @@ const isDeployWorkflow = (workflow) => /^deploy/i.test(workflowStem(workflow));
|
|
|
42
45
|
* several workflows goes to the deploy workflow when there is one, else the first. The name is the
|
|
43
46
|
* workflow file name without `deploy-`, else the environment name; a name already taken falls back
|
|
44
47
|
* to the environment name, then gets a number.
|
|
48
|
+
*
|
|
49
|
+
* Then one `release` target per release name, from workflows that gave no environment target (those
|
|
50
|
+
* count through their deployments). Its name and environment get a number when already taken.
|
|
45
51
|
*/
|
|
46
|
-
function deriveTargets(entries, notes) {
|
|
52
|
+
function deriveTargets(entries, releases, notes) {
|
|
47
53
|
const workflowsByEnvironment = new Map();
|
|
48
54
|
for (const { workflow, environment } of entries) {
|
|
49
55
|
const workflows = workflowsByEnvironment.get(environment) ?? [];
|
|
@@ -53,14 +59,7 @@ function deriveTargets(entries, notes) {
|
|
|
53
59
|
}
|
|
54
60
|
const taken = new Set();
|
|
55
61
|
const targets = [];
|
|
56
|
-
|
|
57
|
-
const workflow = workflows.find(isDeployWorkflow) ?? workflows[0];
|
|
58
|
-
if (workflows.length > 1) {
|
|
59
|
-
notes.push(`environment "${environment}" is used by several workflows (${workflows.join(', ')}); using ${workflow}`);
|
|
60
|
-
}
|
|
61
|
-
const stem = workflowStem(workflow);
|
|
62
|
-
const fromWorkflow = /^deploy-/i.test(stem) ? slugify(stem.slice('deploy-'.length)) : '';
|
|
63
|
-
const candidates = [fromWorkflow, slugify(environment)].filter(name => name !== '');
|
|
62
|
+
const freeName = (candidates) => {
|
|
64
63
|
let name = candidates.find(candidate => !taken.has(candidate));
|
|
65
64
|
if (name === undefined) {
|
|
66
65
|
const base = candidates[0] ?? 'target';
|
|
@@ -70,15 +69,50 @@ function deriveTargets(entries, notes) {
|
|
|
70
69
|
name = `${base}-${n}`;
|
|
71
70
|
}
|
|
72
71
|
taken.add(name);
|
|
72
|
+
return name;
|
|
73
|
+
};
|
|
74
|
+
for (const [environment, workflows] of workflowsByEnvironment) {
|
|
75
|
+
const workflow = workflows.find(isDeployWorkflow) ?? workflows[0];
|
|
76
|
+
if (workflows.length > 1) {
|
|
77
|
+
notes.push(`environment "${environment}" is used by several workflows (${workflows.join(', ')}); using ${workflow}`);
|
|
78
|
+
}
|
|
79
|
+
const stem = workflowStem(workflow);
|
|
80
|
+
const fromWorkflow = /^deploy-/i.test(stem) ? slugify(stem.slice('deploy-'.length)) : '';
|
|
81
|
+
const candidates = [fromWorkflow, slugify(environment)].filter(name => name !== '');
|
|
82
|
+
const name = freeName(candidates);
|
|
73
83
|
targets.push({ name, environment, deploy: { via: 'actions', workflow } });
|
|
74
84
|
}
|
|
85
|
+
// A workflow that names an environment already counts through its deployments there.
|
|
86
|
+
const deployWorkflows = new Set(targets.flatMap(t => (t.deploy.via === 'actions' ? [t.deploy.workflow] : [])));
|
|
87
|
+
const takenEnvironments = new Set(targets.map(t => t.environment));
|
|
88
|
+
const workflowsByRelease = new Map();
|
|
89
|
+
for (const { workflow, name } of releases) {
|
|
90
|
+
if (deployWorkflows.has(workflow))
|
|
91
|
+
continue;
|
|
92
|
+
const workflows = workflowsByRelease.get(name) ?? [];
|
|
93
|
+
if (!workflows.includes(workflow))
|
|
94
|
+
workflows.push(workflow);
|
|
95
|
+
workflowsByRelease.set(name, workflows);
|
|
96
|
+
}
|
|
97
|
+
for (const [release, workflows] of workflowsByRelease) {
|
|
98
|
+
if (workflows.length > 1) {
|
|
99
|
+
notes.push(`release target "${release}" is published by several workflows (${workflows.join(', ')})`);
|
|
100
|
+
}
|
|
101
|
+
const name = freeName([release]);
|
|
102
|
+
let environment = name;
|
|
103
|
+
for (let n = 2; takenEnvironments.has(environment); n += 1)
|
|
104
|
+
environment = `${name}-${n}`;
|
|
105
|
+
takenEnvironments.add(environment);
|
|
106
|
+
targets.push({ name, environment, deploy: { via: 'release' } });
|
|
107
|
+
notes.push(releaseTargetNote(name));
|
|
108
|
+
}
|
|
75
109
|
return targets;
|
|
76
110
|
}
|
|
77
111
|
/** Suggests a `sdlc.config.yaml` from what the repository already has. Pure. */
|
|
78
112
|
export function detectConfig(probe) {
|
|
79
113
|
const notes = [];
|
|
80
114
|
const harnesses = detectHarnesses(probe.files, notes);
|
|
81
|
-
const targets = deriveTargets(probe.workflowEnvironments, notes);
|
|
115
|
+
const targets = deriveTargets(probe.workflowEnvironments, probe.releaseWorkflows, notes);
|
|
82
116
|
const testScript = probe.packageScripts.test;
|
|
83
117
|
const qualityGate = testScript !== undefined && !NPM_PLACEHOLDER_TEST.test(testScript) ? ['npm test'] : [];
|
|
84
118
|
let enabled = BUILTIN_TYPES.map(type => type.id);
|
|
@@ -173,6 +207,57 @@ export function scanWorkflowEnvironments(text) {
|
|
|
173
207
|
});
|
|
174
208
|
return found;
|
|
175
209
|
}
|
|
210
|
+
/** Publish commands, in order of preference: a registry wins over a bare GitHub Release. */
|
|
211
|
+
const PUBLISHERS = [
|
|
212
|
+
['npm', /\b(?:npm|pnpm) publish\b|\byarn npm publish\b/],
|
|
213
|
+
['pypi', /\btwine upload\b|pypa\/gh-action-pypi-publish/],
|
|
214
|
+
['crates', /\bcargo publish\b/],
|
|
215
|
+
['release', /\bgh release create\b|softprops\/action-gh-release|goreleaser/],
|
|
216
|
+
];
|
|
217
|
+
/** Whether a workflow's `on:` value includes a tag push or a release. */
|
|
218
|
+
function triggersOnRelease(on) {
|
|
219
|
+
if (typeof on === 'string')
|
|
220
|
+
return on === 'release';
|
|
221
|
+
if (Array.isArray(on))
|
|
222
|
+
return on.includes('release');
|
|
223
|
+
if (typeof on !== 'object' || on === null)
|
|
224
|
+
return false;
|
|
225
|
+
const triggers = on;
|
|
226
|
+
if ('release' in triggers)
|
|
227
|
+
return true;
|
|
228
|
+
const push = triggers.push;
|
|
229
|
+
return typeof push === 'object' && push !== null && 'tags' in push;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* The release target name for a workflow that publishes on a tag push or a release: `npm`, `pypi`,
|
|
233
|
+
* `crates`, or `release` for a GitHub Release alone. `undefined` when the workflow is not triggered
|
|
234
|
+
* that way, publishes nothing (comments and `--dry-run` lines do not count) or is not valid YAML.
|
|
235
|
+
*/
|
|
236
|
+
export function scanReleaseWorkflow(text) {
|
|
237
|
+
let doc;
|
|
238
|
+
try {
|
|
239
|
+
doc = parseYaml(text);
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
return undefined;
|
|
243
|
+
}
|
|
244
|
+
if (typeof doc !== 'object' || doc === null)
|
|
245
|
+
return undefined;
|
|
246
|
+
const root = doc;
|
|
247
|
+
// A YAML 1.1 reader turns the key `on` into `true`.
|
|
248
|
+
if (!triggersOnRelease(root.on ?? root.true))
|
|
249
|
+
return undefined;
|
|
250
|
+
const lines = text
|
|
251
|
+
.split(/\r?\n/)
|
|
252
|
+
.filter(line => !line.trimStart().startsWith('#'))
|
|
253
|
+
.map(line => line.replace(/\s#.*$/, ''))
|
|
254
|
+
.filter(line => !line.includes('--dry-run'));
|
|
255
|
+
for (const [name, pattern] of PUBLISHERS) {
|
|
256
|
+
if (lines.some(line => pattern.test(line)))
|
|
257
|
+
return name;
|
|
258
|
+
}
|
|
259
|
+
return undefined;
|
|
260
|
+
}
|
|
176
261
|
const MAX_DEPTH = 3;
|
|
177
262
|
const SKIPPED_DIRECTORIES = new Set(['.git', 'node_modules']);
|
|
178
263
|
/** Files and directories below `root`, at most `MAX_DEPTH` path segments deep; symlinks are listed, not followed. */
|
|
@@ -200,15 +285,16 @@ function listFiles(root) {
|
|
|
200
285
|
return paths;
|
|
201
286
|
}
|
|
202
287
|
const WORKFLOWS_DIR = '.github/workflows';
|
|
203
|
-
function
|
|
288
|
+
function readWorkflows(root) {
|
|
204
289
|
let names;
|
|
205
290
|
try {
|
|
206
291
|
names = readdirSync(join(root, WORKFLOWS_DIR)).filter(name => /\.ya?ml$/i.test(name)).sort();
|
|
207
292
|
}
|
|
208
293
|
catch {
|
|
209
|
-
return [];
|
|
294
|
+
return { workflowEnvironments: [], releaseWorkflows: [] };
|
|
210
295
|
}
|
|
211
296
|
const result = [];
|
|
297
|
+
const releaseWorkflows = [];
|
|
212
298
|
for (const name of names) {
|
|
213
299
|
let text;
|
|
214
300
|
try {
|
|
@@ -220,8 +306,11 @@ function readWorkflowEnvironments(root) {
|
|
|
220
306
|
for (const environment of scanWorkflowEnvironments(text)) {
|
|
221
307
|
result.push({ workflow: `${WORKFLOWS_DIR}/${name}`, environment });
|
|
222
308
|
}
|
|
309
|
+
const release = scanReleaseWorkflow(text);
|
|
310
|
+
if (release !== undefined)
|
|
311
|
+
releaseWorkflows.push({ workflow: `${WORKFLOWS_DIR}/${name}`, name: release });
|
|
223
312
|
}
|
|
224
|
-
return result;
|
|
313
|
+
return { workflowEnvironments: result, releaseWorkflows };
|
|
225
314
|
}
|
|
226
315
|
function readPackageScripts(root) {
|
|
227
316
|
try {
|
|
@@ -237,7 +326,7 @@ function readPackageScripts(root) {
|
|
|
237
326
|
}
|
|
238
327
|
/**
|
|
239
328
|
* Reads what `detectConfig` needs: the repository and the authenticated login from `gh` (the
|
|
240
|
-
* repository `gh` finds from the current directory), the file tree, the workflows' environments
|
|
329
|
+
* repository `gh` finds from the current directory), the file tree, the workflows' environments and release steps
|
|
241
330
|
* and the `package.json` scripts from `root`. Read-only.
|
|
242
331
|
*/
|
|
243
332
|
export async function probeRepo(run, root) {
|
|
@@ -256,7 +345,7 @@ export async function probeRepo(run, root) {
|
|
|
256
345
|
ownerType: view.isInOrganization ? 'org' : 'user',
|
|
257
346
|
login,
|
|
258
347
|
files: listFiles(root),
|
|
259
|
-
|
|
348
|
+
...readWorkflows(root),
|
|
260
349
|
packageScripts: readPackageScripts(root),
|
|
261
350
|
};
|
|
262
351
|
}
|
|
@@ -108,6 +108,7 @@ export function renderData(cfg, roles = builtinRoles()) {
|
|
|
108
108
|
defaultBranch: cfg.github.defaultBranch,
|
|
109
109
|
types,
|
|
110
110
|
productionData: types.some(type => type.id === 'production-data'),
|
|
111
|
+
deployTypes: types.some(type => type.endsOn === 'deploy'),
|
|
111
112
|
targets: cfg.targets.map((target) => ({
|
|
112
113
|
name: target.name,
|
|
113
114
|
environment: target.environment,
|
package/package.json
CHANGED
|
@@ -14,6 +14,9 @@ Work is tracked with the `sdlc` CLI as GitHub issues on a Projects board, and th
|
|
|
14
14
|
|
|
15
15
|
### Starting work
|
|
16
16
|
- New work request: run `sdlc task new --type <id> --title "<title>" --summary "<one line>"` before any brainstorming, diagnosis or edit. Propose the type; the owner can correct it (`sdlc task set-type`). An existing issue is adopted with `sdlc task new --issue <n> --type <id>`.
|
|
17
|
+
{{#if deployTypes}}
|
|
18
|
+
- Work that reaches users (code, a package, an app) is a type that ends on a deploy, such as `feature` or `bugfix`: after the merge it waits as Awaiting deployment until its targets are deployed or released. Use `tooling` only for changes that never ship (CI, repository setup, dev scripts).
|
|
19
|
+
{{/if}}
|
|
17
20
|
- Status question: answer it (`sdlc status`); create no task.
|
|
18
21
|
- Continuation of tracked work: stay in the same task and issue; never open a second one.
|
|
19
22
|
|