@codyswann/lisa 2.294.0 → 2.295.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/dist/cli/gate-commands.d.ts +1 -3
- package/dist/cli/gate-commands.d.ts.map +1 -1
- package/dist/cli/gate-commands.js +0 -26
- package/dist/cli/gate-commands.js.map +1 -1
- package/dist/cli/index.d.ts +7 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +43 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/update-check.d.ts +0 -8
- package/dist/cli/update-check.d.ts.map +1 -1
- package/dist/cli/update-check.js +2 -4
- package/dist/cli/update-check.js.map +1 -1
- package/dist/core/project-config.d.ts +0 -3
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +40 -4
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +2 -28
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/sync/registry.d.ts.map +1 -1
- package/dist/sync/registry.js +6 -3
- package/dist/sync/registry.js.map +1 -1
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/rules/eager/config-resolution.md +0 -9
- package/plugins/lisa/rules/reference/config-resolution.md +0 -59
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/rules/eager/config-resolution.md +0 -9
- package/plugins/lisa-copilot/rules/reference/config-resolution.md +0 -59
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +0 -59
- package/plugins/lisa-cursor/rules/config-resolution.mdc +0 -9
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/src/base/rules/eager/config-resolution.md +0 -9
- package/plugins/src/base/rules/reference/config-resolution.md +0 -59
- package/dist/cli/deploy-status-adapter-github.d.ts +0 -20
- package/dist/cli/deploy-status-adapter-github.d.ts.map +0 -1
- package/dist/cli/deploy-status-adapter-github.js +0 -167
- package/dist/cli/deploy-status-adapter-github.js.map +0 -1
- package/dist/cli/deploy-status-adapter-jira.d.ts +0 -18
- package/dist/cli/deploy-status-adapter-jira.d.ts.map +0 -1
- package/dist/cli/deploy-status-adapter-jira.js +0 -215
- package/dist/cli/deploy-status-adapter-jira.js.map +0 -1
- package/dist/cli/deploy-status-adapter-linear.d.ts +0 -16
- package/dist/cli/deploy-status-adapter-linear.d.ts.map +0 -1
- package/dist/cli/deploy-status-adapter-linear.js +0 -204
- package/dist/cli/deploy-status-adapter-linear.js.map +0 -1
- package/dist/cli/deploy-status-adapter-shared.d.ts +0 -57
- package/dist/cli/deploy-status-adapter-shared.d.ts.map +0 -1
- package/dist/cli/deploy-status-adapter-shared.js +0 -62
- package/dist/cli/deploy-status-adapter-shared.js.map +0 -1
- package/dist/cli/deploy-status-adapter.d.ts +0 -49
- package/dist/cli/deploy-status-adapter.d.ts.map +0 -1
- package/dist/cli/deploy-status-adapter.js +0 -87
- package/dist/cli/deploy-status-adapter.js.map +0 -1
- package/dist/cli/deploy-status-refs.d.ts +0 -70
- package/dist/cli/deploy-status-refs.d.ts.map +0 -1
- package/dist/cli/deploy-status-refs.js +0 -195
- package/dist/cli/deploy-status-refs.js.map +0 -1
- package/dist/cli/deploy-status-sync-cmd.d.ts +0 -23
- package/dist/cli/deploy-status-sync-cmd.d.ts.map +0 -1
- package/dist/cli/deploy-status-sync-cmd.js +0 -75
- package/dist/cli/deploy-status-sync-cmd.js.map +0 -1
- package/dist/cli/deploy-status-sync-engine.d.ts +0 -49
- package/dist/cli/deploy-status-sync-engine.d.ts.map +0 -1
- package/dist/cli/deploy-status-sync-engine.js +0 -214
- package/dist/cli/deploy-status-sync-engine.js.map +0 -1
- package/dist/cli/deploy-status-sync-exec.d.ts +0 -73
- package/dist/cli/deploy-status-sync-exec.d.ts.map +0 -1
- package/dist/cli/deploy-status-sync-exec.js +0 -95
- package/dist/cli/deploy-status-sync-exec.js.map +0 -1
- package/dist/cli/kane-commands.d.ts +0 -21
- package/dist/cli/kane-commands.d.ts.map +0 -1
- package/dist/cli/kane-commands.js +0 -44
- package/dist/cli/kane-commands.js.map +0 -1
- package/dist/core/config-field-validation.d.ts +0 -19
- package/dist/core/config-field-validation.d.ts.map +0 -1
- package/dist/core/config-field-validation.js +0 -69
- package/dist/core/config-field-validation.js.map +0 -1
- package/dist/core/deploy-status-sync.d.ts +0 -103
- package/dist/core/deploy-status-sync.d.ts.map +0 -1
- package/dist/core/deploy-status-sync.js +0 -339
- package/dist/core/deploy-status-sync.js.map +0 -1
- package/dist/core/deploy-status-transition.d.ts +0 -97
- package/dist/core/deploy-status-transition.d.ts.map +0 -1
- package/dist/core/deploy-status-transition.js +0 -134
- package/dist/core/deploy-status-transition.js.map +0 -1
|
@@ -86,13 +86,4 @@ A non-integration environment bug is fixed, merged, and verified on that
|
|
|
86
86
|
environment branch first, then
|
|
87
87
|
forward cherry-picked down to the integration branch via a linked follow-up.
|
|
88
88
|
|
|
89
|
-
## Deploy status sync
|
|
90
|
-
|
|
91
|
-
`deployStatusSync` is an optional machine-written config block (`tier`, `provisioned` ids,
|
|
92
|
-
`linearBinding: labels|states`, `verifiedAt`). The deploy ladder is `deploy.order` (else canonical
|
|
93
|
-
`dev < staging < production`) over `deploy.branches` joined with the tracker's env-keyed done map;
|
|
94
|
-
a configured done status whose env has no branch is a config error — unless its value is exactly
|
|
95
|
-
the built-in default (a sync-materialized fallback, invisible everywhere: stripped before the
|
|
96
|
-
union, never blocking the alias) — and the sole `prod` ↔ `production` alias applies to the join.
|
|
97
|
-
|
|
98
89
|
Full reference: [reference/config-resolution.md](../reference/config-resolution.md).
|
|
@@ -596,65 +596,6 @@ This is the same `deploy.branches` map already used by env-keyed `done` (reverse
|
|
|
596
596
|
env from PR base branch) and the build flow (forward: base branch from env);
|
|
597
597
|
`deploy.order` only adds the ranking those two directions never needed.
|
|
598
598
|
|
|
599
|
-
### Deploy status sync (deployStatusSync)
|
|
600
|
-
|
|
601
|
-
`deployStatusSync` is an **optional, machine-written** section recorded by the
|
|
602
|
-
deploy-status-sync setup flow. Humans never need to author it; unknown fields
|
|
603
|
-
inside it are preserved on round-trip.
|
|
604
|
-
|
|
605
|
-
| Field | Type | Default | Meaning |
|
|
606
|
-
| --- | --- | --- | --- |
|
|
607
|
-
| `tier` | string | — | Provisioning tier chosen at setup time |
|
|
608
|
-
| `provisioned` | object (string → string) | — | Provisioned tracker artifact ids, keyed by artifact name |
|
|
609
|
-
| `linearBinding` | `"labels"` \| `"states"` | — | Whether Linear deploy statuses are represented as labels or workflow states |
|
|
610
|
-
| `verifiedAt` | string | — | Strict ISO-8601 UTC timestamp (`Z` suffix, e.g. `2026-01-01T00:00:00Z`) of the last successful verification |
|
|
611
|
-
|
|
612
|
-
**Ladder resolution.** The environment universe is the keys of
|
|
613
|
-
`deploy.branches`. Each env's done status comes from the tracker's env-keyed
|
|
614
|
-
done map — `github.labels.build.done`, `linear.labels.build.done`, or
|
|
615
|
-
`jira.workflow.done` — with configured entries winning over the built-in
|
|
616
|
-
defaults (`status:on-dev` / `status:on-stg` / `status:done` for label trackers;
|
|
617
|
-
`On Dev` / `On Stg` / `Done` for JIRA). Environments are ordered by
|
|
618
|
-
`deploy.order` when present (its env-name set must exactly match the keys of
|
|
619
|
-
`deploy.branches`); otherwise by the canonical `dev < staging < production`
|
|
620
|
-
rank, and an unrankable custom env name with more than one env configured is a
|
|
621
|
-
config error rather than a guess. A string-valued `done` binds only the
|
|
622
|
-
terminal (highest) rung; lower rungs fall back to the default table. An env
|
|
623
|
-
with a branch but no done status anywhere (possible only for custom names
|
|
624
|
-
outside the default tables) is **skipped**, not an error; an explicitly
|
|
625
|
-
configured done status whose env has no branch **is** a config error. A ladder
|
|
626
|
-
is flagged terminal-only when it resolves to exactly one rung **and** that
|
|
627
|
-
rung's env is the highest-ranked environment of the configured universe
|
|
628
|
-
(post-alias) — a sole surviving lower rung after skips is NOT terminal-only,
|
|
629
|
-
so downstream native closure never fires on an intermediate environment.
|
|
630
|
-
Absent or empty `deploy` yields an empty ladder, never an error.
|
|
631
|
-
|
|
632
|
-
**Alias.** Iff exactly one of `prod` / `production` appears across the
|
|
633
|
-
configured surfaces (`deploy.branches`, the configured done map,
|
|
634
|
-
`deploy.order`), the two spellings join as one environment — so
|
|
635
|
-
`branches.prod` meets the default `done.production` — and rungs report the
|
|
636
|
-
configured spelling. When both spellings appear they are distinct environments
|
|
637
|
-
and no aliasing occurs. No other alias exists.
|
|
638
|
-
|
|
639
|
-
**Materialized defaults are fallbacks.** `lisa sync` writes the full default
|
|
640
|
-
done map into config, so a configured done-map entry whose value is EXACTLY
|
|
641
|
-
the default table's value for that env is treated as a materialized fallback,
|
|
642
|
-
not operator intent — and it is invisible for ALL purposes: stripped before
|
|
643
|
-
the env-key union is computed, it never blocks the sole `prod` ↔ `production`
|
|
644
|
-
alias, never raises the done-without-branch error, and leaves the env exactly
|
|
645
|
-
as if it were unconfigured (so `branches.prod` beside a materialized
|
|
646
|
-
`production` entry still aliases to one prod rung). Only a value that DIFFERS
|
|
647
|
-
from the default is deliberate configuration: it participates in the union
|
|
648
|
-
(blocking the alias when it introduces the other spelling) and stays
|
|
649
|
-
protected by the error below.
|
|
650
|
-
|
|
651
|
-
**Error catalog** (verbatim):
|
|
652
|
-
|
|
653
|
-
- `Invalid deploy configuration in <source>: a done status ("<status>") is configured for environment "<env>", but deploy.branches has no "<env>" entry. Add deploy.branches.<env> (the git branch that deploys to <env>) or remove "<env>" from the done map.` (custom values only — default-identical entries fall back silently)
|
|
654
|
-
- `Invalid deploy.order in <source>: its environment names must exactly match the keys of deploy.branches. deploy.order has [<order-envs>]; deploy.branches has [<branch-envs>].` (also raised for duplicate `deploy.order` entries)
|
|
655
|
-
- `Invalid deploy.order in <source>: every entry must be an environment name string; found <entry>.`
|
|
656
|
-
- `Invalid deploy configuration in <source>: cannot order environment "<env>". Set deploy.order (environments listed lowest first, e.g. ["dev","staging","production"]) so Lisa knows the promotion order.`
|
|
657
|
-
|
|
658
599
|
### What's configurable, what's not
|
|
659
600
|
|
|
660
601
|
- **Status / label NAMES** are configurable per project — that's the point of the vocabulary maps.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type ExecGh, type TrackerAdapter } from "./deploy-status-adapter-shared.js";
|
|
2
|
-
/** Construction options for {@link createGithubAdapter}. */
|
|
3
|
-
export interface GithubAdapterOptions {
|
|
4
|
-
/** `owner/repo` the canonical refs belong to */
|
|
5
|
-
readonly repository: string;
|
|
6
|
-
/** Ladder done vocabulary, lowest rung first (config-sourced) */
|
|
7
|
-
readonly doneStatuses: readonly string[];
|
|
8
|
-
}
|
|
9
|
-
/** Injectable collaborators for {@link createGithubAdapter}. */
|
|
10
|
-
export interface GithubAdapterDeps {
|
|
11
|
-
readonly execGh: ExecGh;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Create the GitHub adapter.
|
|
15
|
-
* @param options - Repository and done vocabulary
|
|
16
|
-
* @param deps - gh executor
|
|
17
|
-
* @returns Tracker adapter over gh
|
|
18
|
-
*/
|
|
19
|
-
export declare function createGithubAdapter(options: GithubAdapterOptions, deps: GithubAdapterDeps): TrackerAdapter;
|
|
20
|
-
//# sourceMappingURL=deploy-status-adapter-github.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-status-adapter-github.d.ts","sourceRoot":"","sources":["../../src/cli/deploy-status-adapter-github.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,cAAc,EACpB,MAAM,mCAAmC,CAAC;AAE3C,4DAA4D;AAC5D,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,gEAAgE;AAChE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAgLD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,EAC7B,IAAI,EAAE,iBAAiB,GACtB,cAAc,CAgBhB"}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub tracker adapter for deploy-status-sync: label transitions, one
|
|
3
|
-
* marker-managed comment, and native closure — all via `gh` with fixed argv
|
|
4
|
-
* (ambient `gh` / `GITHUB_TOKEN` auth; credentials never in argv).
|
|
5
|
-
* @module cli/deploy-status-adapter-github
|
|
6
|
-
*/
|
|
7
|
-
import { DEPLOY_STATUS_SYNC_MARKER, } from "../core/deploy-status-transition.js";
|
|
8
|
-
import { deriveLabelState, } from "./deploy-status-adapter-shared.js";
|
|
9
|
-
const HIERARCHY_QUERY = "query($owner:String!,$repo:String!,$number:Int!){repository(owner:$owner,name:$repo){issue(number:$number){subIssues(first:100){nodes{state}}}}}";
|
|
10
|
-
/**
|
|
11
|
-
* Extract the issue number from a canonical `owner/repo#N` ref.
|
|
12
|
-
* @param ref - Canonical ref
|
|
13
|
-
* @returns Issue number as a string
|
|
14
|
-
*/
|
|
15
|
-
function issueNumber(ref) {
|
|
16
|
-
return ref.slice(ref.lastIndexOf("#") + 1);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Parse label names from a gh issue-view payload.
|
|
20
|
-
* @param value - Parsed issue JSON
|
|
21
|
-
* @returns Label names
|
|
22
|
-
*/
|
|
23
|
-
function labelNames(value) {
|
|
24
|
-
const labels = value.labels;
|
|
25
|
-
if (!Array.isArray(labels))
|
|
26
|
-
return [];
|
|
27
|
-
return labels.flatMap(label => typeof label.name === "string" ? [label.name] : []);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Count open sub-issues from the hierarchy GraphQL payload.
|
|
31
|
-
* @param value - Parsed GraphQL response
|
|
32
|
-
* @returns Number of open children
|
|
33
|
-
*/
|
|
34
|
-
function openChildrenOf(value) {
|
|
35
|
-
const nodes = value.data?.repository?.issue?.subIssues?.nodes;
|
|
36
|
-
if (!Array.isArray(nodes))
|
|
37
|
-
return 0;
|
|
38
|
-
return nodes.filter(node => node.state === "OPEN").length;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Fetch the vendor-neutral state snapshot for one issue.
|
|
42
|
-
* @param context - Bound adapter collaborators
|
|
43
|
-
* @param ref - Canonical ref
|
|
44
|
-
* @returns Item state
|
|
45
|
-
*/
|
|
46
|
-
async function fetchState(context, ref) {
|
|
47
|
-
const number = issueNumber(ref);
|
|
48
|
-
const issueRaw = await context.execGh([
|
|
49
|
-
"issue",
|
|
50
|
-
"view",
|
|
51
|
-
number,
|
|
52
|
-
"--repo",
|
|
53
|
-
context.repository,
|
|
54
|
-
"--json",
|
|
55
|
-
"number,state,labels",
|
|
56
|
-
]);
|
|
57
|
-
const issue = JSON.parse(issueRaw);
|
|
58
|
-
const [owner, repo] = context.repository.split("/");
|
|
59
|
-
// -f passes owner/repo as raw strings; -F stays only for the integer
|
|
60
|
-
// number variable — typed -F parsing of attacker-influencable strings
|
|
61
|
-
// could coerce them into unintended JSON values.
|
|
62
|
-
const hierarchyRaw = await context.execGh([
|
|
63
|
-
"api",
|
|
64
|
-
"graphql",
|
|
65
|
-
"-f",
|
|
66
|
-
`query=${HIERARCHY_QUERY}`,
|
|
67
|
-
"-f",
|
|
68
|
-
`owner=${owner ?? ""}`,
|
|
69
|
-
"-f",
|
|
70
|
-
`repo=${repo ?? ""}`,
|
|
71
|
-
"-F",
|
|
72
|
-
`number=${number}`,
|
|
73
|
-
]);
|
|
74
|
-
return {
|
|
75
|
-
ref,
|
|
76
|
-
...deriveLabelState(labelNames(issue), context.doneStatuses),
|
|
77
|
-
openChildren: openChildrenOf(JSON.parse(hierarchyRaw)),
|
|
78
|
-
closed: issue.state === "CLOSED",
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Move the issue to the target done label, removing the other done labels.
|
|
83
|
-
* @param context - Bound adapter collaborators
|
|
84
|
-
* @param ref - Canonical ref
|
|
85
|
-
* @param doneStatus - Target done label
|
|
86
|
-
*/
|
|
87
|
-
async function transition(context, ref, doneStatus) {
|
|
88
|
-
const removals = context.doneStatuses
|
|
89
|
-
.filter(status => status !== doneStatus)
|
|
90
|
-
.flatMap(status => ["--remove-label", status]);
|
|
91
|
-
await context.execGh([
|
|
92
|
-
"issue",
|
|
93
|
-
"edit",
|
|
94
|
-
issueNumber(ref),
|
|
95
|
-
"--repo",
|
|
96
|
-
context.repository,
|
|
97
|
-
"--add-label",
|
|
98
|
-
doneStatus,
|
|
99
|
-
...removals,
|
|
100
|
-
]);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Find-or-update the single marker-managed comment on the issue.
|
|
104
|
-
* @param context - Bound adapter collaborators
|
|
105
|
-
* @param ref - Canonical ref
|
|
106
|
-
* @param body - Deterministic comment body
|
|
107
|
-
* @returns Upsert outcome
|
|
108
|
-
*/
|
|
109
|
-
async function upsertComment(context, ref, body) {
|
|
110
|
-
const number = issueNumber(ref);
|
|
111
|
-
// --slurp wraps each page in one top-level array; without it, multi-page
|
|
112
|
-
// output is concatenated JSON documents that JSON.parse cannot read and a
|
|
113
|
-
// marker comment past page 1 would be re-created instead of updated.
|
|
114
|
-
const listRaw = await context.execGh([
|
|
115
|
-
"api",
|
|
116
|
-
`repos/${context.repository}/issues/${number}/comments`,
|
|
117
|
-
"--paginate",
|
|
118
|
-
"--slurp",
|
|
119
|
-
]);
|
|
120
|
-
const comments = JSON.parse(listRaw).flat();
|
|
121
|
-
const existing = comments.find(comment => typeof comment.body === "string" &&
|
|
122
|
-
comment.body.startsWith(DEPLOY_STATUS_SYNC_MARKER));
|
|
123
|
-
if (existing === undefined) {
|
|
124
|
-
await context.execGh([
|
|
125
|
-
"api",
|
|
126
|
-
`repos/${context.repository}/issues/${number}/comments`,
|
|
127
|
-
"-f",
|
|
128
|
-
`body=${body}`,
|
|
129
|
-
]);
|
|
130
|
-
return "created";
|
|
131
|
-
}
|
|
132
|
-
if (existing.body === body)
|
|
133
|
-
return "unchanged";
|
|
134
|
-
await context.execGh([
|
|
135
|
-
"api",
|
|
136
|
-
`repos/${context.repository}/issues/comments/${String(existing.id)}`,
|
|
137
|
-
"-X",
|
|
138
|
-
"PATCH",
|
|
139
|
-
"-f",
|
|
140
|
-
`body=${body}`,
|
|
141
|
-
]);
|
|
142
|
-
return "updated";
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Create the GitHub adapter.
|
|
146
|
-
* @param options - Repository and done vocabulary
|
|
147
|
-
* @param deps - gh executor
|
|
148
|
-
* @returns Tracker adapter over gh
|
|
149
|
-
*/
|
|
150
|
-
export function createGithubAdapter(options, deps) {
|
|
151
|
-
const context = { ...options, execGh: deps.execGh };
|
|
152
|
-
return {
|
|
153
|
-
fetchItemState: ref => fetchState(context, ref),
|
|
154
|
-
transitionToDone: (ref, doneStatus) => transition(context, ref, doneStatus),
|
|
155
|
-
upsertManagedComment: (ref, body) => upsertComment(context, ref, body),
|
|
156
|
-
closeNatively: async (ref) => {
|
|
157
|
-
await context.execGh([
|
|
158
|
-
"issue",
|
|
159
|
-
"close",
|
|
160
|
-
issueNumber(ref),
|
|
161
|
-
"--repo",
|
|
162
|
-
context.repository,
|
|
163
|
-
]);
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
//# sourceMappingURL=deploy-status-adapter-github.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-status-adapter-github.js","sourceRoot":"","sources":["../../src/cli/deploy-status-adapter-github.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,yBAAyB,GAE1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,gBAAgB,GAIjB,MAAM,mCAAmC,CAAC;AAoB3C,MAAM,eAAe,GACnB,kJAAkJ,CAAC;AAErJ;;;;GAIG;AACH,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,MAAM,MAAM,GAAI,KAAoD,CAAC,MAAM,CAAC;IAC5E,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,CAAC;IACtC,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAC5B,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAC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+0,0 @@
|
|
|
1
|
-
import type { TrackerAdapter, TrackerAdapterDeps } from "./deploy-status-adapter-shared.js";
|
|
2
|
-
/** Construction options for {@link createJiraAdapter}. */
|
|
3
|
-
export interface JiraAdapterOptions {
|
|
4
|
-
/** Atlassian cloud id (gateway base URL for writes) */
|
|
5
|
-
readonly cloudId?: string;
|
|
6
|
-
/** Site host fallback when no cloudId is configured */
|
|
7
|
-
readonly site?: string;
|
|
8
|
-
/** Login fallback when `JIRA_LOGIN` is unset */
|
|
9
|
-
readonly email?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Create the Jira adapter.
|
|
13
|
-
* @param options - Cloud id / site / login fallback
|
|
14
|
-
* @param deps - Injectable fetch and env
|
|
15
|
-
* @returns Tracker adapter over the Jira REST API
|
|
16
|
-
*/
|
|
17
|
-
export declare function createJiraAdapter(options: JiraAdapterOptions, deps?: TrackerAdapterDeps): TrackerAdapter;
|
|
18
|
-
//# sourceMappingURL=deploy-status-adapter-jira.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-status-adapter-jira.d.ts","sourceRoot":"","sources":["../../src/cli/deploy-status-adapter-jira.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAEV,cAAc,EACd,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AAG3C,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAuQD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,IAAI,GAAE,kBAAuB,GAC5B,cAAc,CAUhB"}
|