@intentius/sql-yodeler 0.7.0 → 0.8.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/apply-steps/index.d.ts +73 -21
- package/dist/apply-steps/index.js +171 -49
- package/dist/apply-steps/index.js.map +1 -1
- package/dist/ci/render.d.ts +7 -2
- package/dist/ci/render.js +12 -2
- package/dist/ci/render.js.map +1 -1
- package/dist/commands/apply.js +173 -64
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/drift.js +8 -8
- package/dist/commands/drift.js.map +1 -1
- package/dist/commands/override.js +46 -22
- package/dist/commands/override.js.map +1 -1
- package/dist/commands/plan.js +19 -19
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/revert.js +3 -2
- package/dist/commands/revert.js.map +1 -1
- package/dist/config/define.d.ts +5 -5
- package/dist/mcp/tools.d.ts +1 -1
- package/dist/mcp/tools.js +6 -4
- package/dist/mcp/tools.js.map +1 -1
- package/dist/notify/index.d.ts +30 -97
- package/dist/notify/index.js +50 -154
- package/dist/notify/index.js.map +1 -1
- package/dist/notify/verify.d.ts +17 -31
- package/dist/notify/verify.js +16 -47
- package/dist/notify/verify.js.map +1 -1
- package/dist/pr/forge.d.ts +33 -38
- package/dist/pr/forge.js +74 -97
- package/dist/pr/forge.js.map +1 -1
- package/dist/pr/issue.d.ts +16 -33
- package/dist/pr/issue.js +17 -88
- package/dist/pr/issue.js.map +1 -1
- package/dist/pr/model.js +7 -2
- package/dist/pr/model.js.map +1 -1
- package/dist/pr/render.js +2 -2
- package/dist/pr/render.js.map +1 -1
- package/dist/release/index.d.ts +63 -0
- package/dist/release/index.js +122 -0
- package/dist/release/index.js.map +1 -0
- package/dist/report/audit.d.ts +18 -19
- package/dist/report/audit.js +57 -27
- package/dist/report/audit.js.map +1 -1
- package/dist/report/model.js +18 -5
- package/dist/report/model.js.map +1 -1
- package/dist/tenants/wave.d.ts +6 -2
- package/dist/tenants/wave.js +1 -3
- package/dist/tenants/wave.js.map +1 -1
- package/dist/versioned/policy.d.ts +44 -24
- package/dist/versioned/policy.js +70 -37
- package/dist/versioned/policy.js.map +1 -1
- package/dist/waves/index.d.ts +4 -10
- package/dist/waves/index.js +8 -33
- package/dist/waves/index.js.map +1 -1
- package/package.json +7 -7
- package/schemas/event.schema.json +218 -26
- package/dist/pr/comment.d.ts +0 -32
- package/dist/pr/comment.js +0 -99
- package/dist/pr/comment.js.map +0 -1
package/dist/pr/forge.js
CHANGED
|
@@ -1,119 +1,96 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where `yodel plan <env> --comment`
|
|
3
|
-
*
|
|
4
|
-
* overridden by a
|
|
2
|
+
* Where `yodel plan <env> --comment` and `yodel drift <env> --issue` post:
|
|
3
|
+
* chant's forge client (`@intentius/chant/pr-forge`, #210) for the CI job's
|
|
4
|
+
* forge, repository, pull (merge) request and token, each overridden by a
|
|
5
|
+
* flag. chant reads the job's environment and makes every REST call; yodel
|
|
6
|
+
* keeps the flags and the bodies.
|
|
5
7
|
*
|
|
6
8
|
* - GitHub Actions: `GITHUB_ACTIONS=true`. `GITHUB_REPOSITORY`, the PR number
|
|
7
|
-
* from the event payload (`GITHUB_EVENT_PATH
|
|
8
|
-
* `
|
|
9
|
-
* https://api.github.com), token `GITHUB_TOKEN`.
|
|
9
|
+
* from the event payload (`GITHUB_EVENT_PATH`) or `refs/pull/<n>/merge` in
|
|
10
|
+
* `GITHUB_REF`, `GITHUB_API_URL` (default https://api.github.com).
|
|
10
11
|
* - GitLab CI: `GITLAB_CI=true`. `CI_API_V4_URL`, `CI_PROJECT_ID`,
|
|
11
|
-
* `CI_MERGE_REQUEST_IID` (a merge request pipeline)
|
|
12
|
-
* (a project or personal access token with `api` scope: `CI_JOB_TOKEN`
|
|
13
|
-
* cannot write merge request notes).
|
|
12
|
+
* `CI_MERGE_REQUEST_IID` (a merge request pipeline).
|
|
14
13
|
* - Forgejo Actions: `FORGEJO_ACTIONS=true` (runner 7 and later), or
|
|
15
14
|
* `GITEA_ACTIONS=true`, or a GitHub-style job whose API URL ends in
|
|
16
|
-
* `/api/v1`. `
|
|
17
|
-
* `
|
|
18
|
-
* `GITHUB_API_URL` (else `<server>/api/v1`), token `FORGEJO_TOKEN` /
|
|
19
|
-
* `GITHUB_TOKEN`.
|
|
15
|
+
* `/api/v1`. The `FORGEJO_*` variables before the `GITHUB_*` ones, and
|
|
16
|
+
* `<server>/api/v1` when no API URL is set.
|
|
20
17
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* The token is the first set of chant's `FORGE_TOKEN_ORDER`:
|
|
19
|
+
* `CHANT_GITHUB_TOKEN`, `GH_TOKEN`, `GITHUB_TOKEN` on GitHub;
|
|
20
|
+
* `CHANT_FORGEJO_TOKEN`, `FORGEJO_TOKEN`, `GH_TOKEN`, `GITHUB_TOKEN` on
|
|
21
|
+
* Forgejo; `CHANT_GITLAB_TOKEN`, `GITLAB_TOKEN`, `CI_JOB_TOKEN` on GitLab
|
|
22
|
+
* (`CI_JOB_TOKEN` cannot write merge request notes or issues: name a project
|
|
23
|
+
* access token with `api` scope). `--token-env <NAME>` names the one
|
|
24
|
+
* variable to read instead; the token itself is never a flag, never printed
|
|
25
|
+
* and never put in an error.
|
|
23
26
|
*/
|
|
24
|
-
import { readFileSync } from "node:fs";
|
|
25
27
|
import { YodelError } from "../project.js";
|
|
26
28
|
export const FORGES = ["github", "gitlab", "forgejo"];
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/** The PR number from a GitHub-style event payload, or from the ref. */
|
|
39
|
-
export function prFromEvent(eventPath, ref) {
|
|
40
|
-
if (eventPath) {
|
|
41
|
-
try {
|
|
42
|
-
const event = JSON.parse(readFileSync(eventPath, "utf8"));
|
|
43
|
-
const n = event.pull_request?.number ?? (event.issue?.pull_request ? event.issue.number : undefined) ?? (event.pull_request ? event.number : undefined);
|
|
44
|
-
if (typeof n === "number" && Number.isInteger(n) && n > 0)
|
|
45
|
-
return n;
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
// Unreadable payload: fall back to the ref.
|
|
29
|
+
/**
|
|
30
|
+
* The job's environment with the flags written in as the variables chant
|
|
31
|
+
* reads, so a flag wins over what the job carries: `--repo`, `--pr` and
|
|
32
|
+
* `--api-url` stand in for the job's repository, pull request and API.
|
|
33
|
+
*/
|
|
34
|
+
function withFlags(kind, flags, env) {
|
|
35
|
+
const out = { ...env };
|
|
36
|
+
if (kind === "gitlab") {
|
|
37
|
+
if (flags.repo !== undefined) {
|
|
38
|
+
out.CI_MERGE_REQUEST_PROJECT_ID = flags.repo;
|
|
39
|
+
out.CI_PROJECT_ID = flags.repo;
|
|
49
40
|
}
|
|
41
|
+
if (flags.pr !== undefined)
|
|
42
|
+
out.CI_MERGE_REQUEST_IID = flags.pr;
|
|
43
|
+
if (flags.apiUrl !== undefined)
|
|
44
|
+
out.CI_API_V4_URL = flags.apiUrl;
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
// A Forgejo job reads FORGEJO_* before GITHUB_*, so a flag sets both.
|
|
48
|
+
const set = (name, value) => {
|
|
49
|
+
out[`GITHUB_${name}`] = value;
|
|
50
|
+
out[`FORGEJO_${name}`] = value;
|
|
51
|
+
};
|
|
52
|
+
if (flags.repo !== undefined)
|
|
53
|
+
set("REPOSITORY", flags.repo);
|
|
54
|
+
if (flags.apiUrl !== undefined)
|
|
55
|
+
set("API_URL", flags.apiUrl);
|
|
56
|
+
if (flags.pr !== undefined) {
|
|
57
|
+
// The event payload names the pull request before the ref does.
|
|
58
|
+
set("EVENT_PATH", undefined);
|
|
59
|
+
set("REF", `refs/pull/${flags.pr}/merge`);
|
|
50
60
|
}
|
|
51
|
-
|
|
52
|
-
return m ? Number(m[1]) : undefined;
|
|
61
|
+
return out;
|
|
53
62
|
}
|
|
54
|
-
const DEFAULT_TOKEN_ENV = {
|
|
55
|
-
github: ["GITHUB_TOKEN"],
|
|
56
|
-
gitlab: ["GITLAB_TOKEN"],
|
|
57
|
-
forgejo: ["FORGEJO_TOKEN", "GITHUB_TOKEN"],
|
|
58
|
-
};
|
|
59
63
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
64
|
+
* chant's forge client for `--comment` (`withPr`: the pull request too) or
|
|
65
|
+
* `--issue`, from flags and the environment, or a YodelError saying what is
|
|
66
|
+
* missing. `what` names the option, for messages.
|
|
63
67
|
*/
|
|
64
|
-
function
|
|
68
|
+
export async function resolveForge(flags, env, what, fetchImpl) {
|
|
69
|
+
const withPr = what === "--comment";
|
|
65
70
|
if (flags.forge !== undefined && !FORGES.includes(flags.forge))
|
|
66
71
|
throw new YodelError(`--forge must be one of ${FORGES.join(", ")}, got ${JSON.stringify(flags.forge)}`);
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
if (flags.pr !== undefined && !/^[1-9]\d*$/.test(flags.pr))
|
|
73
|
+
throw new YodelError(`--pr must be a pull request number, got ${JSON.stringify(flags.pr)}`);
|
|
74
|
+
const { detectForge, forgeTargetFromEnv, forgeClient, ForgeEnvironmentError } = await import("@intentius/chant/pr-forge");
|
|
75
|
+
const kind = flags.forge ?? detectForge(env);
|
|
76
|
+
if (!kind)
|
|
69
77
|
throw new YodelError(`${what} cannot tell the forge: not a GitHub Actions, GitLab CI or Forgejo Actions job; pass --forge github|gitlab|forgejo with --repo${withPr ? ", --pr" : ""} and --api-url`);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
let apiUrl = flags.apiUrl;
|
|
74
|
-
if (forge === "gitlab") {
|
|
75
|
-
repo ??= pick("CI_PROJECT_ID", "CI_PROJECT_PATH");
|
|
76
|
-
pr ??= pick("CI_MERGE_REQUEST_IID") !== undefined ? Number(pick("CI_MERGE_REQUEST_IID")) : undefined;
|
|
77
|
-
apiUrl ??= pick("CI_API_V4_URL");
|
|
78
|
+
let target;
|
|
79
|
+
try {
|
|
80
|
+
target = forgeTargetFromEnv(withFlags(kind, flags, env), { kind, requirePr: withPr, ...(flags.tokenEnv ? { tokenEnv: flags.tokenEnv } : {}) });
|
|
78
81
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
apiUrl = `${server.replace(/\/+$/, "")}/api/v1`;
|
|
89
|
-
}
|
|
90
|
-
if (!apiUrl && forge === "github")
|
|
91
|
-
apiUrl = "https://api.github.com";
|
|
92
|
-
}
|
|
93
|
-
const missing = [];
|
|
94
|
-
if (!repo)
|
|
95
|
-
missing.push(forge === "gitlab" ? "the project (--repo, or CI_PROJECT_ID)" : "the repository (--repo owner/name, or GITHUB_REPOSITORY)");
|
|
96
|
-
if (withPr && (pr === undefined || !Number.isInteger(pr) || pr <= 0)) {
|
|
97
|
-
missing.push(forge === "gitlab" ? "the merge request (--pr, or CI_MERGE_REQUEST_IID in a merge request pipeline)" : "the pull request (--pr, or a pull_request event)");
|
|
82
|
+
catch (e) {
|
|
83
|
+
if (!(e instanceof ForgeEnvironmentError))
|
|
84
|
+
throw e;
|
|
85
|
+
const token = e.missing.some((m) => m.startsWith("a token"));
|
|
86
|
+
const hints = [
|
|
87
|
+
...(e.missing.some((m) => !m.startsWith("a token")) ? [`outside CI pass ${withPr ? "--repo, --pr and --api-url" : "--repo and --api-url"}`] : []),
|
|
88
|
+
...(token && !flags.tokenEnv ? ["name another token variable with --token-env"] : []),
|
|
89
|
+
];
|
|
90
|
+
throw new YodelError(`${what} on ${kind} needs ${e.missing.join(", ")}${hints.length ? `; ${hints.join("; ")}` : ""}`);
|
|
98
91
|
}
|
|
99
|
-
|
|
100
|
-
missing.push(forge === "gitlab" ? "the API URL (--api-url, or CI_API_V4_URL)" : "the API URL (--api-url, or FORGEJO_API_URL / GITHUB_API_URL)");
|
|
101
|
-
const names = flags.tokenEnv ? [flags.tokenEnv] : DEFAULT_TOKEN_ENV[forge];
|
|
102
|
-
const tokenEnv = names.find((n) => env[n]) ?? names[0] ?? "";
|
|
103
|
-
const token = env[tokenEnv] ?? "";
|
|
104
|
-
if (!token)
|
|
105
|
-
missing.push(`a token (${names.join(" or ")} is not set${flags.tokenEnv ? "" : "; name another variable with --token-env"})`);
|
|
106
|
-
if (missing.length > 0)
|
|
107
|
-
throw new YodelError(`${what} on ${forge} needs ${missing.join(", ")}`);
|
|
108
|
-
const base = { forge, repo: repo, apiUrl: apiUrl.replace(/\/+$/, ""), token, tokenEnv };
|
|
109
|
-
return withPr ? { ...base, pr: pr } : base;
|
|
110
|
-
}
|
|
111
|
-
/** Resolves the target from flags and the environment, or says what is missing. */
|
|
112
|
-
export function resolveForgeTarget(flags, env) {
|
|
113
|
-
return resolve(flags, env, "--comment", true);
|
|
114
|
-
}
|
|
115
|
-
/** The repository a job writes to (`yodel drift --issue`), from flags and the environment, or says what is missing. */
|
|
116
|
-
export function resolveForgeRepo(flags, env, what = "--issue") {
|
|
117
|
-
return resolve(flags, env, what, false);
|
|
92
|
+
return { target, client: forgeClient(target, fetchImpl) };
|
|
118
93
|
}
|
|
94
|
+
/** `github acme/db`, for messages. */
|
|
95
|
+
export const describeForge = (t) => `${t.kind} ${t.repo}`;
|
|
119
96
|
//# sourceMappingURL=forge.js.map
|
package/dist/pr/forge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forge.js","sourceRoot":"","sources":["../../src/pr/forge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"forge.js","sourceRoot":"","sources":["../../src/pr/forge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,CAAC,MAAM,MAAM,GAAyB,CAAC,QAAQ,EAAE,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AAC,IAAI,EAAE,CAAC"}
|
package/dist/pr/issue.d.ts
CHANGED
|
@@ -1,37 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The drift watch's tracking issue (#49): one open issue per project and
|
|
3
3
|
* environment, found by its marker, opened when drift is found, updated
|
|
4
|
-
* while it lasts, and closed, with a comment, when it is gone.
|
|
5
|
-
*
|
|
4
|
+
* while it lasts, and closed, with a comment, when it is gone. chant's
|
|
5
|
+
* `trackIssue` (#210) finds and writes it on each forge; yodel says what
|
|
6
|
+
* the run found.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* PUT {api}/projects/{id}/issues/{iid} description, or state_event close
|
|
12
|
-
* POST {api}/projects/{id}/issues/{iid}/notes
|
|
13
|
-
* Forgejo as GitHub, under /api/v1, with type=issues and limit
|
|
14
|
-
*
|
|
15
|
-
* The client lists only open issues, so a closed one is never reopened:
|
|
16
|
-
* drift found again after a close opens a new issue.
|
|
8
|
+
* Only open issues are read, so a closed one is never reopened: drift found
|
|
9
|
+
* again after a close opens a new issue. The issue counts as current while
|
|
10
|
+
* its title is the same and its body carries the drift's fingerprint, so a
|
|
11
|
+
* body that names a new run does not edit it on every scheduled run.
|
|
17
12
|
*/
|
|
18
|
-
import type {
|
|
19
|
-
export interface ForgeIssue {
|
|
20
|
-
number: number;
|
|
21
|
-
title: string;
|
|
22
|
-
body: string;
|
|
23
|
-
url?: string | undefined;
|
|
24
|
-
}
|
|
25
|
-
export interface IssueClient {
|
|
26
|
-
/** The open issues (not pull requests). */
|
|
27
|
-
open(): Promise<ForgeIssue[]>;
|
|
28
|
-
create(title: string, body: string): Promise<ForgeIssue>;
|
|
29
|
-
update(n: number, title: string, body: string): Promise<ForgeIssue>;
|
|
30
|
-
/** Comments `comment` on the issue, then closes it. */
|
|
31
|
-
close(n: number, comment: string): Promise<void>;
|
|
32
|
-
}
|
|
33
|
-
type Fetch = typeof fetch;
|
|
34
|
-
export declare function issueClient(t: ForgeRepo, f?: Fetch): IssueClient;
|
|
13
|
+
import type { PrForge } from "@intentius/chant/pr-forge";
|
|
35
14
|
/**
|
|
36
15
|
* The marker an environment's tracking issue carries, so the next run finds
|
|
37
16
|
* it. Keyed by the project's directory in its repository (`.` at the root),
|
|
@@ -53,16 +32,20 @@ export type DriftOutcome = {
|
|
|
53
32
|
kind: "unknown";
|
|
54
33
|
why: string;
|
|
55
34
|
};
|
|
35
|
+
/** The tracking issue a run touched. */
|
|
36
|
+
export interface TrackedIssue {
|
|
37
|
+
number: number;
|
|
38
|
+
url?: string | undefined;
|
|
39
|
+
}
|
|
56
40
|
export type IssueAction = {
|
|
57
41
|
action: "opened" | "updated" | "unchanged" | "closed";
|
|
58
|
-
issue:
|
|
42
|
+
issue: TrackedIssue;
|
|
59
43
|
} | {
|
|
60
44
|
action: "none";
|
|
61
45
|
} | {
|
|
62
46
|
action: "left";
|
|
63
47
|
why: string;
|
|
64
|
-
issue?:
|
|
48
|
+
issue?: TrackedIssue;
|
|
65
49
|
};
|
|
66
50
|
/** Brings the environment's tracking issue in line with the outcome; see the module comment. */
|
|
67
|
-
export declare function trackDrift(
|
|
68
|
-
export {};
|
|
51
|
+
export declare function trackDrift(forge: Pick<PrForge, "trackIssue">, marker: string, outcome: DriftOutcome): Promise<IssueAction>;
|
package/dist/pr/issue.js
CHANGED
|
@@ -1,81 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The drift watch's tracking issue (#49): one open issue per project and
|
|
3
3
|
* environment, found by its marker, opened when drift is found, updated
|
|
4
|
-
* while it lasts, and closed, with a comment, when it is gone.
|
|
5
|
-
*
|
|
4
|
+
* while it lasts, and closed, with a comment, when it is gone. chant's
|
|
5
|
+
* `trackIssue` (#210) finds and writes it on each forge; yodel says what
|
|
6
|
+
* the run found.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* PUT {api}/projects/{id}/issues/{iid} description, or state_event close
|
|
12
|
-
* POST {api}/projects/{id}/issues/{iid}/notes
|
|
13
|
-
* Forgejo as GitHub, under /api/v1, with type=issues and limit
|
|
14
|
-
*
|
|
15
|
-
* The client lists only open issues, so a closed one is never reopened:
|
|
16
|
-
* drift found again after a close opens a new issue.
|
|
8
|
+
* Only open issues are read, so a closed one is never reopened: drift found
|
|
9
|
+
* again after a close opens a new issue. The issue counts as current while
|
|
10
|
+
* its title is the same and its body carries the drift's fingerprint, so a
|
|
11
|
+
* body that names a new run does not edit it on every scheduled run.
|
|
17
12
|
*/
|
|
18
|
-
import { YodelError } from "../project.js";
|
|
19
|
-
const PAGE = 100;
|
|
20
|
-
const MAX_PAGES = 20;
|
|
21
|
-
const repoPath = (repo) => repo.split("/").map(encodeURIComponent).join("/");
|
|
22
|
-
export function issueClient(t, f = fetch) {
|
|
23
|
-
const gitlab = t.forge === "gitlab";
|
|
24
|
-
const headers = gitlab
|
|
25
|
-
? { "PRIVATE-TOKEN": t.token, Accept: "application/json" }
|
|
26
|
-
: t.forge === "forgejo"
|
|
27
|
-
? { Authorization: `token ${t.token}`, Accept: "application/json" }
|
|
28
|
-
: { Authorization: `Bearer ${t.token}`, Accept: "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28" };
|
|
29
|
-
const base = gitlab ? `${t.apiUrl}/projects/${encodeURIComponent(t.repo)}/issues` : `${t.apiUrl}/repos/${repoPath(t.repo)}/issues`;
|
|
30
|
-
const call = async (method, url, body) => {
|
|
31
|
-
let res;
|
|
32
|
-
try {
|
|
33
|
-
res = await f(url, { method, headers: { ...headers, ...(body ? { "Content-Type": "application/json" } : {}) }, ...(body ? { body: JSON.stringify(body) } : {}) });
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
throw new YodelError(`${t.forge}: ${method} ${url} failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
37
|
-
}
|
|
38
|
-
const text = await res.text();
|
|
39
|
-
if (!res.ok)
|
|
40
|
-
throw new YodelError(`${t.forge}: ${method} ${url} answered ${String(res.status)}: ${text.slice(0, 300).replaceAll(t.token, "[token]")}`);
|
|
41
|
-
return text ? JSON.parse(text) : {};
|
|
42
|
-
};
|
|
43
|
-
const toIssue = (r) => ({
|
|
44
|
-
number: Number(gitlab ? r.iid : r.number),
|
|
45
|
-
title: typeof r.title === "string" ? r.title : "",
|
|
46
|
-
body: typeof (gitlab ? r.description : r.body) === "string" ? String(gitlab ? r.description : r.body) : "",
|
|
47
|
-
url: typeof r.html_url === "string" ? r.html_url : typeof r.web_url === "string" ? r.web_url : undefined,
|
|
48
|
-
});
|
|
49
|
-
const list = (page) => gitlab
|
|
50
|
-
? `${base}?state=opened&per_page=${String(PAGE)}&page=${String(page)}`
|
|
51
|
-
: t.forge === "forgejo"
|
|
52
|
-
? `${base}?state=open&type=issues&limit=${String(PAGE)}&page=${String(page)}`
|
|
53
|
-
: `${base}?state=open&per_page=${String(PAGE)}&page=${String(page)}`;
|
|
54
|
-
return {
|
|
55
|
-
async open() {
|
|
56
|
-
const all = [];
|
|
57
|
-
for (let page = 1; page <= MAX_PAGES; page++) {
|
|
58
|
-
const got = (await call("GET", list(page)));
|
|
59
|
-
if (!Array.isArray(got))
|
|
60
|
-
throw new YodelError(`${t.forge}: listing issues did not return a list`);
|
|
61
|
-
all.push(...got.filter((r) => r.pull_request === undefined || r.pull_request === null).map(toIssue));
|
|
62
|
-
if (got.length < PAGE)
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
return all;
|
|
66
|
-
},
|
|
67
|
-
async create(title, body) {
|
|
68
|
-
return toIssue((await call("POST", base, gitlab ? { title, description: body } : { title, body })));
|
|
69
|
-
},
|
|
70
|
-
async update(n, title, body) {
|
|
71
|
-
return toIssue((await call(gitlab ? "PUT" : "PATCH", `${base}/${String(n)}`, gitlab ? { title, description: body } : { title, body })));
|
|
72
|
-
},
|
|
73
|
-
async close(n, comment) {
|
|
74
|
-
await call("POST", `${base}/${String(n)}/${gitlab ? "notes" : "comments"}`, { body: comment });
|
|
75
|
-
await call(gitlab ? "PUT" : "PATCH", `${base}/${String(n)}`, gitlab ? { state_event: "close" } : { state: "closed" });
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
13
|
/**
|
|
80
14
|
* The marker an environment's tracking issue carries, so the next run finds
|
|
81
15
|
* it. Keyed by the project's directory in its repository (`.` at the root),
|
|
@@ -86,22 +20,17 @@ export function driftIssueMarker(project, environment) {
|
|
|
86
20
|
return `<!-- yodel:drift project=${clean(project || ".")} env=${clean(environment)} -->`;
|
|
87
21
|
}
|
|
88
22
|
/** Brings the environment's tracking issue in line with the outcome; see the module comment. */
|
|
89
|
-
export async function trackDrift(
|
|
90
|
-
const
|
|
91
|
-
const
|
|
23
|
+
export async function trackDrift(forge, marker, outcome) {
|
|
24
|
+
const finding = outcome.kind === "drift" ? { title: outcome.title, body: `${marker}\n${outcome.body}` } : null;
|
|
25
|
+
const r = await forge.trackIssue(marker, finding, {
|
|
26
|
+
...(outcome.kind === "drift" ? { sameWhen: outcome.fingerprint } : {}),
|
|
27
|
+
...(outcome.kind === "clean" ? { closeOnClear: true, clearComment: outcome.comment } : {}),
|
|
28
|
+
});
|
|
29
|
+
const issue = r.number !== undefined ? { number: r.number, ...(r.url ? { url: r.url } : {}) } : undefined;
|
|
92
30
|
if (outcome.kind === "unknown")
|
|
93
31
|
return { action: "left", why: outcome.why, ...(issue ? { issue } : {}) };
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
await client.close(issue.number, outcome.comment);
|
|
98
|
-
return { action: "closed", issue };
|
|
99
|
-
}
|
|
100
|
-
const body = `${marker}\n${outcome.body}`;
|
|
101
|
-
if (!issue)
|
|
102
|
-
return { action: "opened", issue: await client.create(outcome.title, body) };
|
|
103
|
-
if (issue.body.includes(outcome.fingerprint) && issue.title === outcome.title)
|
|
104
|
-
return { action: "unchanged", issue };
|
|
105
|
-
return { action: "updated", issue: await client.update(issue.number, outcome.title, body) };
|
|
32
|
+
if (r.action === "none" || r.action === "left" || !issue)
|
|
33
|
+
return { action: "none" };
|
|
34
|
+
return { action: r.action, issue };
|
|
106
35
|
}
|
|
107
36
|
//# sourceMappingURL=issue.js.map
|
package/dist/pr/issue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue.js","sourceRoot":"","sources":["../../src/pr/issue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"issue.js","sourceRoot":"","sources":["../../src/pr/issue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,WAAmB;IACnE,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxE,OAAO,4BAA4B,KAAK,CAAC,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;AAC3F,CAAC;AAoBD,gGAAgG;AAChG,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAkC,EAAE,MAAc,EAAE,OAAqB;IACxG,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/G,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE;QAChD,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3F,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1G,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACzG,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACpF,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;AACrC,CAAC"}
|
package/dist/pr/model.js
CHANGED
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
* no ledger entry.
|
|
11
11
|
*/
|
|
12
12
|
import { approveCommand, migrationsApprovalAtBase, portFor, signFlag } from "../approval-mode/index.js";
|
|
13
|
+
import { OVERRIDE_OP } from "@intentius/chant/override-gate";
|
|
13
14
|
import { YodelError } from "../project.js";
|
|
14
15
|
import { migrationChecks, scanMigrations } from "../migrations/index.js";
|
|
15
16
|
import { describeTopology } from "../history/index.js";
|
|
16
17
|
import { asBackfill } from "../steps/kinds.js";
|
|
17
18
|
import { retainedNote } from "../cleanup/index.js";
|
|
18
19
|
import { EXIT_REFUSED } from "../exit.js";
|
|
19
|
-
import { BROKEN_CHAIN, findMigrateOp, inspect, gitLedger, judgePlan, migrateOpExample, migrationsDir, closeVersioned, openVersioned, outOfOrder, planDigest, sameDigest, statusReport, } from "../versioned/index.js";
|
|
20
|
+
import { BROKEN_CHAIN, findMigrateOp, inspect, gitLedger, judgePlan, overrideSourceAt, overrideSubject, migrateOpExample, migrationsDir, closeVersioned, openVersioned, outOfOrder, planDigest, sameDigest, statusReport, } from "../versioned/index.js";
|
|
20
21
|
import { currentSubject, explainAgainst, explainMove, latestApproval } from "../versioned/explain.js";
|
|
21
22
|
import { waveView } from "../waves/index.js";
|
|
22
23
|
import { policyAtBase } from "../config/base.js";
|
|
@@ -103,7 +104,11 @@ async function collectWith(project, env, options, venv, ordered, base, problems)
|
|
|
103
104
|
if (approval.kind !== "op" || options.ledger === null)
|
|
104
105
|
return undefined;
|
|
105
106
|
try {
|
|
106
|
-
|
|
107
|
+
const subject = overrideSubject((options.op ?? (await findMigrateOp(project, env, options.opName))).name);
|
|
108
|
+
if (!options.ledger)
|
|
109
|
+
return await overrideSourceAt(project.dir, subject, await migrationsApprovalAtBase(project, env.name, options.processEnv));
|
|
110
|
+
// A ledger port given in place of chant's reads the override gate's lines as any gate's; it holds no applied records.
|
|
111
|
+
return { subject, ledger: { ...(await options.ledger.read(OVERRIDE_OP)), applied: [] } };
|
|
107
112
|
}
|
|
108
113
|
catch {
|
|
109
114
|
return undefined;
|
package/dist/pr/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/pr/model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,OAAO,EAAE,QAAQ,EAAgC,MAAM,2BAA2B,CAAC;AAEtI,OAAO,EAAE,UAAU,EAAmD,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AAO,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnK,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,UAAU,GAAG,0CAA0C,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,2DAA2D,CAAC;IAC3L,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/pr/render.js
CHANGED
|
@@ -14,7 +14,7 @@ import { askedAgainLine, describeMove, encodeSubject } from "../versioned/explai
|
|
|
14
14
|
import { asBackfill, asForm, describeForm } from "../steps/kinds.js";
|
|
15
15
|
import { describeAccessSteps } from "../chant/access.js";
|
|
16
16
|
import { describeExpect } from "../migrations/checks.js";
|
|
17
|
-
import { describeResults } from "../versioned/policy.js";
|
|
17
|
+
import { describeResults, overrideCommand } from "../versioned/policy.js";
|
|
18
18
|
import { describeWave } from "../waves/index.js";
|
|
19
19
|
/** Whether a required environment's history records the migration applied. */
|
|
20
20
|
const ranOn = (p, id) => p.migrations.find((m) => m.id === id)?.ran ?? "not read";
|
|
@@ -207,7 +207,7 @@ function policyMarkdown(results, environment) {
|
|
|
207
207
|
}
|
|
208
208
|
const denied = results.filter((r) => r.outcome === "denied");
|
|
209
209
|
if (denied.length > 0) {
|
|
210
|
-
out.push("", `\`yodel apply\` refuses this plan until someone \`policy.overriders\` lists records why, for exactly this digest:`, "", fence(denied.map((r) =>
|
|
210
|
+
out.push("", `\`yodel apply\` refuses this plan until someone \`policy.overriders\` lists records why, for exactly this digest:`, "", fence(overrideCommand(environment, denied.map((r) => r.id)), "sh"));
|
|
211
211
|
}
|
|
212
212
|
return out;
|
|
213
213
|
}
|