ghcr-manager-visualizer 0.9.10 → 1.0.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/README.md CHANGED
@@ -4,12 +4,37 @@ Local browser visualizer for `ghcr-manager` SQLite scan databases.
4
4
 
5
5
  Use it to inspect manifest graphs, compare two scans of the same package, and investigate cleanup edge cases.
6
6
 
7
+ ![Example compare view: red-bordered manifests are present in the older scan and removed in the newer one.](https://raw.githubusercontent.com/ghcr-manager/ghcr-manager/main/docs/images/visualizer/graph-2images-cosign--wide.png "Example compare view: red-bordered manifests are present in the older scan and removed in the newer one.")
8
+
9
+ _Example compare view: red-bordered manifests are present in the older scan and removed in the newer one._
10
+
11
+ ## Quick Demo
12
+
13
+ Download the test scenario DB from the latest release and try the visualizer without first running your own workflow.
14
+
15
+ The DB contains dozens of scenario packages with different graphs and before/after views of cleanup operations on them.
16
+
17
+ ```sh
18
+ curl -LO https://github.com/ghcr-manager/ghcr-manager/releases/latest/download/ghcr-manager-release-scenarios.sqlite
19
+ npx ghcr-manager-visualizer --db ./ghcr-manager-release-scenarios.sqlite
20
+ ```
21
+
22
+ Open the local URL printed by the command and select:
23
+
24
+ - owner: `ghcr-manager-test`
25
+ - package: select one with `2images` or `2multiarch` in the name
26
+ - tag search: `image` or `multiarch`
27
+
28
+ Good search terms for tags in most scenarios are: `image`, `multiarch`, `keep`, or `delete`.
29
+
7
30
  ## Install
8
31
 
9
32
  ```sh
10
33
  npm install --global ghcr-manager-visualizer
11
34
  ```
12
35
 
36
+ > Requirement: Node.js `24` or newer.
37
+
13
38
  ## Run
14
39
 
15
40
  ```sh
@@ -29,13 +54,56 @@ Example:
29
54
  ghcr-manager-visualizer --db ./artifacts/acme__demo.sqlite --host 0.0.0.0 --port 4000
30
55
  ```
31
56
 
32
- ## DB Inputs
57
+ ## DB Input
58
+
59
+ The visualizer reads the SQLite DB produced by `ghcr-manager` as GitHub Action artifacts uploaded by `scan`, `cleanup`.
60
+
61
+ Typical flow:
62
+
63
+ 1. Run a `scan` or `cleanup` workflow and download the SQLite DB run artifact.
64
+ 2. Start `ghcr-manager-visualizer` with that DB.
65
+ 3. Select owner and package, then enter a tag or digest to center the graph.
66
+ 4. Optionally select a second scan to compare two recorded scans.
67
+
68
+ ## Compare Mode
33
69
 
34
- The visualizer reads the SQLite DB format produced by:
70
+ When a package has at least two completed scans, the visualizer defaults to comparing the newest two scans:
35
71
 
36
- - `ghcr-manager scan`
37
- - `ghcr-manager cleanup`
38
- - `ghcr-manager db-merge`
72
+ - main scan: the older of the newest two scans
73
+ - compare scan: the newest scan
74
+
75
+ In compare mode, the visualizer shows delta information in two places.
76
+
77
+ Manifest nodes:
78
+
79
+ - gray border: present in both scans
80
+ - green border: added in the newer scan
81
+ - red border: removed in the newer scan
82
+
83
+ Tags in the details panel:
84
+
85
+ - plain tag text: present in both scans
86
+ - `(+) tag-name`: tag added in the newer scan
87
+ - `(-) tag-name`: tag removed in the newer scan
88
+
89
+ This is the fastest way to inspect what changed between two scans of one package graph.
90
+
91
+ [![Visualizer Show Compare Mode](https://raw.githubusercontent.com/ghcr-manager/ghcr-manager/main/docs/images/visualizer/visualizer-show-compare-mode.png)](https://github.com/ghcr-manager/ghcr-manager/blob/main/docs/images/visualizer/visualizer-show-compare-mode.png)
92
+
93
+ ## Source Checkout
94
+
95
+ From this repository checkout, you can run the visualizer without publishing:
96
+
97
+ ```sh
98
+ npm run visualize -- --db ./artifacts/acme__demo.sqlite
99
+ ```
100
+
101
+ Or build and run the workspace directly:
102
+
103
+ ```sh
104
+ npm run build:visualizer
105
+ npm run visualizer:start -- --db ./artifacts/acme__demo.sqlite
106
+ ```
39
107
 
40
108
  ## Project
41
109
 
@@ -336,13 +336,15 @@ function buildNodeLabel(node) {
336
336
  const secondaryLines = [];
337
337
 
338
338
  if (node.displayPlatform) {
339
- secondaryLines.push(node.displayPlatform);
339
+ secondaryLines.push(`arch: ${node.displayPlatform}`);
340
340
  }
341
341
 
342
- secondaryLines.push(node.tags.length > 0 ? buildTagDisplayText(node.tags[0]) : `#${node.versionId}`);
343
-
344
- if (node.tags.length > 1) {
345
- secondaryLines.push(node.tags.slice(1).map(buildTagDisplayText).join(" | "));
342
+ if (node.tags.length > 0) {
343
+ for (const tag of node.tags) {
344
+ secondaryLines.push(`tag: ${buildTagDisplayText(tag)}`);
345
+ }
346
+ } else {
347
+ secondaryLines.push(`version: ${node.versionId}`);
346
348
  }
347
349
 
348
350
  return [primaryLine, "", ...secondaryLines].join("\n");
@@ -48,7 +48,7 @@
48
48
  </label>
49
49
  <label>
50
50
  Depth
51
- <input id="depth" name="depth" type="number" min="0" max="30" value="5" required />
51
+ <input id="depth" name="depth" type="number" min="0" max="100" value="12" required />
52
52
  </label>
53
53
  <button type="submit">Load graph</button>
54
54
  </form>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghcr-manager-visualizer",
3
- "version": "0.9.10",
3
+ "version": "v1.0.1",
4
4
  "description": "Inspect ghcr-manager SQLite scan databases in a local browser graph visualizer.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/ghcr-manager/ghcr-manager#readme",