Skip to content

feat: bootstrap smoke-test repo with bare-runner CI - #210

Merged
gerchowl merged 22 commits into
devfrom
feature/170-bootstrap-smoke-test-repo
Mar 3, 2026
Merged

gerchowl merged 22 commits into
devfrom
feature/170-bootstrap-smoke-test-repo

Conversation

@c-vigo

@c-vigo c-vigo commented Feb 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Bootstraps the smoke-test infrastructure for issue #170. This PR delivers the devcontainer-side changes required to allow a downstream workspace (bootstrapped from the template) to run ci.yml successfully on a bare GitHub-hosted runner — without a devcontainer being present.

The changes harden the image and workspace template so that tools like pre-commit and bandit are available in both devcontainer and bare-runner contexts, move runtime environment variables into the image, and wire just sync into the workspace bootstrap so the project package is installed from the start.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • Containerfile — add bandit[toml] to system Python install; bake PRE_COMMIT_HOME, UV_PROJECT_ENVIRONMENT, and VIRTUAL_ENV as ENV so they are available outside the devcontainer context
  • assets/workspace/.github/actions/setup-env/action.yml — add mandatory pre-commit install step
  • assets/workspace/.devcontainer/scripts/setup-gh-repo.sh — detach org default code security configuration on post-create
  • assets/workspace/.devcontainer/justfile.base / justfile.base — sync recipe no longer passes --no-install-project; update target calls sync
  • assets/init-workspace.sh — run just sync after placeholder replacement so the project package is installed during bootstrap
  • assets/workspace/.devcontainer/docker-compose.yml — remove env vars now baked into image
  • tests/test_integration.py — new/updated integration tests covering all of the above
  • tests/bats/setup-gh-repo.bats — BATS tests for security-config detach
  • CHANGELOG.md — Unreleased entries added

Changelog Entry

Added

  • Smoke-test repo bootstrap validation (#170)
    • Downstream smoke coverage that bootstraps a workspace from the template and verifies ci.yml passes on a real GitHub-hosted runner
  • bandit pre-installed in devcontainer image (#170)
    • bandit[toml] added to the system Python install in the Containerfile
  • pre-commit pre-installed in CI setup-env action (#170)
    • Workspace setup-env composite action now installs pre-commit as a mandatory step so hooks are available in bare-runner CI without a devcontainer
  • setup-gh-repo.sh detaches org default code security configuration (#170)
    • On post-create, detach any org-level default security config from the repo to avoid conflicts with the security workflows shipped in the workspace template
    • Graceful fallback when repo ID cannot be resolved or permissions are insufficient
  • init-workspace.sh runs just sync after placeholder replacement (#170)
    • Resolves the uv.lock for the new project name and installs the project package into the venv during workspace bootstrap

Changed

  • Environment variables moved from docker-compose.yml into Containerfile ENV (#170)
    • PRE_COMMIT_HOME, UV_PROJECT_ENVIRONMENT, and VIRTUAL_ENV are now baked into the image so they are available outside of the devcontainer context (e.g. bare-runner CI)
  • just sync installs the project package (#170)
    • Removed --no-install-project from the sync recipe so the workspace project is always installed into the venv

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

N/A

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

N/A

Refs: #161, #170, #186

…-commit hook

This change modifies the pre-commit configuration to remove the 'check-skill-names' hook in addition to 'generate-docs'.
'check-skill-names'  only makes sense in this project and should not be shipped downstream.

Refs: #170
This update introduces a new pre-commit hook, 'sync-manifest', which synchronizes the workspace template with the manifest.
The hook executes a script to ensure that the assets/workspace directory is kept in sync with the manifest.
Existing files are synchronized here too.

Refs: #170
Updated the pre-commit configuration to streamline the entry commands for the
'generate-docs' and 'sync-manifest' hooks by calling the script directly.

Refs: #170
CI setup will be fundamentally different in downstream projects.

Refs: [#170](#170)
Remove "hadolint-docker", "pip-licenses", "check-action-pins", "bandit", and "validate-commit-msg"
They are not available in downstream projects yet.

Refs: #170
- Move PRE_COMMIT_HOME, UV_PROJECT_ENVIRONMENT, VIRTUAL_ENV from
  docker-compose.yml to Containerfile image ENV
- Remove --no-install-project from sync recipe so project is installed
- Add just sync step to init-workspace.sh after placeholder replacement

Refs: #170
@c-vigo
c-vigo requested a review from gerchowl as a code owner February 26, 2026 12:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Bootstraps smoke-test infrastructure for issue #170 by hardening the devcontainer image and workspace template so the shipped workspace CI (assets/workspace/.github/workflows/ci.yml) can run successfully on a bare GitHub-hosted runner (no devcontainer).

Changes:

  • Bake runtime env vars into the image, add bandit[toml] to the image toolchain, and update dependency sync behavior to install the project package during workspace initialization.
  • Extend workspace bootstrap automation (setup-gh-repo.sh) to detach org-level default code security configuration and update template/manifest transforms accordingly.
  • Add/adjust integration + image tests (including new BATS coverage) to validate bootstrap + tooling behavior.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Containerfile Installs bandit[toml] and bakes PRE_COMMIT_HOME, UV_PROJECT_ENVIRONMENT, VIRTUAL_ENV into the image.
assets/init-workspace.sh Preserves README.md/CHANGELOG.md on upgrades and runs just sync during init.
justfile.base Makes sync install the project; update delegates to sync.
assets/workspace/.devcontainer/justfile.base Mirrors sync/update behavior in the workspace template.
assets/workspace/.devcontainer/docker-compose.yml Removes env vars now baked into the image; keeps runtime socket env vars.
assets/workspace/.github/actions/setup-env/action.yml Adds a pre-commit install step for bare-runner CI setup.
assets/workspace/.devcontainer/scripts/setup-gh-repo.sh Adds org default code security configuration detachment logic.
tests/bats/setup-gh-repo.bats Adds BATS assertions covering setup-gh-repo.sh behavior/structure.
tests/conftest.py Updates init-workspace stage tracking for the new “Syncing dependencies” step.
tests/test_integration.py Updates docker-compose env expectations and adds regression for uv.lock after init.
tests/test_image.py Adds bandit version expectation and adjusts uv venv workflow test env handling.
scripts/transforms.py Expands empty pre-commit repo block cleanup to apply to any repo: block.
scripts/manifest.toml Updates workspace-sync entries/transforms (including more hook removals + trailing blank line stripping).
assets/workspace/.pre-commit-config.yaml Removes hooks not intended for downstream template usage.
assets/workspace/.devcontainer/scripts/gh_issues.py Enhances issue/PR listing with GitHub hyperlinks and CI status rollup display.
assets/workspace/.cursor/skills/worktree_verify/SKILL.md Adds delegation guidance content.
assets/workspace/.cursor/skills/worktree_ci-fix/SKILL.md Adds delegation guidance content.
assets/workspace/.cursor/skills/ci_check/SKILL.md Adds delegation guidance content.
assets/workspace/.cursor/skills/worktree_plan/SKILL.md Removes delegation section content.
assets/workspace/.cursor/skills/worktree_execute/SKILL.md Removes delegation section content.
assets/workspace/.cursor/skills/worktree_brainstorm/SKILL.md Removes delegation section content.
assets/workspace/.cursor/skills/code_review/SKILL.md Removes delegation section content.
README.md Updates recipe listings/descriptions to match current Justfile grouping.
CONTRIBUTE.md Updates recipe listings/descriptions to match current Justfile grouping.
CHANGELOG.md Adds Unreleased entries describing smoke-test bootstrap work + related fixes.
.pre-commit-config.yaml Makes docs generation hook non-swallowing; adds a sync-manifest hook.
.github/pr-draft-128-into-dev.md Removes an obsolete PR draft file.
Comments suppressed due to low confidence (1)

assets/workspace/.github/actions/setup-env/action.yml:108

  • The action installs pre-commit via system pip, but the workspace CI workflow runs uv run pre-commit .... Since pre-commit is not a project dependency in assets/workspace/pyproject.toml, uv run won't be able to find it. Consider installing it into the uv environment (e.g., via uv pip install pre-commit after uv sync) or changing the workflow to call pre-commit directly if you intend a global install. Related: the workspace CI also runs uv run bandit ..., but bandit isn't installed here either, so bare-runner CI will still fail unless it’s installed into the same environment.
    # ── pre-commit ───────────────────────────────────────────────────────────
    - name: Install pre-commit
      shell: bash
      run: python -m pip install --upgrade pre-commit

    # ── Python dependencies ───────────────────────────────────────────────
    - name: Sync Python dependencies
      if: inputs.sync-dependencies == 'true'
      shell: bash
      run: uv sync --frozen --all-extras

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .pre-commit-config.yaml Resolved
@c-vigo

c-vigo commented Feb 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@gerchowl this PR temporarily disables all local pre-commit hooks in the shipped container with manifest.toml:

[[entries]]
src = ".pre-commit-config.yaml"
transforms = [
  { type = "RemovePrecommitHooks", hook_ids = [
    "hadolint-docker",
    "generate-docs",
    "sync-manifest",
    "pip-licenses",
    "check-action-pins",
    "bandit",
    "check-skill-names",
    "prepare-commit-msg-strip-trailers",
    "check-agent-identity",
    "validate-commit-msg",
  ] },
...
]

This is necessary to run CI in the smoke-test repo, will be fixed with #171. If that's fine, approve & merge.

@c-vigo

c-vigo commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@gerchowl reminder

@gerchowl
gerchowl merged commit 70dd926 into dev Mar 3, 2026
13 checks passed
@gerchowl
gerchowl deleted the feature/170-bootstrap-smoke-test-repo branch March 3, 2026 09:00
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.

3 participants