Skip to content

Adding devcontainer for development ease - #7111

Open
RohanRusta21 wants to merge 1 commit into
pipe-cd:masterfrom
RohanRusta21:feat/devcontainer
Open

Adding devcontainer for development ease#7111
RohanRusta21 wants to merge 1 commit into
pipe-cd:masterfrom
RohanRusta21:feat/devcontainer

Conversation

@RohanRusta21

Copy link
Copy Markdown

What this PR does:

Adds a Dev Container so contributors can get a working environment without
installing the toolchain by hand.

  • .devcontainer/devcontainer.json — one file, based on
    mcr.microsoft.com/devcontainers/go:1.26-trixie, which ships the Go toolchain,
    the Go tools (gopls, dlv) and make/gcc that go test -race needs.
  • Features: Node 24.10.0 (which also installs yarn) and Docker-in-Docker.
  • onCreateCommand installs kind v0.32.0, kubectl and Helm 3.17.3, and pre-fetches
    dependencies (go mod download, make setup-envtest, make update/web-deps) in
    parallel, so make build, make test and make check work on first open.
  • Forwards 8080 (Control Plane port-forward) and 9090 (web dev server).
  • Recommends the Go, ESLint and Prettier extensions.
  • CONTRIBUTING.md: replaces the "Online one-click setup for contributing"
    placeholder with usage instructions for Codespaces and VS Code.

Versions are pinned to CI (build.yaml, lint.yaml) and web/package.json, with
comments naming the source file so they get bumped together.

Notes:

  • Docker-in-Docker rather than mounting the host socket, because make lint/go and
    make gen/code bind-mount ${PWD}, which only resolves for a daemon running
    inside the container.
  • "moby": false is required: Moby packages are not published for Debian trixie, so
    the feature installs Docker CE instead.
  • The image tracks Go 1.26 (currently 1.26.5) rather than CI's exact 1.26.2. It
    satisfies go.mod's minimum, but it is not an exact pin.
  • Hugo is not included, so previewing the docs site still follows docs/README.md.
  • On arm64, make gen/code and make run/pipecd need
    docker run --privileged --rm tonistiigi/binfmt --install amd64 first, since both
    are amd64-only in this repo today. Everything else runs natively.

Why we need it:

Setting up a local environment today means installing eight tools whose versions are
spread across five files (go.mod, web/package.json, .github/workflows/build.yaml,
.github/workflows/lint.yaml, docs/README.md), and several requirements are not
documented anywhere:

  • make test/go passes -race, so it needs a C compiler; the failure does not say so.
  • make test/go also needs KUBEBUILDER_ASSETS, i.e. make setup-envtest must run first.
  • make lint/go and make gen/code need Docker, and break on setups where ${PWD}
    is not visible to the daemon.
  • The web app needs yarn 1.x to match web/yarn.lock.

It also helps Windows contributors, who currently need WSL — docs/README.md notes
that make and grep are not available in PowerShell. And running
make up/local-cluster inside Docker-in-Docker keeps the kind cluster, the
kind-registry container and the pipecd-data volume off the contributor's own Docker
and kubeconfig.

Finally, CONTRIBUTING.md has been advertising this as pending — "We are preparing
Gitpod and Codespace to facilitate the setup process for contributing." This implements
the Codespaces and VS Code half of that.

Which issue(s) this PR fixes:

Fixes #6581

Does this PR introduce a user-facing change?: No

  • How are users affected by this change: Not affected. This changes only the
    contributor environment; no PipeCD component, API, configuration or chart is touched.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

👋 Hi @RohanRusta21, welcome to PipeCD and thanks for opening your first pull request!

We’re really happy to have you here

Before your PR gets merged, please check a few important things below.


Helpful resources


DCO Sign-off

All commits must include a Signed-off-by line to comply with the Developer Certificate of Origin (DCO).

In case you forget to sign-off your commit(s), follow these steps:

For the last commit:

git commit --amend --signoff
git push --force-with-lease

For multiple commits:

git rebase --signoff origin/master
git push --force-with-lease

Run checks locally

Before pushing updates, please run:

make check

This runs the same checks as CI and helps catch issues early.


💬 Need help?

If anything is unclear, feel free to ask in this PR or join us on the CNCF Slack in the #pipecd channel.
You can get your Slack invite from: https://communityinviter.com/apps/cloud-native/cncf

Thanks for contributing to PipeCD! ❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add .devcontainer to standardize and automate the contributor environment

2 participants