Skip to content

feat: add devcontainer testing environment for PR reviews#530

Open
marcusburghardt wants to merge 2 commits into
complytime:mainfrom
marcusburghardt:opsx/dev-testing-environment
Open

feat: add devcontainer testing environment for PR reviews#530
marcusburghardt wants to merge 2 commits into
complytime:mainfrom
marcusburghardt:opsx/dev-testing-environment

Conversation

@marcusburghardt
Copy link
Copy Markdown
Member

@marcusburghardt marcusburghardt commented May 29, 2026

Summary

Add a devcontainer-based Fedora 43 testing environment that gives maintainers and contributors a one-command path from reviewing a PR to running complyctl commands in a realistic environment.

The environment supports GitHub Codespaces, DevPod, and VS Code Dev Containers. A post-create script automates the full setup: builds complyctl and mock-oci-registry, installs snappy (v0.2.4), ampel (v1.2.1), and conftest (v0.68.2) at pinned versions, clones and builds all complytime-providers, configures a test workspace with Gemara content, and starts the mock OCI registry with a readiness check. GITHUB_TOKEN is handled with least-privilege scoping.

The environment auto-rebuilds complyctl on shell login when the source has changed (e.g., after checking out a PR branch), with opt-out via COMPLYCTL_SKIP_REBUILD=1. SELinux compatibility is handled via --security-opt label=disable for podman rootless.

Once merged, the same approach will be replicated to complytime-providers with a mirrored devcontainer configuration, enabling consistent testing of changes on both sides of the complyctl + providers pipeline.

OpenSpec artifacts in openspec/changes/dev-testing-environment/ (proposal, design with 10 decisions, spec with 3 FRs and 15 scenarios, tasks with 6 phases).

Related Issues

This PR addresses a key friction point in the project collaboration workflow. Today, manually testing CLI UX changes requires setting up a complex multi-repository environment (complyctl + complytime-providers + complytime-demos) with Vagrant, Ansible, and libvirt. This discourages thorough manual testing during PR reviews.

With this change, any maintainer or contributor can go from "looking at a PR" to "running complyctl commands in a Fedora environment" in a single command. This accelerates:

  • PR reviews: Reviewers can immediately verify CLI output, error messages, and user experience instead of relying solely on CI logs.
  • Contributor onboarding: New contributors can explore the tool without setting up the full development stack.
  • Demos: The environment provides a reproducible, self-contained setup for demonstrating complyctl capabilities to stakeholders.

Review Hints

  • Start with docs/TESTING_ENVIRONMENT.md for the user-facing documentation and workflows (Codespaces, DevPod, VS Code).
  • The post-create script at .devcontainer/scripts/post-create.sh mirrors patterns from tests/cross-repo/cross_repo_integration_test.sh (GITHUB_TOKEN least-privilege, mock registry readiness check).
  • make test-devcontainer runs the CI smoke test (Containerfile builds). The full environment test requires DevPod or Codespaces: devpod up . --ide none && devpod ssh complyctl
  • The spec artifacts document 10 design decisions covering version pinning, SELinux, GOTOOLCHAIN, auto-rebuild, and provider clone-from-main trade-offs.

Add devcontainer-based testing environment proposal with design, specs,
and tasks. This change will provide maintainers with a one-command Fedora
environment for interactive CLI testing during PR reviews using GitHub
Codespaces, DevPod, or VS Code Dev Containers.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt marcusburghardt requested a review from a team as a code owner May 29, 2026 09:47
Comment thread .devcontainer/Containerfile Fixed
Comment thread .devcontainer/Containerfile Fixed
@marcusburghardt marcusburghardt force-pushed the opsx/dev-testing-environment branch 2 times, most recently from 33e72de to 56b5153 Compare May 29, 2026 10:23
Comment thread .devcontainer/Containerfile Dismissed
Add .devcontainer/ configuration providing a Fedora 43-based
testing environment for interactive CLI testing during PR reviews.

New files:
- .devcontainer/Containerfile: Fedora 43 base with required packages
- .devcontainer/devcontainer.json: devcontainer standard config
- .devcontainer/scripts/post-create.sh: automated setup script
- docs/dev-testing-environment.md: maintainer/contributor docs

Modified files:
- README.md: add link to dev testing environment docs
- AGENTS.md: add .devcontainer/ to project structure
- Makefile: add test-devcontainer smoke test target

The post-create script builds complyctl and mock-oci-registry,
installs snappy (v0.2.4) and ampel (v1.2.1) at pinned versions,
clones and builds complytime-providers from main, configures a
test workspace with Gemara content, and starts the mock OCI
registry. GITHUB_TOKEN is handled with least-privilege scoping.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt marcusburghardt force-pushed the opsx/dev-testing-environment branch from 56b5153 to 456281e Compare May 29, 2026 15:20
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