Skip to content

Run Component build steps in artifact build (S-002-2..10, S-002-12, S-002-13) #115

Closed

Description

@shipmill-romamo

Builds part of spec S-002, docs/specs/002-component-build-steps.md (feature issue #86): the acceptance criteria below. Each needs a test that names its id (test_s002_<k>_..., or a proves: S-002-2 comment line).

  • S-002-2: artifact build --ref <sha> for that Component produces a tarball containing web/dist/index.html, even though the repository's .gitignore lists web/dist
  • S-002-3: The same tarball contains no web/node_modules/ entry and contains every file git ls-files lists at that commit
  • S-002-4: The metadata file next to the tarball has spec.build.steps listing both steps' workingDirectory and command in order, and spec.build.tools with the versions node --version and pnpm --version printed, and validates against artifact.schema.json
  • S-002-5: When a declared build tool is not on PATH, artifact build exits ARTIFACT_BUILD_FAILED with code artifact_build_tool_missing naming the tool, and no git clone runs
  • S-002-6: When a declared build tool prints a version older than its buildTools minimum, artifact build exits ARTIFACT_BUILD_FAILED with code artifact_build_tool_unsupported naming the tool and both versions
  • S-002-7: A build step that exits non-zero makes artifact build exit ARTIFACT_BUILD_FAILED with code artifact_build_step_failed naming the step and its exit code, and the output directory holds no new .tar.gz or .json file
  • S-002-8: A step that finishes but leaves an artifact.include path missing makes artifact build exit ARTIFACT_BUILD_FAILED with code artifact_include_missing and write no artifact
  • S-002-9: A step that prints to stdout leaves the stdout of artifact build a single valid JSON envelope
  • S-002-10: A build step sees CI=true and does not see a variable such as HCLOUD_TOKEN set in the controller's environment
  • S-002-12: cloudfall deploy of a built release puts web/dist/index.html under <installRoot>/releases/<release>/, and cloudfall rollback to the previous release makes <installRoot>/current/web/dist/ that release's files
  • S-002-13: For a Component without build, artifact build packages the same file list as before this change and writes metadata with no spec.build key

Depends on #113

Activity

  1. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    Triage: implement, for the next release candidate.

    The plan: build the criteria listed in the body, as docs/specs/002-component-build-steps.md (S-002, approved in #98) says, each with a test that names its id. A departure from a criterion goes back as a question, never a quiet change. Build issues start in order: this one starts once every issue on its Depends on lines has closed. I'll link the PR here.

  2. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    PR #138 makes artifact build run a Component's build steps in a clean environment (CI=true, no controller secrets), check build tools before the clone, package tracked files plus artifact.include paths, and record spec.build in the metadata; step output goes to stderr and a failed step leaves no artifact. It marks spec 002 built. I asked for two changes before it lands: each step's own timeoutSeconds (up to 3600 s) must be the limit that fires, and a tracked file a step deletes must fail the build (S-002-3).

    Trade-off: the deploy/rollback test for S-002-12 needs GNU tar and runs first on CI's Linux runner; no real node/pnpm build or live host was used.

  3. added a commit that references this issue on Oct 27, 2026
    1e85b8f
  4. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    Released in v0.8.0rc7 (pre-release). uv tool install --prerelease allow cloudfall==0.8.0rc7
    A plain install gets it with the next stable release.
    If you filed this: react 👍 on this comment once it works for you, or reply if it doesn't.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions