Skip to content

fix: review batch 3 (correctness, races, query plans, CLI, web) - #428

Merged
M0Rf30 merged 2 commits into
mainfrom
fix/review-batch-3
Nov 8, 2026
Merged

M0Rf30 merged 2 commits into
mainfrom
fix/review-batch-3

Conversation

@M0Rf30

@M0Rf30 M0Rf30 commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Fixes the findings of the third codebase review and of the follow-up
review of the database layer and the areas the first pass skipped.

Server

  • regen queue: a blocked key no longer starves other ready keys
  • cleanup: TriggerPolicy cannot start work after Stop (503 while stopping)
  • npm: refuse versions with build metadata; batched version lookups
  • cargo: refuse names differing only in - versus _
  • pypi: an upload of a PEP 440-equal version joins the existing release
  • raw: PUT refuses unaddressable paths (400)
  • compact index: ParseVersions is linear (was quadratic in yanks)
  • groups (ansible, conda, maven, oci, helm): no cached merge after a
    member failure; helm index parse capped
  • proxy: OCI tag/referrer listings take an upstream fetch slot
  • webhooks: additive X-Oa-Timestamp / X-Oa-Signature-V2 (replay-safe)
  • login revokes the pre-login session; AI analysis uses the stored
    component's identity
  • docker GC: a manifest with a missing body blocks blob sweeps instead of
    being indexed as referencing nothing; reported as manifests_missing_body
  • licenses: SPDX expressions evaluated as an AST (AND before OR, parens),
    comma lists all-required, deprecated -with-exception ids, one SPDX table,
    SPDX 3 license cache key; curation globs precompiled
  • rpm: drop unread FileEntry fields

Database

  • 015 (concurrent, re-runnable): indexes for package_versions, proxy cache
    negative/listing/prefix/docker image, docker_blob_images, scan_jobs,
    Dependency-Track pushes; ListDockerCatalog proxied CTE as a loose index
    scan; SecurityHealthStats last scan via per-type probe
  • 016: merge duplicate global groups and make global names unique;
    GetOrCreateGroup is INSERT ... ON CONFLICT
  • admin user PATCH writes only the changed columns; scan jobs store NULL
    instead of a zero completed_at
  • storage backend update and its busy check in one transaction; repository
    PATCH validates before moving and applies move, settings and members in
    one transaction; member list loaded in one query
  • advisory locks through pglock everywhere

oa CLI

  • downloads keep 0600 / the existing mode, Ctrl-C cancels, plain-http
    password warning, blank token refused, saved token only for its server

Web

  • stale declarative plans dropped, ?new flags reactive, user edit can clear
    email and name, undo targets captured at toast time, audit hidden count,
    permission assign retry, dead route guard removed, plural/tiering toasts

Tests: removed fixed sleeps and wiring-only tests.

Fixes the findings of the third codebase review and of the follow-up
review of the database layer and the areas the first pass skipped.

Server
- regen queue: a blocked key no longer starves other ready keys
- cleanup: TriggerPolicy cannot start work after Stop (503 while stopping)
- npm: refuse versions with build metadata; batched version lookups
- cargo: refuse names differing only in - versus _
- pypi: an upload of a PEP 440-equal version joins the existing release
- raw: PUT refuses unaddressable paths (400)
- compact index: ParseVersions is linear (was quadratic in yanks)
- groups (ansible, conda, maven, oci, helm): no cached merge after a
  member failure; helm index parse capped
- proxy: OCI tag/referrer listings take an upstream fetch slot
- webhooks: additive X-Oa-Timestamp / X-Oa-Signature-V2 (replay-safe)
- login revokes the pre-login session; AI analysis uses the stored
  component's identity
- docker GC: a manifest with a missing body blocks blob sweeps instead of
  being indexed as referencing nothing; reported as manifests_missing_body
- licenses: SPDX expressions evaluated as an AST (AND before OR, parens),
  comma lists all-required, deprecated -with-exception ids, one SPDX table,
  SPDX 3 license cache key; curation globs precompiled
- rpm: drop unread FileEntry fields

Database
- 015 (concurrent, re-runnable): indexes for package_versions, proxy cache
  negative/listing/prefix/docker image, docker_blob_images, scan_jobs,
  Dependency-Track pushes; ListDockerCatalog proxied CTE as a loose index
  scan; SecurityHealthStats last scan via per-type probe
