@caddis/cli 0.4.25 → 0.4.27
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/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/skills/adopt-app/SKILL.md +4 -0
- package/bundles/antigravity-plugin/skills/adopt-app/references/standard.md +18 -5
- package/bundles/antigravity-plugin/skills/adopt-app/scripts/AdoptCommon.ps1 +20 -2
- package/bundles/antigravity-plugin/skills/adopt-app/scripts/Get-AppInventory.ps1 +14 -4
- package/bundles/antigravity-plugin/skills/adopt-app/scripts/New-AdoptionPlan.ps1 +2 -4
- package/bundles/antigravity-plugin/skills/adopt-app/scripts/Test-AppConformance.ps1 +4 -2
- package/bundles/codex/.codex/skills/devops/adopt-app/SKILL.md +4 -0
- package/bundles/codex/.codex/skills/devops/adopt-app/references/standard.md +18 -5
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/AdoptCommon.ps1 +20 -2
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/Get-AppInventory.ps1 +14 -4
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/New-AdoptionPlan.ps1 +2 -4
- package/bundles/codex/.codex/skills/devops/adopt-app/scripts/Test-AppConformance.ps1 +4 -2
- package/bundles/manifest.json +2 -2
- package/package.json +1 -1
|
@@ -65,6 +65,10 @@ facts - services, scheduled tasks, web sites - can only be read on the box itsel
|
|
|
65
65
|
recorded as NOT SCANNED, never as empty, and it prevents later checks from passing.
|
|
66
66
|
- **Neither committed nor ignored.** Folders in this state are the real hazard: one `git add -A`
|
|
67
67
|
puts them in the history for ever. A filename pattern cannot find them - only git can.
|
|
68
|
+
- **COMMITTED versus not committed**, on every row of "what the repository must not carry". Only
|
|
69
|
+
the committed rows need a history rewrite; the rest need a `.gitignore` line, or already have
|
|
70
|
+
one. The distinction is per FILE, because one folder is routinely both: committed documents
|
|
71
|
+
beside ignored output. Read the row's state before planning any work.
|
|
68
72
|
- **Possible credentials.** The heuristics are tuned to be readable rather than exhaustive: they
|
|
69
73
|
skip comments, type declarations, template references and expressions. **Read every file they
|
|
70
74
|
flag yourself.** A credential that was ever committed must be ROTATED, not only deleted.
|
|
@@ -59,12 +59,25 @@ wrong branch before this is answered means CI builds and tests code nobody ships
|
|
|
59
59
|
|
|
60
60
|
**Blocking.**
|
|
61
61
|
|
|
62
|
-
**Decided by:** `GAP` if either of these is true
|
|
62
|
+
**Decided by:** `GAP` if either of these is true. First, a FILE that git actually tracks also
|
|
63
63
|
matches an excludable content category (dependency, runtime, build-output, cache, db-data,
|
|
64
|
-
archive, data-export
|
|
65
|
-
|
|
66
|
-
`-UntrackedThresholdMB` (default 10 MB). Otherwise `PASS` -
|
|
67
|
-
|
|
64
|
+
archive, data-export or media - `log` is exempt) - something was committed that should not have
|
|
65
|
+
been. Second, a top-level folder is git-untracked, is not `.git`, and is at least
|
|
66
|
+
`-UntrackedThresholdMB` (default 10 MB). Otherwise `PASS` - downgraded to `ASK` if any folder was
|
|
67
|
+
skipped with `-SkipFolder`, or if git could not be run (see "Coverage" below).
|
|
68
|
+
|
|
69
|
+
**Tracked state is per FILE, and that distinction is the whole check.** An earlier version asked
|
|
70
|
+
git for the state of the FOLDER and applied it to every byte inside. A folder is routinely both
|
|
71
|
+
things at once: on a real app, `reports/` held 40 committed markdown documents beside 1,060 MB of
|
|
72
|
+
correctly-ignored run output, under an ignore rule that already existed. The check reported
|
|
73
|
+
`COMMITTED data-export: reports (1018.47 MB)`. The true figure was 0.01 MB in 4 files - wrong by
|
|
74
|
+
about seven thousand times, and wrong in the expensive direction, because it said "rewrite your
|
|
75
|
+
history" when the answer was "nothing to do". The summary now prints `COMMITTED` or
|
|
76
|
+
`not committed` per row, and only the first kind needs a rewrite.
|
|
77
|
+
|
|
78
|
+
`git check-ignore` alone cannot make this distinction: by default it does not report a path that
|
|
79
|
+
git tracks, so the same folder answers "not ignored" plainly and "ignored" under `--no-index`.
|
|
80
|
+
Both answers are true. Only a per-file tracked set says which files are which.
|
|
68
81
|
|
|
69
82
|
**Why it is on the list:** a `.gitignore` added later does not remove what is already committed -
|
|
70
83
|
that needs a history rewrite. And a folder that is neither committed nor ignored is the genuinely
|
|
@@ -146,6 +146,7 @@ $script:AdoptScanBlock = {
|
|
|
146
146
|
healthHits = @()
|
|
147
147
|
totalFiles = 0
|
|
148
148
|
totalMB = 0.0
|
|
149
|
+
trackedKnown = $false
|
|
149
150
|
probed = 0
|
|
150
151
|
git = @{ isRepo = $false }
|
|
151
152
|
}
|
|
@@ -232,6 +233,22 @@ $script:AdoptScanBlock = {
|
|
|
232
233
|
else { $g.upstream = $null; $g.unpushed = $null }
|
|
233
234
|
}
|
|
234
235
|
|
|
236
|
+
# ---- which files git actually tracks ---------------------------------------------
|
|
237
|
+
# PER FILE, not per folder. A folder is routinely BOTH: `reports/` carried 40 committed
|
|
238
|
+
# markdown documents and a gigabyte of correctly-ignored run output, and attributing the
|
|
239
|
+
# folder's whole size to its folder-level state reported "1018 MB of data exports are
|
|
240
|
+
# committed" when the real figure was 0.15 MB. That is not a rounding error, it is a
|
|
241
|
+
# different finding - and it would have sent someone to rewrite history for nothing.
|
|
242
|
+
$trackedSet = New-Object 'System.Collections.Generic.HashSet[string]' ([StringComparer]::OrdinalIgnoreCase)
|
|
243
|
+
$trackedKnown = $false
|
|
244
|
+
if ($result.git.isRepo -and $gitAvailable) {
|
|
245
|
+
$ls = @(& git -c safe.directory=* -C $root ls-files 2>&1)
|
|
246
|
+
if ($LASTEXITCODE -eq 0) {
|
|
247
|
+
$trackedKnown = $true
|
|
248
|
+
foreach ($f in $ls) { [void]$trackedSet.Add(("$f" -replace '/', '\')) }
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
235
252
|
# ---- one bounded walk per top-level folder --------------------------------------
|
|
236
253
|
$tops = @()
|
|
237
254
|
try { $tops = @(Get-ChildItem -LiteralPath $root -Force -ErrorAction Stop | Where-Object { $_.PSIsContainer }) }
|
|
@@ -301,7 +318,7 @@ $script:AdoptScanBlock = {
|
|
|
301
318
|
|
|
302
319
|
foreach ($spec in $ExcludableSpecs) {
|
|
303
320
|
if ($rel -match $spec.pattern) {
|
|
304
|
-
$result.excludable += @{ path = $rel; category = $spec.category; bytes = $file.Length }
|
|
321
|
+
$result.excludable += @{ path = $rel; category = $spec.category; bytes = $file.Length; tracked = $trackedSet.Contains($rel) }
|
|
305
322
|
break
|
|
306
323
|
}
|
|
307
324
|
}
|
|
@@ -345,7 +362,7 @@ $script:AdoptScanBlock = {
|
|
|
345
362
|
if ($rel -notmatch $SkipPattern) { & $classify $k $rel }
|
|
346
363
|
else {
|
|
347
364
|
foreach ($spec in $ExcludableSpecs) {
|
|
348
|
-
if ($rel -match $spec.pattern) { $result.excludable += @{ path = $rel; category = $spec.category; bytes = $k.Length }; break }
|
|
365
|
+
if ($rel -match $spec.pattern) { $result.excludable += @{ path = $rel; category = $spec.category; bytes = $k.Length; tracked = $trackedSet.Contains($rel) }; break }
|
|
349
366
|
}
|
|
350
367
|
}
|
|
351
368
|
|
|
@@ -416,6 +433,7 @@ $script:AdoptScanBlock = {
|
|
|
416
433
|
}
|
|
417
434
|
}
|
|
418
435
|
$result.totalMB = [math]::Round($result.totalMB, 2)
|
|
436
|
+
$result.trackedKnown = $trackedKnown
|
|
419
437
|
$result.paths = @($detectPaths)
|
|
420
438
|
if ($detectPaths.Count -ge $DetectPathCap) {
|
|
421
439
|
$result.partial = $true
|
|
@@ -116,17 +116,23 @@ $inventory = [ordered]@{
|
|
|
116
116
|
|
|
117
117
|
# Roll the excludable file list up per top folder. A list of 40,000 paths is unreadable and
|
|
118
118
|
# the decision is taken per folder anyway.
|
|
119
|
+
# Grouped by folder, category AND whether git tracks the file. A folder is routinely both:
|
|
120
|
+
# committed documents beside a gigabyte of correctly-ignored output. Rolling those together
|
|
121
|
+
# and labelling the total with the folder's state turned 0.15 MB of committed markdown into
|
|
122
|
+
# a report of "1018 MB of data exports are committed".
|
|
119
123
|
$byFolder = @{}
|
|
120
124
|
foreach ($e in @($scan.excludable)) {
|
|
121
125
|
$top = ($e.path -split '[\\/]')[0]
|
|
122
|
-
$
|
|
123
|
-
|
|
126
|
+
$isTracked = [bool](Get-AdoptProp $e 'tracked' $false)
|
|
127
|
+
$key = "$top|$($e.category)|$isTracked"
|
|
128
|
+
if (-not $byFolder.ContainsKey($key)) { $byFolder[$key] = @{ folder = $top; category = $e.category; tracked = $isTracked; files = 0; bytes = [long]0 } }
|
|
124
129
|
$byFolder[$key].files++
|
|
125
130
|
$byFolder[$key].bytes += [long]$e.bytes
|
|
126
131
|
}
|
|
127
132
|
$inventory.excludableSummary = @($byFolder.Values |
|
|
128
|
-
ForEach-Object { [ordered]@{ folder = $_.folder; category = $_.category; files = $_.files; mb = [math]::Round($_.bytes / 1MB, 2) } } |
|
|
133
|
+
ForEach-Object { [ordered]@{ folder = $_.folder; category = $_.category; tracked = $_.tracked; files = $_.files; mb = [math]::Round($_.bytes / 1MB, 2) } } |
|
|
129
134
|
Sort-Object { -1 * $_.mb })
|
|
135
|
+
$inventory.trackedKnown = [bool](Get-AdoptProp $scan 'trackedKnown' $false)
|
|
130
136
|
|
|
131
137
|
$out = Write-AdoptArtifact -Dir $dir -FileName 'inventory.json' -Object $inventory
|
|
132
138
|
|
|
@@ -181,8 +187,12 @@ if ($ignoredBig.Count -gt 0) {
|
|
|
181
187
|
Write-AdoptHeading 'What the repository must not carry'
|
|
182
188
|
if ($inventory.excludableSummary.Count -eq 0) { Write-Host " nothing found" }
|
|
183
189
|
foreach ($e in @($inventory.excludableSummary | Select-Object -First 15)) {
|
|
184
|
-
|
|
190
|
+
$state = if ($e.tracked) { 'COMMITTED' } else { 'not committed' }
|
|
191
|
+
$colour = if ($e.tracked) { 'Yellow' } else { 'Gray' }
|
|
192
|
+
Write-Host (" {0,10:N1} MB {1,7} files {2,-13} {3,-14} {4}" -f $e.mb, $e.files, $e.category, $state, $e.folder) -ForegroundColor $colour
|
|
185
193
|
}
|
|
194
|
+
Write-Host " Only the COMMITTED rows need a history rewrite. The rest need a .gitignore line," -ForegroundColor DarkGray
|
|
195
|
+
Write-Host " or already have one." -ForegroundColor DarkGray
|
|
186
196
|
|
|
187
197
|
Write-AdoptHeading 'Possible credentials'
|
|
188
198
|
if ($inventory.secretsSuspected.Count -eq 0) { Write-Host " none found by the heuristics - which is not the same as none present" }
|
|
@@ -73,10 +73,8 @@ if ($so -and $so.verdict -eq 'GAP') {
|
|
|
73
73
|
$lines += "$($f.path) - $($f.mb) MB, neither committed nor ignored: commit it, ignore it, or move it out of the tree"
|
|
74
74
|
}
|
|
75
75
|
foreach ($e in @($inv.excludableSummary | Select-Object -First 10)) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
$lines += "$($e.folder) - $($e.mb) MB of $($e.category) is COMMITTED: needs a history rewrite, not a .gitignore line"
|
|
79
|
-
}
|
|
76
|
+
if (-not (Get-AdoptProp $e 'tracked' $false)) { continue }
|
|
77
|
+
$lines += "$($e.folder) - $($e.files) file(s), $($e.mb) MB of $($e.category) is COMMITTED: a .gitignore line does not remove it, only a history rewrite does"
|
|
80
78
|
}
|
|
81
79
|
Add-Step 'content-policy' 'Settle what the repository may hold' @('answers') `
|
|
82
80
|
'A .gitignore added later does not remove what is already committed, and a folder that is neither committed nor ignored is one careless command away from being permanent.' `
|
|
@@ -72,10 +72,12 @@ $componentProfiles = @($prof.components | ForEach-Object { $_.profile })
|
|
|
72
72
|
$isBatchOnly = ($componentProfiles.Count -gt 0) -and (@($componentProfiles | Where-Object { $_ -notmatch 'batch' }).Count -eq 0)
|
|
73
73
|
|
|
74
74
|
$untrackedBig = @($folders | Where-Object { $_.git -eq 'untracked' -and $_.path -ne '.git' -and $_.mb -ge $UntrackedThresholdMB })
|
|
75
|
+
# Per FILE, from git itself - not "this folder is tracked, so all of its bytes are".
|
|
75
76
|
$trackedJunk = @()
|
|
76
77
|
foreach ($e in @($inv.excludableSummary)) {
|
|
77
|
-
|
|
78
|
-
if ($
|
|
78
|
+
if (-not (Get-AdoptProp $e 'tracked' $false)) { continue }
|
|
79
|
+
if ($e.category -eq 'log') { continue }
|
|
80
|
+
$trackedJunk += $e
|
|
79
81
|
}
|
|
80
82
|
$ignoredHeavy = @($folders | Where-Object { $_.git -eq 'ignored' -and $_.mb -ge 100 })
|
|
81
83
|
|
|
@@ -65,6 +65,10 @@ facts - services, scheduled tasks, web sites - can only be read on the box itsel
|
|
|
65
65
|
recorded as NOT SCANNED, never as empty, and it prevents later checks from passing.
|
|
66
66
|
- **Neither committed nor ignored.** Folders in this state are the real hazard: one `git add -A`
|
|
67
67
|
puts them in the history for ever. A filename pattern cannot find them - only git can.
|
|
68
|
+
- **COMMITTED versus not committed**, on every row of "what the repository must not carry". Only
|
|
69
|
+
the committed rows need a history rewrite; the rest need a `.gitignore` line, or already have
|
|
70
|
+
one. The distinction is per FILE, because one folder is routinely both: committed documents
|
|
71
|
+
beside ignored output. Read the row's state before planning any work.
|
|
68
72
|
- **Possible credentials.** The heuristics are tuned to be readable rather than exhaustive: they
|
|
69
73
|
skip comments, type declarations, template references and expressions. **Read every file they
|
|
70
74
|
flag yourself.** A credential that was ever committed must be ROTATED, not only deleted.
|
|
@@ -59,12 +59,25 @@ wrong branch before this is answered means CI builds and tests code nobody ships
|
|
|
59
59
|
|
|
60
60
|
**Blocking.**
|
|
61
61
|
|
|
62
|
-
**Decided by:** `GAP` if either of these is true
|
|
62
|
+
**Decided by:** `GAP` if either of these is true. First, a FILE that git actually tracks also
|
|
63
63
|
matches an excludable content category (dependency, runtime, build-output, cache, db-data,
|
|
64
|
-
archive, data-export
|
|
65
|
-
|
|
66
|
-
`-UntrackedThresholdMB` (default 10 MB). Otherwise `PASS` -
|
|
67
|
-
|
|
64
|
+
archive, data-export or media - `log` is exempt) - something was committed that should not have
|
|
65
|
+
been. Second, a top-level folder is git-untracked, is not `.git`, and is at least
|
|
66
|
+
`-UntrackedThresholdMB` (default 10 MB). Otherwise `PASS` - downgraded to `ASK` if any folder was
|
|
67
|
+
skipped with `-SkipFolder`, or if git could not be run (see "Coverage" below).
|
|
68
|
+
|
|
69
|
+
**Tracked state is per FILE, and that distinction is the whole check.** An earlier version asked
|
|
70
|
+
git for the state of the FOLDER and applied it to every byte inside. A folder is routinely both
|
|
71
|
+
things at once: on a real app, `reports/` held 40 committed markdown documents beside 1,060 MB of
|
|
72
|
+
correctly-ignored run output, under an ignore rule that already existed. The check reported
|
|
73
|
+
`COMMITTED data-export: reports (1018.47 MB)`. The true figure was 0.01 MB in 4 files - wrong by
|
|
74
|
+
about seven thousand times, and wrong in the expensive direction, because it said "rewrite your
|
|
75
|
+
history" when the answer was "nothing to do". The summary now prints `COMMITTED` or
|
|
76
|
+
`not committed` per row, and only the first kind needs a rewrite.
|
|
77
|
+
|
|
78
|
+
`git check-ignore` alone cannot make this distinction: by default it does not report a path that
|
|
79
|
+
git tracks, so the same folder answers "not ignored" plainly and "ignored" under `--no-index`.
|
|
80
|
+
Both answers are true. Only a per-file tracked set says which files are which.
|
|
68
81
|
|
|
69
82
|
**Why it is on the list:** a `.gitignore` added later does not remove what is already committed -
|
|
70
83
|
that needs a history rewrite. And a folder that is neither committed nor ignored is the genuinely
|
|
@@ -146,6 +146,7 @@ $script:AdoptScanBlock = {
|
|
|
146
146
|
healthHits = @()
|
|
147
147
|
totalFiles = 0
|
|
148
148
|
totalMB = 0.0
|
|
149
|
+
trackedKnown = $false
|
|
149
150
|
probed = 0
|
|
150
151
|
git = @{ isRepo = $false }
|
|
151
152
|
}
|
|
@@ -232,6 +233,22 @@ $script:AdoptScanBlock = {
|
|
|
232
233
|
else { $g.upstream = $null; $g.unpushed = $null }
|
|
233
234
|
}
|
|
234
235
|
|
|
236
|
+
# ---- which files git actually tracks ---------------------------------------------
|
|
237
|
+
# PER FILE, not per folder. A folder is routinely BOTH: `reports/` carried 40 committed
|
|
238
|
+
# markdown documents and a gigabyte of correctly-ignored run output, and attributing the
|
|
239
|
+
# folder's whole size to its folder-level state reported "1018 MB of data exports are
|
|
240
|
+
# committed" when the real figure was 0.15 MB. That is not a rounding error, it is a
|
|
241
|
+
# different finding - and it would have sent someone to rewrite history for nothing.
|
|
242
|
+
$trackedSet = New-Object 'System.Collections.Generic.HashSet[string]' ([StringComparer]::OrdinalIgnoreCase)
|
|
243
|
+
$trackedKnown = $false
|
|
244
|
+
if ($result.git.isRepo -and $gitAvailable) {
|
|
245
|
+
$ls = @(& git -c safe.directory=* -C $root ls-files 2>&1)
|
|
246
|
+
if ($LASTEXITCODE -eq 0) {
|
|
247
|
+
$trackedKnown = $true
|
|
248
|
+
foreach ($f in $ls) { [void]$trackedSet.Add(("$f" -replace '/', '\')) }
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
235
252
|
# ---- one bounded walk per top-level folder --------------------------------------
|
|
236
253
|
$tops = @()
|
|
237
254
|
try { $tops = @(Get-ChildItem -LiteralPath $root -Force -ErrorAction Stop | Where-Object { $_.PSIsContainer }) }
|
|
@@ -301,7 +318,7 @@ $script:AdoptScanBlock = {
|
|
|
301
318
|
|
|
302
319
|
foreach ($spec in $ExcludableSpecs) {
|
|
303
320
|
if ($rel -match $spec.pattern) {
|
|
304
|
-
$result.excludable += @{ path = $rel; category = $spec.category; bytes = $file.Length }
|
|
321
|
+
$result.excludable += @{ path = $rel; category = $spec.category; bytes = $file.Length; tracked = $trackedSet.Contains($rel) }
|
|
305
322
|
break
|
|
306
323
|
}
|
|
307
324
|
}
|
|
@@ -345,7 +362,7 @@ $script:AdoptScanBlock = {
|
|
|
345
362
|
if ($rel -notmatch $SkipPattern) { & $classify $k $rel }
|
|
346
363
|
else {
|
|
347
364
|
foreach ($spec in $ExcludableSpecs) {
|
|
348
|
-
if ($rel -match $spec.pattern) { $result.excludable += @{ path = $rel; category = $spec.category; bytes = $k.Length }; break }
|
|
365
|
+
if ($rel -match $spec.pattern) { $result.excludable += @{ path = $rel; category = $spec.category; bytes = $k.Length; tracked = $trackedSet.Contains($rel) }; break }
|
|
349
366
|
}
|
|
350
367
|
}
|
|
351
368
|
|
|
@@ -416,6 +433,7 @@ $script:AdoptScanBlock = {
|
|
|
416
433
|
}
|
|
417
434
|
}
|
|
418
435
|
$result.totalMB = [math]::Round($result.totalMB, 2)
|
|
436
|
+
$result.trackedKnown = $trackedKnown
|
|
419
437
|
$result.paths = @($detectPaths)
|
|
420
438
|
if ($detectPaths.Count -ge $DetectPathCap) {
|
|
421
439
|
$result.partial = $true
|
|
@@ -116,17 +116,23 @@ $inventory = [ordered]@{
|
|
|
116
116
|
|
|
117
117
|
# Roll the excludable file list up per top folder. A list of 40,000 paths is unreadable and
|
|
118
118
|
# the decision is taken per folder anyway.
|
|
119
|
+
# Grouped by folder, category AND whether git tracks the file. A folder is routinely both:
|
|
120
|
+
# committed documents beside a gigabyte of correctly-ignored output. Rolling those together
|
|
121
|
+
# and labelling the total with the folder's state turned 0.15 MB of committed markdown into
|
|
122
|
+
# a report of "1018 MB of data exports are committed".
|
|
119
123
|
$byFolder = @{}
|
|
120
124
|
foreach ($e in @($scan.excludable)) {
|
|
121
125
|
$top = ($e.path -split '[\\/]')[0]
|
|
122
|
-
$
|
|
123
|
-
|
|
126
|
+
$isTracked = [bool](Get-AdoptProp $e 'tracked' $false)
|
|
127
|
+
$key = "$top|$($e.category)|$isTracked"
|
|
128
|
+
if (-not $byFolder.ContainsKey($key)) { $byFolder[$key] = @{ folder = $top; category = $e.category; tracked = $isTracked; files = 0; bytes = [long]0 } }
|
|
124
129
|
$byFolder[$key].files++
|
|
125
130
|
$byFolder[$key].bytes += [long]$e.bytes
|
|
126
131
|
}
|
|
127
132
|
$inventory.excludableSummary = @($byFolder.Values |
|
|
128
|
-
ForEach-Object { [ordered]@{ folder = $_.folder; category = $_.category; files = $_.files; mb = [math]::Round($_.bytes / 1MB, 2) } } |
|
|
133
|
+
ForEach-Object { [ordered]@{ folder = $_.folder; category = $_.category; tracked = $_.tracked; files = $_.files; mb = [math]::Round($_.bytes / 1MB, 2) } } |
|
|
129
134
|
Sort-Object { -1 * $_.mb })
|
|
135
|
+
$inventory.trackedKnown = [bool](Get-AdoptProp $scan 'trackedKnown' $false)
|
|
130
136
|
|
|
131
137
|
$out = Write-AdoptArtifact -Dir $dir -FileName 'inventory.json' -Object $inventory
|
|
132
138
|
|
|
@@ -181,8 +187,12 @@ if ($ignoredBig.Count -gt 0) {
|
|
|
181
187
|
Write-AdoptHeading 'What the repository must not carry'
|
|
182
188
|
if ($inventory.excludableSummary.Count -eq 0) { Write-Host " nothing found" }
|
|
183
189
|
foreach ($e in @($inventory.excludableSummary | Select-Object -First 15)) {
|
|
184
|
-
|
|
190
|
+
$state = if ($e.tracked) { 'COMMITTED' } else { 'not committed' }
|
|
191
|
+
$colour = if ($e.tracked) { 'Yellow' } else { 'Gray' }
|
|
192
|
+
Write-Host (" {0,10:N1} MB {1,7} files {2,-13} {3,-14} {4}" -f $e.mb, $e.files, $e.category, $state, $e.folder) -ForegroundColor $colour
|
|
185
193
|
}
|
|
194
|
+
Write-Host " Only the COMMITTED rows need a history rewrite. The rest need a .gitignore line," -ForegroundColor DarkGray
|
|
195
|
+
Write-Host " or already have one." -ForegroundColor DarkGray
|
|
186
196
|
|
|
187
197
|
Write-AdoptHeading 'Possible credentials'
|
|
188
198
|
if ($inventory.secretsSuspected.Count -eq 0) { Write-Host " none found by the heuristics - which is not the same as none present" }
|
|
@@ -73,10 +73,8 @@ if ($so -and $so.verdict -eq 'GAP') {
|
|
|
73
73
|
$lines += "$($f.path) - $($f.mb) MB, neither committed nor ignored: commit it, ignore it, or move it out of the tree"
|
|
74
74
|
}
|
|
75
75
|
foreach ($e in @($inv.excludableSummary | Select-Object -First 10)) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
$lines += "$($e.folder) - $($e.mb) MB of $($e.category) is COMMITTED: needs a history rewrite, not a .gitignore line"
|
|
79
|
-
}
|
|
76
|
+
if (-not (Get-AdoptProp $e 'tracked' $false)) { continue }
|
|
77
|
+
$lines += "$($e.folder) - $($e.files) file(s), $($e.mb) MB of $($e.category) is COMMITTED: a .gitignore line does not remove it, only a history rewrite does"
|
|
80
78
|
}
|
|
81
79
|
Add-Step 'content-policy' 'Settle what the repository may hold' @('answers') `
|
|
82
80
|
'A .gitignore added later does not remove what is already committed, and a folder that is neither committed nor ignored is one careless command away from being permanent.' `
|
|
@@ -72,10 +72,12 @@ $componentProfiles = @($prof.components | ForEach-Object { $_.profile })
|
|
|
72
72
|
$isBatchOnly = ($componentProfiles.Count -gt 0) -and (@($componentProfiles | Where-Object { $_ -notmatch 'batch' }).Count -eq 0)
|
|
73
73
|
|
|
74
74
|
$untrackedBig = @($folders | Where-Object { $_.git -eq 'untracked' -and $_.path -ne '.git' -and $_.mb -ge $UntrackedThresholdMB })
|
|
75
|
+
# Per FILE, from git itself - not "this folder is tracked, so all of its bytes are".
|
|
75
76
|
$trackedJunk = @()
|
|
76
77
|
foreach ($e in @($inv.excludableSummary)) {
|
|
77
|
-
|
|
78
|
-
if ($
|
|
78
|
+
if (-not (Get-AdoptProp $e 'tracked' $false)) { continue }
|
|
79
|
+
if ($e.category -eq 'log') { continue }
|
|
80
|
+
$trackedJunk += $e
|
|
79
81
|
}
|
|
80
82
|
$ignoredHeavy = @($folders | Where-Object { $_.git -eq 'ignored' -and $_.mb -ge 100 })
|
|
81
83
|
|
package/bundles/manifest.json
CHANGED
package/package.json
CHANGED