Skip to content

chore: improve devcontainer and align golangci-lint versions#2097

Open
nddq wants to merge 1 commit intomainfrom
chore/improve-devcontainer-experience
Open

chore: improve devcontainer and align golangci-lint versions#2097
nddq wants to merge 1 commit intomainfrom
chore/improve-devcontainer-experience

Conversation

@nddq
Copy link
Member

@nddq nddq commented Mar 5, 2026

Description

Currently the devcontainer is missing several tools needed for development (LLVM/clang, jq), uses a shell script for setup instead of devcontainer features, and has no CI validation. Separately, the golangci-lint workflow uses version: latest which drifts from the version pinned in go.mod, causing lint results that don't reproduce locally (#2027).

This PR overhauls the devcontainer and aligns CI lint tooling:

  • DevContainer: Replace installMoreTools.sh with declarative devcontainer features (LLVM 17, pinned versions), add persistent Go module/build caches, jq, Kind cluster on startup, and VS Code settings for golangci-lint + gofumpt
  • CI: Add devcontainer.yaml workflow that builds the container and runs make generate-bpf-go to validate eBPF compilation for both amd64 and arm64
  • Lint: Replace golangci-lint-action (version: latest) with go tool so CI uses the same v1.64.7 from go.mod as local make lint
  • Docs: Expand development guide with devcontainer quick-start instructions

Related Issue

Fixes #2027

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

CI will validate:

  • DevContainer builds and all tools are available via devcontainer.yaml workflow
  • eBPF compilation for amd64/arm64 via make generate-bpf-go inside the container
  • Lint via the updated golangci-lint.yaml workflow using go tool

Additional Notes

The devcontainer CI workflow only triggers on changes to .devcontainer/** to avoid unnecessary runs.

@nddq nddq requested a review from a team as a code owner March 5, 2026 14:39
@nddq nddq requested review from matmerr and vipul-21 March 5, 2026 14:39
@nddq nddq force-pushed the chore/improve-devcontainer-experience branch from 104dc35 to d106017 Compare March 5, 2026 14:43
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Retina Code Coverage Report

Total coverage increased from 33.2% to 33.3%

Increased diff

Impacted Files Coverage
pkg/enricher/enricher.go 55.0% ... 57.8% (2.8%) ⬆️

@nddq nddq force-pushed the chore/improve-devcontainer-experience branch 8 times, most recently from 69b002c to 00e6787 Compare March 5, 2026 17:04
- Add jq, LLVM 17, and VS Code linter/formatter settings to devcontainer
- Remove redundant gofumpt install (already a go tool dependency)
- Add CI workflow to validate the devcontainer builds and compiles eBPF
- Replace golangci-lint-action (version: latest) with go tool so CI
  uses the same pinned version from go.mod as local make lint
- Build linter binary for host (linux/amd64) before running cross-platform
  analysis to avoid exec format errors on Windows/ARM64 matrix jobs
- Expand development docs with devcontainer quick-start instructions

Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
@nddq nddq force-pushed the chore/improve-devcontainer-experience branch from 00e6787 to 065bf0f Compare March 5, 2026 17:07
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.

Align golangci-lint versions (local vs CI)

1 participant