- 016: merge duplicate global groups and make global names unique;
  GetOrCreateGroup is INSERT ... ON CONFLICT
- admin user PATCH writes only the changed columns; scan jobs store NULL
  instead of a zero completed_at
- storage backend update and its busy check in one transaction; repository
  PATCH validates before moving and applies move, settings and members in
  one transaction; member list loaded in one query
- advisory locks through pglock everywhere

oa CLI
- downloads keep 0600 / the existing mode, Ctrl-C cancels, plain-http
  password warning, blank token refused, saved token only for its server

Web
- stale declarative plans dropped, ?new flags reactive, user edit can clear
  email and name, undo targets captured at toast time, audit hidden count,
  permission assign retry, dead route guard removed, plural/tiering toasts

Tests: removed fixed sleeps and wiring-only tests.
Comment thread internal/webhook/dispatcher.go Fixed
Fixes the CodeQL allocation-size alert on the V2 signature buffer by
hashing the parts in sequence, and resolves the dupl ratchet clone in the
cleanup trigger error switch.
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Coverage

Coverage vs main
Go, unit + integration 83.3% ±0.0
Go, unit tests only 69.9% ±0.0
Go, integration tests only 54.5% ±0.0
Web, lines 90.4% ±0.0
Web, functions 84.7% ±0.0
Go by area
Area Coverage vs main
cmd/docgen 80.3% ±0.0
cmd/genformats 90.8% ±0.0
cmd/oa 0.0% ±0.0
cmd/resetpw 0.0% ±0.0
cmd/server 70.5% ±0.0
internal/ai 85.6% ±0.0
internal/api 76.6% +0.1
internal/apkkeys 77.1% ±0.0
internal/artifactpath 100.0% ±0.0
internal/attest 85.6% ±0.0
internal/audit 97.6% ±0.0
internal/auth 91.0% ±0.0
internal/backup 72.1% ±0.0
internal/bgtask 96.8% ±0.0
internal/branding 93.5% ±0.0
internal/clientsetup 93.6% ±0.0
internal/config 96.4% ±0.0
internal/cron 90.0% ±0.0
internal/crypto 91.0% ±0.0
internal/curation 99.0% ±0.0
internal/database 77.5% -0.2
internal/declarative 83.5% ±0.0
internal/dtrack 85.3% ±0.0
internal/exploit 94.1% +0.5
internal/federation 81.1% ±0.0
internal/format 80.9% ±0.0
internal/formats 87.9% ±0.0
internal/gpgkeys 87.1% ±0.0
internal/group 89.5% -0.1
internal/httpcache 100.0% ±0.0
internal/httpcompress 93.3% ±0.0
internal/httpx 85.7% ±0.0
internal/importmeta 93.3% ±0.0
internal/iocopy 100.0% ±0.0
internal/itempath 98.3% ±0.0
internal/lazyre 100.0% ±0.0
internal/license 98.5% -0.9
internal/licensemeta 87.6% ±0.0
internal/licensepolicy 92.6% ±0.0
internal/limitio 92.9% ±0.0
internal/mcp 89.5% ±0.0
internal/metrics 96.2% ±0.0
internal/middleware 94.0% ±0.0
internal/netutil 93.1% ±0.0
internal/nixkeys 79.6% ±0.0
internal/oacli 84.8% +0.3
internal/ocimanifest 100.0% ±0.0
internal/ocipath 100.0% ±0.0
internal/osv 88.5% ±0.0
internal/passwd 93.3% ±0.0
internal/pathseg 100.0% ±0.0
internal/pglock 89.5% +11.7
internal/pkgdeps 88.1% ±0.0
internal/presign 99.2% ±0.0
internal/promote 84.6% ±0.0
internal/proxy 86.5% ±0.0
internal/publicurl 96.8% ±0.0
internal/pypisimple 97.9% ±0.0
internal/quarantine 100.0% ±0.0
internal/quota 88.4% ±0.0
internal/recovery 85.3% -0.6
internal/registry 100.0% ±0.0
internal/replication 78.2% ±0.0
internal/repodispatch 84.8% ±0.0
internal/repotype 97.0% ±0.0
internal/sbom 90.6% ±0.0
internal/scanexport 96.4% ±0.0
internal/search 90.7% ±0.0
internal/secrets 91.4% ±0.0
internal/storage 84.8% ±0.0
internal/telemetry 92.2% ±0.0
internal/tiering 83.1% ±0.0
internal/trash 96.7% ±0.0
internal/urlparams 100.0% ±0.0
internal/vuln 89.5% ±0.0
internal/webhook 84.1% +0.2
internal/worker 82.6% +0.1
internal/workq 79.5% ±0.0
pkg/ansible 89.8% ±0.0
pkg/apk 96.0% ±0.0
pkg/cargo 95.6% ±0.0
pkg/compactindex 97.8% +0.2
pkg/composer 94.5% ±0.0
pkg/conan 99.2% ±0.0
pkg/conda 94.8% ±0.0
pkg/deb 80.2% ±0.0
pkg/delta 71.4% ±0.0
pkg/gemversion 100.0% ±0.0
pkg/gpg 86.7% ±0.0
pkg/helm 97.0% +0.1
pkg/logger 93.8% ±0.0
pkg/maven 96.7% ±0.0
pkg/nix 99.1% ±0.0
pkg/npm 88.0% ±0.0
pkg/nuget 97.6% ±0.0
pkg/pacman 90.4% ±0.0
pkg/pyversion 100.0% ±0.0
pkg/rpm 92.3% +0.5
pkg/rpmsign 90.5% ±0.0
pkg/rubymarshal 87.1% ±0.0
pkg/xzlimit 63.3% ±0.0
tests/integration 78.8% ±0.0
web 93.7% ±0.0
Web by area (lines)
Area Coverage vs main
src 24.2% ±0.0
src/api 91.5% ±0.0
src/components 89.4% ±0.0
src/composables 92.3% ±0.0
src/i18n 98.4% ±0.0
src/lib 98.8% ±0.0
src/pages 89.5% ±0.0
src/pwa 97.6% ±0.0
src/router 99.7% +0.4
src/stores 99.0% ±0.0
src/telemetry 90.9% ±0.0

