Skip to content

[Request]: Reduce duplicate candidate dependency installation and cache container downloads #232

Closed as not planned

Description

@jimhoyd

Problem or use case

candidate.yml installs the full workspace dependency tree on the host, then scripts/prepare-core-release.sh runs npm ci again inside a digest-pinned container over the bind-mounted checkout. The host npm cache is not mounted into the container. The host source guard imports release.ts dependencies, so simply removing installation would break it.

Source audited: ea05148. Parent audit: #185 (findings). Evidence: verify run, candidate run. Timings describe one run, not a controlled savings benchmark.

Proposed behavior and alternatives

Isolate a minimal source-check bootstrap or otherwise remove unnecessary host dependency work; provide a dedicated container npm download cache with appropriate identity and permissions. Keep locked clean installs, the pinned environment, and the rule that no GitHub credentials enter the build container. Measure before/after. Host installation was 4 seconds; full candidate preparation was 7m40s, without finer attribution. Priority: next.

Update the matching repository documentation with any behavior/workflow changes. Preserve required checks and deliberate reproducibility validation. No implementation or deployment changes were made by this audit.

Activity

  1. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Findings for #232: no workflow change is justified

    Attribution from step and in-container log timestamps. Run 35489873917 is the audited run at ea05148. Run 35491237703 is a newer candidate run on 0.4.1 (736365e).

    Phase Run 35489873917 Run 35491237703
    Whole "Prepare core" step 7m40s (04:44:06 to 04:51:46) about 7m30s
    Host npm ci --ignore-scripts 4s about 4s
    Container apt-get update and package install for the test tool about 8s about 9s
    Container npm ci --ignore-scripts 5s (244 packages) 4s
    Root npm test 4m03s 3m41s
    verify:workspaces (ui, auth, admin tests) 2m07s (auth 1m29s, admin 20s) about 2m25s (auth 1m33s, admin 20s)
    Lint, typecheck, check, build about 40s about 30s
    workspace-integration, package smoke, drills, build-candidate, release train about 45s about 50s
    • The duplicate install is about 4 to 5s of about 460s, roughly 1%. The host install is a similar 4s, so both installs together are under 2.5%.
    • About 80% of the step is the test suites run inside npm run verify. They are the release gate, so they are not removable here.
    • A container download cache could save at most a few seconds. That is the download share of a 4 to 5s install, and the runner-to-registry network is already fast at 244 packages.
    • Each install still verifies the lockfile integrity hashes, so a cache would not weaken npm ci on its own.
    • A cache that persists between runs would still add trust surface. It would be another mutable input to a release build, and it would need a run-unique or read-only-after-fill design and the correct container UID.
    • Removing the host install would also break release.ts candidate-source, which imports the release dependencies. A separate minimal bootstrap would add a second install path to maintain and buy at most 4s.

    Decision: I made no code change. The locked clean installs, the digest-pinned image, and the no-credentials-in-container rule stay as they are. If candidate time matters, the leverage is the test suites, especially root npm test at about 3.7 to 4 minutes and auth at about 1.5 minutes. That is a different issue from this one.

    What I could not establish:

    • Only two successful candidate runs were measured, and neither is a controlled benchmark.
    • I cannot run candidate.yml itself from here, so I did not measure the actual effect of a cache.
    • I did not test registry, OIDC or attestation behavior.
  2. jimhoyd commented on Sep 20, 2026

    @jimhoyd
    CollaboratorAuthor

    Closing as answered by measurement, with no change made. Findings: #232 (comment). The duplicate dependency install is about 1% of the ~7m30s candidate-preparation step; about 80% of it is the test suites inside npm run verify. A cache that persists between runs would add a mutable input to a release build to save a few seconds. Reopen if candidate preparation time is revisited, targeting the test suites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions