@fuzdev/fuz_gitops 0.78.0 → 0.79.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/README.md +91 -17
- package/dist/ModulesDetail.svelte +22 -27
- package/dist/ModulesDetail.svelte.d.ts.map +1 -1
- package/dist/ModulesNav.svelte +8 -5
- package/dist/ModulesNav.svelte.d.ts.map +1 -1
- package/dist/ModulesPage.svelte +3 -5
- package/dist/ModulesPage.svelte.d.ts.map +1 -1
- package/dist/PageFooter.svelte +2 -2
- package/dist/PageHeader.svelte +6 -6
- package/dist/PageHeader.svelte.d.ts +0 -3
- package/dist/PageHeader.svelte.d.ts.map +1 -1
- package/dist/PullRequestsDetail.svelte +29 -20
- package/dist/PullRequestsDetail.svelte.d.ts.map +1 -1
- package/dist/PullRequestsPage.svelte +4 -6
- package/dist/PullRequestsPage.svelte.d.ts.map +1 -1
- package/dist/ReposTable.svelte +43 -55
- package/dist/ReposTable.svelte.d.ts.map +1 -1
- package/dist/ReposTree.svelte +9 -21
- package/dist/ReposTree.svelte.d.ts.map +1 -1
- package/dist/ReposTreeNav.svelte +9 -12
- package/dist/ReposTreeNav.svelte.d.ts.map +1 -1
- package/dist/TablePage.svelte +3 -5
- package/dist/TablePage.svelte.d.ts.map +1 -1
- package/dist/TreeItemPage.svelte +3 -5
- package/dist/TreeItemPage.svelte.d.ts.map +1 -1
- package/dist/TreePage.svelte +3 -5
- package/dist/TreePage.svelte.d.ts.map +1 -1
- package/dist/changeset_generator.d.ts.map +1 -1
- package/dist/changeset_generator.js +2 -2
- package/dist/changeset_reader.d.ts.map +1 -1
- package/dist/changeset_reader.js +3 -3
- package/dist/ci_reconcile.d.ts +6 -10
- package/dist/ci_reconcile.d.ts.map +1 -1
- package/dist/ci_reconcile.js +6 -8
- package/dist/dependency_graph.d.ts +26 -49
- package/dist/dependency_graph.d.ts.map +1 -1
- package/dist/dependency_graph.js +40 -83
- package/dist/dependency_updater.d.ts +1 -1
- package/dist/dependency_updater.d.ts.map +1 -1
- package/dist/dependency_updater.js +14 -9
- package/dist/fetch_repo_data.d.ts +34 -8
- package/dist/fetch_repo_data.d.ts.map +1 -1
- package/dist/fetch_repo_data.js +44 -22
- package/dist/fs_fetch_value_cache.d.ts +1 -1
- package/dist/fs_fetch_value_cache.d.ts.map +1 -1
- package/dist/fs_fetch_value_cache.js +3 -3
- package/dist/git_operations.d.ts +6 -49
- package/dist/git_operations.d.ts.map +1 -1
- package/dist/git_operations.js +13 -126
- package/dist/github.d.ts +17 -2
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +17 -8
- package/dist/github_helpers.d.ts.map +1 -1
- package/dist/github_helpers.js +3 -11
- package/dist/gitops_analyze.task.d.ts +24 -2
- package/dist/gitops_analyze.task.d.ts.map +1 -1
- package/dist/gitops_analyze.task.js +47 -34
- package/dist/gitops_config.d.ts +34 -79
- package/dist/gitops_config.d.ts.map +1 -1
- package/dist/gitops_config.js +76 -53
- package/dist/gitops_constants.d.ts +6 -4
- package/dist/gitops_constants.d.ts.map +1 -1
- package/dist/gitops_constants.js +6 -4
- package/dist/gitops_plan.task.d.ts +29 -3
- package/dist/gitops_plan.task.d.ts.map +1 -1
- package/dist/gitops_plan.task.js +83 -61
- package/dist/gitops_publish.task.d.ts +62 -2
- package/dist/gitops_publish.task.d.ts.map +1 -1
- package/dist/gitops_publish.task.js +193 -105
- package/dist/gitops_run.task.d.ts +74 -0
- package/dist/gitops_run.task.d.ts.map +1 -1
- package/dist/gitops_run.task.js +176 -162
- package/dist/gitops_sync.task.d.ts +65 -3
- package/dist/gitops_sync.task.d.ts.map +1 -1
- package/dist/gitops_sync.task.js +163 -37
- package/dist/gitops_task_helpers.d.ts +86 -59
- package/dist/gitops_task_helpers.d.ts.map +1 -1
- package/dist/gitops_task_helpers.js +120 -79
- package/dist/gitops_validate.task.d.ts +1 -2
- package/dist/gitops_validate.task.d.ts.map +1 -1
- package/dist/gitops_validate.task.js +25 -32
- package/dist/graph_validation.d.ts +16 -27
- package/dist/graph_validation.d.ts.map +1 -1
- package/dist/graph_validation.js +24 -65
- package/dist/local_repo.d.ts +50 -62
- package/dist/local_repo.d.ts.map +1 -1
- package/dist/local_repo.js +83 -196
- package/dist/log_helpers.d.ts +8 -8
- package/dist/log_helpers.d.ts.map +1 -1
- package/dist/multi_repo_publisher.d.ts +10 -0
- package/dist/multi_repo_publisher.d.ts.map +1 -1
- package/dist/multi_repo_publisher.js +125 -61
- package/dist/npm_registry.d.ts +23 -19
- package/dist/npm_registry.d.ts.map +1 -1
- package/dist/npm_registry.js +21 -48
- package/dist/operations.d.ts +75 -180
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +15 -7
- package/dist/operations_defaults.d.ts +17 -2
- package/dist/operations_defaults.d.ts.map +1 -1
- package/dist/operations_defaults.js +111 -128
- package/dist/output_helpers.d.ts +36 -0
- package/dist/output_helpers.d.ts.map +1 -1
- package/dist/output_helpers.js +37 -3
- package/dist/preflight_checks.d.ts +20 -27
- package/dist/preflight_checks.d.ts.map +1 -1
- package/dist/preflight_checks.js +37 -126
- package/dist/publish_gate.d.ts.map +1 -1
- package/dist/publish_steps.d.ts +2 -4
- package/dist/publish_steps.d.ts.map +1 -1
- package/dist/publish_steps.js +4 -8
- package/dist/publishing_event.d.ts +2 -8
- package/dist/publishing_event.d.ts.map +1 -1
- package/dist/publishing_event.js +20 -17
- package/dist/publishing_event_handler.d.ts +10 -8
- package/dist/publishing_event_handler.d.ts.map +1 -1
- package/dist/publishing_event_handler.js +19 -17
- package/dist/publishing_plan.d.ts +16 -1
- package/dist/publishing_plan.d.ts.map +1 -1
- package/dist/publishing_plan.js +332 -254
- package/dist/publishing_plan_helpers.d.ts.map +1 -1
- package/dist/publishing_plan_helpers.js +3 -3
- package/dist/publishing_plan_logging.d.ts +1 -1
- package/dist/publishing_plan_logging.d.ts.map +1 -1
- package/dist/publishing_plan_logging.js +22 -15
- package/dist/repo.svelte.d.ts +7 -0
- package/dist/repo.svelte.d.ts.map +1 -1
- package/dist/repo.svelte.js +3 -0
- package/dist/repo_readiness.d.ts +210 -0
- package/dist/repo_readiness.d.ts.map +1 -0
- package/dist/repo_readiness.js +516 -0
- package/dist/repos_status.d.ts +3340 -0
- package/dist/repos_status.d.ts.map +1 -0
- package/dist/repos_status.js +555 -0
- package/dist/repos_status_load.d.ts +65 -0
- package/dist/repos_status_load.d.ts.map +1 -0
- package/dist/repos_status_load.js +131 -0
- package/dist/version_utils.js +1 -1
- package/package.json +15 -34
- package/src/lib/cargo_toml.ts +3 -3
- package/src/lib/changeset_generator.ts +19 -19
- package/src/lib/changeset_reader.ts +18 -18
- package/src/lib/ci_reconcile.ts +12 -16
- package/src/lib/dependency_graph.ts +61 -113
- package/src/lib/dependency_updater.ts +36 -30
- package/src/lib/fetch_repo_data.ts +71 -34
- package/src/lib/fs_fetch_value_cache.ts +15 -11
- package/src/lib/git_operations.ts +22 -194
- package/src/lib/github.ts +33 -21
- package/src/lib/github_helpers.ts +9 -16
- package/src/lib/gitops_analyze.task.ts +104 -66
- package/src/lib/gitops_config.ts +90 -139
- package/src/lib/gitops_constants.ts +6 -4
- package/src/lib/gitops_plan.task.ts +128 -76
- package/src/lib/gitops_publish.task.ts +280 -144
- package/src/lib/gitops_run.task.ts +265 -193
- package/src/lib/gitops_sync.task.ts +236 -52
- package/src/lib/gitops_task_helpers.ts +170 -114
- package/src/lib/gitops_validate.task.ts +44 -54
- package/src/lib/graph_validation.ts +28 -89
- package/src/lib/local_repo.ts +128 -335
- package/src/lib/log_helpers.ts +18 -28
- package/src/lib/multi_repo_publisher.ts +192 -110
- package/src/lib/npm_registry.ts +42 -67
- package/src/lib/operations.ts +99 -160
- package/src/lib/operations_defaults.ts +157 -201
- package/src/lib/output_helpers.ts +58 -6
- package/src/lib/preflight_checks.ts +52 -188
- package/src/lib/publish_gate.ts +7 -9
- package/src/lib/publish_steps.ts +27 -25
- package/src/lib/publishing_event.ts +26 -23
- package/src/lib/publishing_event_handler.ts +24 -22
- package/src/lib/publishing_plan.ts +474 -310
- package/src/lib/publishing_plan_helpers.ts +16 -12
- package/src/lib/publishing_plan_logging.ts +53 -44
- package/src/lib/repo.svelte.ts +16 -8
- package/src/lib/repo_readiness.ts +647 -0
- package/src/lib/repos_status.ts +671 -0
- package/src/lib/repos_status_load.ts +173 -0
- package/src/lib/version_utils.ts +3 -3
- package/dist/config_reconcile.d.ts +0 -46
- package/dist/config_reconcile.d.ts.map +0 -1
- package/dist/config_reconcile.js +0 -60
- package/dist/paths.d.ts +0 -7
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js +0 -6
- package/dist/repo_ops.d.ts +0 -59
- package/dist/repo_ops.d.ts.map +0 -1
- package/dist/repo_ops.js +0 -170
- package/dist/resolved_gitops_config.d.ts +0 -9
- package/dist/resolved_gitops_config.d.ts.map +0 -1
- package/dist/resolved_gitops_config.js +0 -12
- package/src/lib/config_reconcile.ts +0 -94
- package/src/lib/paths.ts +0 -6
- package/src/lib/repo_ops.ts +0 -216
- package/src/lib/resolved_gitops_config.ts +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishing_plan_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"publishing_plan_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAGN,KAAK,QAAQ,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACxC,OAAO,KAAK,CAAC,SAAS,CAAC,EACvB,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,mBAAmB,GAAG,CAAC,MAAM,CAAC,KAC5B;IACF,kBAAkB,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5C,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;CAwE9C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,GAC9C,MAAM,SAAS,EACf,oBAAoB,KAAK,CAAC,gBAAgB,CAAC,EAC3C,mBAAmB,GAAG,CAAC,MAAM,CAAC,KAC5B,QAAQ,GAAG,IAqBb,CAAC"}
|
|
@@ -28,7 +28,7 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
28
28
|
updated_dependency: dep_name,
|
|
29
29
|
current_version,
|
|
30
30
|
new_version,
|
|
31
|
-
type: 'dependencies'
|
|
31
|
+
type: 'dependencies'
|
|
32
32
|
});
|
|
33
33
|
if (breaking_packages.has(dep_name)) {
|
|
34
34
|
const cascades = breaking_cascades.get(dep_name) || [];
|
|
@@ -50,7 +50,7 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
50
50
|
updated_dependency: dep_name,
|
|
51
51
|
current_version,
|
|
52
52
|
new_version,
|
|
53
|
-
type: 'peerDependencies'
|
|
53
|
+
type: 'peerDependencies'
|
|
54
54
|
});
|
|
55
55
|
if (breaking_packages.has(dep_name)) {
|
|
56
56
|
const cascades = breaking_cascades.get(dep_name) || [];
|
|
@@ -72,7 +72,7 @@ export const calculate_dependency_updates = (repos, predicted_versions, breaking
|
|
|
72
72
|
updated_dependency: dep_name,
|
|
73
73
|
current_version,
|
|
74
74
|
new_version,
|
|
75
|
-
type: 'devDependencies'
|
|
75
|
+
type: 'devDependencies'
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishing_plan_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_logging.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"publishing_plan_logging.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/publishing_plan_logging.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAEN,KAAK,cAAc,EAQnB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,cAAc;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AA6GD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,cAAc,EACpB,KAAK,MAAM,EACX,UAAS,cAAmB,KAC1B,IAmJF,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { styleText as st } from 'node:util';
|
|
9
|
+
import { version_change_kind } from './publishing_plan.js';
|
|
9
10
|
const SEPARATOR = '────────────────────────────────────────';
|
|
10
11
|
/**
|
|
11
12
|
* Logs a section header with separators.
|
|
@@ -22,7 +23,7 @@ const log_section_header = (title, log) => {
|
|
|
22
23
|
const format_dep_diff = (dep_name, current, next) => {
|
|
23
24
|
return [
|
|
24
25
|
st('red', ` - "${dep_name}": "${current}"`),
|
|
25
|
-
st('green', ` + "${dep_name}": "${next}"`)
|
|
26
|
+
st('green', ` + "${dep_name}": "${next}"`)
|
|
26
27
|
];
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
@@ -45,23 +46,24 @@ const get_updates_for_package = (pkg_name, dependency_updates) => {
|
|
|
45
46
|
const log_version_change_with_diffs = (change, index, total, dependency_updates, breaking_cascades, log) => {
|
|
46
47
|
const breaking_indicator = change.breaking ? st('red', ' BREAKING') : '';
|
|
47
48
|
const position = st('dim', `[${index + 1}/${total}]`);
|
|
49
|
+
const kind = version_change_kind(change);
|
|
48
50
|
// Determine scenario label
|
|
49
51
|
let scenario_label = '';
|
|
50
|
-
if (
|
|
52
|
+
if (kind === 'escalation') {
|
|
51
53
|
scenario_label = st('yellow', ` [${change.existing_bump} → ${change.required_bump}]`);
|
|
52
54
|
}
|
|
53
|
-
else if (
|
|
55
|
+
else if (kind === 'auto') {
|
|
54
56
|
scenario_label = st('cyan', ' [auto-changeset]');
|
|
55
57
|
}
|
|
56
58
|
// Main version line
|
|
57
59
|
log.info(`${position} ${change.package_name}: ${change.from} → ${st('green', change.to)} ` +
|
|
58
60
|
`(${change.bump_type})${scenario_label}${breaking_indicator}`);
|
|
59
61
|
// Show escalation reason
|
|
60
|
-
if (
|
|
62
|
+
if (kind === 'escalation') {
|
|
61
63
|
log.info(st('dim', ` changesets specify ${change.existing_bump}, dependencies require ${change.required_bump}`));
|
|
62
64
|
}
|
|
63
65
|
// Show trigger reason for auto-changesets
|
|
64
|
-
if (
|
|
66
|
+
if (kind === 'auto') {
|
|
65
67
|
// Find what triggered this
|
|
66
68
|
const triggers = [];
|
|
67
69
|
for (const [pkg, affected] of breaking_cascades) {
|
|
@@ -93,7 +95,7 @@ const log_version_change_with_diffs = (change, index, total, dependency_updates,
|
|
|
93
95
|
* dependency-only updates, warnings, and a summary.
|
|
94
96
|
*/
|
|
95
97
|
export const log_publishing_plan = (plan, log, options = {}) => {
|
|
96
|
-
const { publishing_order, version_changes, dependency_updates, breaking_cascades, warnings, info,
|
|
98
|
+
const { publishing_order, version_changes, dependency_updates, breaking_cascades, warnings, info, no_changes, errors } = plan;
|
|
97
99
|
// Errors first (blocking issues)
|
|
98
100
|
if (errors.length > 0) {
|
|
99
101
|
log.error(st('red', 'Errors:'));
|
|
@@ -116,14 +118,14 @@ export const log_publishing_plan = (plan, log, options = {}) => {
|
|
|
116
118
|
const idx_b = publishing_order.indexOf(b.package_name);
|
|
117
119
|
return idx_a - idx_b;
|
|
118
120
|
});
|
|
119
|
-
// Separate into groups for headers
|
|
120
|
-
const with_changesets = ordered_changes.filter((vc) => vc
|
|
121
|
-
const with_escalation = ordered_changes.filter((vc) => vc
|
|
122
|
-
const with_auto_changesets = ordered_changes.filter((vc) => vc
|
|
121
|
+
// Separate into groups for headers; each change lands in exactly one
|
|
122
|
+
const with_changesets = ordered_changes.filter((vc) => version_change_kind(vc) === 'explicit');
|
|
123
|
+
const with_escalation = ordered_changes.filter((vc) => version_change_kind(vc) === 'escalation');
|
|
124
|
+
const with_auto_changesets = ordered_changes.filter((vc) => version_change_kind(vc) === 'auto');
|
|
123
125
|
// A single running counter across all groups so positions read 1..N with no
|
|
124
126
|
// gaps. (Numbering per-group index would make the first group skip the numbers
|
|
125
127
|
// that land in a later group, e.g. jump from `[9/12]` to `[11/12]`.)
|
|
126
|
-
const total =
|
|
128
|
+
const total = ordered_changes.length;
|
|
127
129
|
let position = 0;
|
|
128
130
|
const log_change_group = (title, color, changes) => {
|
|
129
131
|
if (changes.length === 0)
|
|
@@ -174,14 +176,19 @@ export const log_publishing_plan = (plan, log, options = {}) => {
|
|
|
174
176
|
}
|
|
175
177
|
log.info('');
|
|
176
178
|
}
|
|
177
|
-
// Info
|
|
178
|
-
|
|
179
|
-
log.info(st('dim',
|
|
179
|
+
// Info sentences, then the packages with nothing to publish
|
|
180
|
+
for (const line of info) {
|
|
181
|
+
log.info(st('dim', line));
|
|
182
|
+
}
|
|
183
|
+
if (no_changes.length > 0) {
|
|
184
|
+
log.info(st('dim', `No changes: ${no_changes.join(', ')}`));
|
|
185
|
+
}
|
|
186
|
+
if (info.length > 0 || no_changes.length > 0) {
|
|
180
187
|
log.info('');
|
|
181
188
|
}
|
|
182
189
|
// Summary
|
|
183
190
|
const major_count = version_changes.filter((vc) => vc.breaking).length;
|
|
184
|
-
const auto_count = version_changes.filter((vc) => vc
|
|
191
|
+
const auto_count = version_changes.filter((vc) => version_change_kind(vc) === 'auto').length;
|
|
185
192
|
log.info(st('cyan', 'Summary:'));
|
|
186
193
|
log.info(` ${version_changes.length} packages to publish`);
|
|
187
194
|
if (auto_count > 0) {
|
package/dist/repo.svelte.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ import { GithubCheckRunsItem, type GithubPullRequest } from './github.js';
|
|
|
14
14
|
export interface RepoJson {
|
|
15
15
|
library_json: LibraryJson;
|
|
16
16
|
package_json: PackageJson;
|
|
17
|
+
/**
|
|
18
|
+
* The branch the repo's registry entry follows, which `check_runs` was
|
|
19
|
+
* fetched for. `Repo.branch` reads `main` when it's absent.
|
|
20
|
+
*/
|
|
21
|
+
branch?: string;
|
|
17
22
|
check_runs: GithubCheckRunsItem | null;
|
|
18
23
|
pull_requests: Array<GithubPullRequest> | null;
|
|
19
24
|
}
|
|
@@ -27,6 +32,8 @@ export declare class Repo {
|
|
|
27
32
|
readonly library: Library;
|
|
28
33
|
/** The repo's full `package.json` (with `dependencies`/`devDependencies`). */
|
|
29
34
|
readonly package_json: PackageJson;
|
|
35
|
+
/** The branch CI status was fetched for and the dashboard links to. */
|
|
36
|
+
readonly branch: string;
|
|
30
37
|
check_runs: GithubCheckRunsItem | null;
|
|
31
38
|
pull_requests: Array<GithubPullRequest> | null;
|
|
32
39
|
get name(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"repo.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EA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MAAM,WAAW,GAAI,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,cAAc,MAAM,KAAG,KAMtE,CAAC"}
|
package/dist/repo.svelte.js
CHANGED
|
@@ -11,6 +11,8 @@ export class Repo {
|
|
|
11
11
|
library;
|
|
12
12
|
/** The repo's full `package.json` (with `dependencies`/`devDependencies`). */
|
|
13
13
|
package_json;
|
|
14
|
+
/** The branch CI status was fetched for and the dashboard links to. */
|
|
15
|
+
branch;
|
|
14
16
|
check_runs;
|
|
15
17
|
pull_requests;
|
|
16
18
|
// Convenience getters delegating to library
|
|
@@ -48,6 +50,7 @@ export class Repo {
|
|
|
48
50
|
constructor(repo_json) {
|
|
49
51
|
this.library = new Library(repo_json.library_json);
|
|
50
52
|
this.package_json = repo_json.package_json;
|
|
53
|
+
this.branch = repo_json.branch ?? 'main';
|
|
51
54
|
this.check_runs = repo_json.check_runs;
|
|
52
55
|
this.pull_requests = repo_json.pull_requests;
|
|
53
56
|
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether each configured repo sits where the registry puts it, read from the
|
|
3
|
+
* entries `repos status --json` reports: the facts `gitops_publish --wetrun`
|
|
4
|
+
* gates on, the ones `gitops_sync` refuses or warns on, and the at-rest block
|
|
5
|
+
* the read-only diagnostics print.
|
|
6
|
+
*
|
|
7
|
+
* Pure — a report's facts in, problems and their messages out; no git calls.
|
|
8
|
+
* The facts are decided on the Rust side (`at_rest`, `fetch_error`, a
|
|
9
|
+
* checkout's `busy`, `needs_human`); this reads them, never re-derives them.
|
|
10
|
+
*
|
|
11
|
+
* Three readings:
|
|
12
|
+
*
|
|
13
|
+
* - **at rest** (`repo_readiness_at_rest`) — the primary checkout on the
|
|
14
|
+
* branch the entry follows, clean (untracked files count), no operation in
|
|
15
|
+
* progress, and that branch in sync with its origin upstream as of the
|
|
16
|
+
* local remote-tracking refs. What the diagnostics report.
|
|
17
|
+
* - **ready to publish** (`repo_readiness_for_publish`) — at rest, except
|
|
18
|
+
* that the followed branch may be ahead of origin (origin's tip is then an
|
|
19
|
+
* ancestor, so the plan misses nothing and the release push is still a
|
|
20
|
+
* fast-forward), and also fetched without error (so the relation is
|
|
21
|
+
* origin's current word), no other live Claude Code session in the primary
|
|
22
|
+
* checkout (the executor commits there), and nothing the entry leaves to a
|
|
23
|
+
* person (`needs_human`).
|
|
24
|
+
* - **ready to generate** (`repo_readiness_for_gen`) — what `gitops_sync`
|
|
25
|
+
* needs before it writes the dashboard's site data: the primary checkout
|
|
26
|
+
* on its branch, clean, and idle, since the site pairs each repo's local
|
|
27
|
+
* tree with origin's CI. The followed branch's relation to origin and a
|
|
28
|
+
* failed fetch only warn.
|
|
29
|
+
*
|
|
30
|
+
* @module
|
|
31
|
+
*/
|
|
32
|
+
import type { Result } from '@fuzdev/fuz_util/result.ts';
|
|
33
|
+
import type { ReposEntryStatus, ReposFetchFailure, ReposHead, ReposInProgressOp, ReposNeedsHuman, ReposRelation, ReposSession, ReposStatusReport, ReposUncommitted } from './repos_status.js';
|
|
34
|
+
/** One way a repo isn't where the registry puts it, or isn't ready to publish. */
|
|
35
|
+
export type RepoReadinessProblem = {
|
|
36
|
+
kind: 'unprobed';
|
|
37
|
+
detail: string;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'no_branch';
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'off_branch';
|
|
42
|
+
branch: string;
|
|
43
|
+
head: ReposHead;
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'dirty';
|
|
46
|
+
uncommitted: ReposUncommitted;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'in_progress';
|
|
49
|
+
op: ReposInProgressOp | null;
|
|
50
|
+
} | {
|
|
51
|
+
kind: 'followed';
|
|
52
|
+
branch: string;
|
|
53
|
+
relation: ReposRelation | null;
|
|
54
|
+
} | {
|
|
55
|
+
kind: 'fetch_failed';
|
|
56
|
+
failure: ReposFetchFailure;
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'busy';
|
|
59
|
+
sessions: Array<ReposSession>;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'needs_human';
|
|
62
|
+
reason: ReposNeedsHuman;
|
|
63
|
+
};
|
|
64
|
+
/** A repo's readiness problems, by registry key; `entry` is `null` when the report lacks it. */
|
|
65
|
+
export interface RepoReadiness {
|
|
66
|
+
key: string;
|
|
67
|
+
entry: ReposEntryStatus | null;
|
|
68
|
+
problems: Array<RepoReadinessProblem>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The ways an entry's primary checkout isn't at rest where the registry puts
|
|
72
|
+
* it, from its `at_rest` facts: empty when it is.
|
|
73
|
+
*
|
|
74
|
+
* @param entry - the entry as `repos status --json` reported it
|
|
75
|
+
* @returns the problems, in a fixed order: unprobed alone, else branch, dirt, operation, then the followed branch's relation
|
|
76
|
+
*/
|
|
77
|
+
export declare const repo_readiness_at_rest: (entry: ReposEntryStatus) => Array<RepoReadinessProblem>;
|
|
78
|
+
/**
|
|
79
|
+
* The ways an entry isn't ready for `gitops_publish --wetrun`: not at rest
|
|
80
|
+
* (`repo_readiness_at_rest`) other than its followed branch being ahead of
|
|
81
|
+
* origin, its fetch failed, another live session works in its primary
|
|
82
|
+
* checkout, or it has a `needs_human` reason. Ahead is ready: origin's tip is
|
|
83
|
+
* an ancestor of the branch, so the plan misses nothing and `gro publish`'s
|
|
84
|
+
* push stays a fast-forward, pushing those commits with the release (see
|
|
85
|
+
* `format_readiness_ahead`). A reason restating
|
|
86
|
+
* an at-rest problem (the primary's operation or detached HEAD) is left out,
|
|
87
|
+
* and a `default_branch_*` reason stands in for the followed-branch problem
|
|
88
|
+
* it explains.
|
|
89
|
+
*
|
|
90
|
+
* @param entry - the entry as `repos status --fetch --json` reported it
|
|
91
|
+
* @returns the problems; empty when the entry is ready
|
|
92
|
+
*/
|
|
93
|
+
export declare const repo_readiness_for_publish: (entry: ReposEntryStatus) => Array<RepoReadinessProblem>;
|
|
94
|
+
/** Options for the messages naming what's wrong and the fix. */
|
|
95
|
+
export interface RepoReadinessFormatOptions {
|
|
96
|
+
/** The `repos` invocation fixes name; `repos --registry <path>` when the run passed one. */
|
|
97
|
+
repos_command?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* What a readiness problem says is wrong with the repo keyed `key`, and the
|
|
101
|
+
* fix, when there is one to name.
|
|
102
|
+
*
|
|
103
|
+
* @param key - the repo's registry key
|
|
104
|
+
* @param problem - one of the repo's readiness problems
|
|
105
|
+
* @param options - the `repos` invocation fixes name
|
|
106
|
+
* @returns what's wrong, and the fix
|
|
107
|
+
*/
|
|
108
|
+
export declare const format_repo_readiness_problem: (key: string, problem: RepoReadinessProblem, options?: RepoReadinessFormatOptions) => {
|
|
109
|
+
what: string;
|
|
110
|
+
fix: string;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Checks a `repos status --fetch --json` report on the repos a real publish
|
|
114
|
+
* reads and writes: every key's entry ready (`repo_readiness_for_publish`),
|
|
115
|
+
* the report fetched, and busy detection available, since a live session it
|
|
116
|
+
* can't vouch for may be working in any checkout.
|
|
117
|
+
*
|
|
118
|
+
* @param options.report - the report, made with `--fetch`
|
|
119
|
+
* @param options.keys - the registry keys that must be ready
|
|
120
|
+
* @returns `ahead`, the ready repos whose followed branch is ahead of origin; and on failure a message naming each repo, what's wrong, and the fix, its `lines`, and every not-ready repo
|
|
121
|
+
*/
|
|
122
|
+
export declare const check_publish_readiness: (options: {
|
|
123
|
+
report: ReposStatusReport;
|
|
124
|
+
keys: ReadonlyArray<string>;
|
|
125
|
+
} & RepoReadinessFormatOptions) => Result<{
|
|
126
|
+
ahead: Array<ReadinessAhead>;
|
|
127
|
+
}, {
|
|
128
|
+
message: string;
|
|
129
|
+
lines: Array<string>;
|
|
130
|
+
not_ready: Array<RepoReadiness>;
|
|
131
|
+
ahead: Array<ReadinessAhead>;
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* An entry's problems for `gitops_sync`, split by what they do to the run:
|
|
135
|
+
* `refused` stops it, `warned` is logged. Off its branch, dirty, or mid-operation
|
|
136
|
+
* refuses, since the site would show that working tree's modules beside origin's
|
|
137
|
+
* CI — unless `allow_dirty`, which reads the repo as it sits and warns instead.
|
|
138
|
+
* A checkout that can't be read, or an entry following no branch (only a
|
|
139
|
+
* reference follows none, and the config refuses references), always
|
|
140
|
+
* refuses. The followed branch not in sync
|
|
141
|
+
* with origin (behind, say: CI is origin's tip, the modules the local tree) and
|
|
142
|
+
* a failed fetch (the last fetch's view stands) warn. Busy sessions and
|
|
143
|
+
* `needs_human` reasons don't matter: generating writes nothing in the repo.
|
|
144
|
+
*
|
|
145
|
+
* @param entry - the entry as `repos status --json` reported it
|
|
146
|
+
* @param options.allow_dirty - read a repo off its branch, dirty, or mid-operation as it sits
|
|
147
|
+
* @returns the problems that refuse, and those that warn
|
|
148
|
+
*/
|
|
149
|
+
export declare const repo_readiness_for_gen: (entry: ReposEntryStatus, options?: {
|
|
150
|
+
allow_dirty?: boolean;
|
|
151
|
+
}) => {
|
|
152
|
+
refused: Array<RepoReadinessProblem>;
|
|
153
|
+
warned: Array<RepoReadinessProblem>;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Checks a `repos status --json` report on the repos `gitops_sync` generates
|
|
157
|
+
* the site data from (`repo_readiness_for_gen`).
|
|
158
|
+
*
|
|
159
|
+
* @param options.report - the report
|
|
160
|
+
* @param options.keys - the registry keys whose repos the site data reads
|
|
161
|
+
* @param options.allow_dirty - read repos off their branch, dirty, or mid-operation as they sit
|
|
162
|
+
* @param options.now - the current time in unix seconds, for how long ago each repo was fetched (defaults to the clock)
|
|
163
|
+
* @returns `warnings`, a line per problem that doesn't refuse; and on failure also a message naming each refused repo, what's wrong, and the fix, and its `lines`
|
|
164
|
+
*/
|
|
165
|
+
export declare const check_gen_readiness: (options: {
|
|
166
|
+
report: ReposStatusReport;
|
|
167
|
+
keys: ReadonlyArray<string>;
|
|
168
|
+
allow_dirty?: boolean;
|
|
169
|
+
now?: number;
|
|
170
|
+
} & RepoReadinessFormatOptions) => Result<{
|
|
171
|
+
warnings: Array<string>;
|
|
172
|
+
}, {
|
|
173
|
+
message: string;
|
|
174
|
+
lines: Array<string>;
|
|
175
|
+
warnings: Array<string>;
|
|
176
|
+
}>;
|
|
177
|
+
/** A ready repo whose followed branch is ahead of origin: commits a publish pushes. */
|
|
178
|
+
export interface ReadinessAhead {
|
|
179
|
+
key: string;
|
|
180
|
+
branch: string;
|
|
181
|
+
commits: number;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Says what happens to a ready repo's commits ahead of origin: its release
|
|
185
|
+
* push carries them when it publishes, else they stay unpushed.
|
|
186
|
+
*
|
|
187
|
+
* @param ahead - the repo, its branch, and how many commits it's ahead
|
|
188
|
+
* @param publishes - whether the plan publishes it
|
|
189
|
+
* @param options - the `repos` invocation the message names
|
|
190
|
+
* @returns the line to log
|
|
191
|
+
*/
|
|
192
|
+
export declare const format_readiness_ahead: (ahead: ReadinessAhead, publishes: boolean, options?: RepoReadinessFormatOptions) => string;
|
|
193
|
+
/**
|
|
194
|
+
* The repos not at rest, for the read-only diagnostics' readiness block.
|
|
195
|
+
*
|
|
196
|
+
* @param entries - the entries of the repos a diagnostic reads
|
|
197
|
+
* @returns each entry with at-rest problems, in the order given
|
|
198
|
+
*/
|
|
199
|
+
export declare const repos_not_at_rest: (entries: ReadonlyArray<ReposEntryStatus>) => Array<RepoReadiness>;
|
|
200
|
+
/**
|
|
201
|
+
* Formats the diagnostics' readiness block: a header and a line per problem,
|
|
202
|
+
* saying what each repo not at rest is doing instead — or no lines when every
|
|
203
|
+
* repo is at rest. Not a failure: the diagnostics read repos as they sit.
|
|
204
|
+
*
|
|
205
|
+
* @param not_ready - `repos_not_at_rest`'s result
|
|
206
|
+
* @param now - the current time in unix seconds, for how long ago each repo was fetched
|
|
207
|
+
* @returns the block's lines, unindented header first
|
|
208
|
+
*/
|
|
209
|
+
export declare const format_readiness_block: (not_ready: ReadonlyArray<RepoReadiness>, now: number) => Array<string>;
|
|
210
|
+
//# sourceMappingURL=repo_readiness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo_readiness.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/repo_readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,EACX,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAGhB,MAAM,mBAAmB,CAAC;AAE3B,kFAAkF;AAClF,MAAM,MAAM,oBAAoB,GAC7B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,gBAAgB,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;CAAE,GACpE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,eAAe,C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