Full report (HTML, merged profile) in the CI run artifacts

@M0Rf30
M0Rf30 merged commit bd12198 into main Nov 8, 2026
25 checks passed
@M0Rf30
M0Rf30 deleted the fix/review-batch-3 branch November 8, 2026 08:24
M0Rf30 added a commit that referenced this pull request Nov 8, 2026
…omotion, column-wise admin edits (#429)

* fix: bind docker uploads to their image, enforce license policy on promotion, column-wise admin edits

Review batch 4: the areas the previous passes skipped plus the items
deferred from #428.

Authorization and policy
- docker: a blob upload session belongs to the repository and image it
  was started for (migration 017); another image gets 404
  BLOB_UPLOAD_UNKNOWN; pre-migration sessions fail closed
- promotion evaluates the target's license policy for npm, conda,
  ansible, nuget, helm, maven, ivy and sbt; an unreadable file under a
  blocking policy is 422 LICENSE_METADATA_UNREADABLE and copies nothing;
  helm charts gain a license reader (artifacthub.io/license)

Lost updates
- project, webhook, group, SSO provider, permission target and promotion
  pipeline edits write only the columns sent (PatchX + XPatch, as
  PatchUser); unused UpdateX queries removed

Secrets
- GCS hmacKey/hmacSecret in camelCase are encrypted and hidden
- scanner: no token tails in line hints, encrypted/PGP private keys,
  github_pat_ tokens, combined findings cap

Correctness
- npm unpublish and publish rollback delete versions in one transaction
- pypi: egg and Windows installer filenames yield the release version
- cargo: [project].license fallback; non-string license is unreadable
- tiering: a cold-tier delete failure without a placement row is
  retried instead of orphaning bytes
- /ready caches the S3 probe (3 s timeout, 2 s TTL); a shutdown that
  exceeds its deadline closes remaining connections

Web
- Quotas/Cleanup links open the repository Settings tab
- Attestations lists every hosted docker repository (paged, filtered)
  and drops stale responses
- Quota, scanner and dry-run counts formatted

Upgrade notes under Unreleased in docs/getting-started/upgrading.md.

* fix(web): point the empty cleanup hint at the Settings tab

* ci(e2e): retry the Lightpanda download for up to five minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants