Skip to content

Conversation

KingBain
Copy link
Collaborator

@KingBain KingBain commented Jun 4, 2025

Summary
This pull request standardizes and strengthens our development environment and CI checks by:

  1. Introducing two DevContainer configurations (docker-env and go-env) that bundle essential tools (JFrog CLI, linters/formatters, Docker-in-Docker, Go support) for Docker‑ and Go‑based work.
  2. Configuring a JSCPD (duplication detector) policy in .github/linters/.jscpd.json.
  3. Adding a GitHub Actions workflow (.github/workflows/super-linter.yml) to run Super‑Linter on every push/PR but only against changed files, with Checkov and JSCPD disabled in favor of our custom settings.

These changes eliminate ad hoc local setup, catch formatting/duplication issues early, and ensure everyone “boots up” with the same toolset.


What’s Changed

  1. DevContainer Configurations

    • /.devcontainer/docker-env/devcontainer.json

      • JFrog CLI (ghcr.io/devcontainers-extra/features/jfrog-cli:1): Provides the latest JFrog CLI so that anyone can authenticate against Artifactory or Xray from within the container without installing anything locally.

      • Prettier (ghcr.io/devcontainers-community/npm-features/prettier:1): Ensures JavaScript/TypeScript/Markdown/JSON files are formatted consistently.

      • Docker‑in‑Docker (ghcr.io/devcontainers/features/docker-in-docker:2):

        • Enables building and running Docker containers inside the DevContainer (via moby: true).
        • Installs Docker Buildx and Compose v2, so we can build multi‑platform images and orchestrate services without leaving VS Code.
        • Automatically configures Azure DNS detection for scenarios where DNS resolution matters.
      • Shfmt (ghcr.io/devcontainers-extra/features/shfmt:1): Formats shell scripts (.sh) on save or via shfmt -w, preventing style drift and reducing CI failures.

    • /.devcontainer/go-env/devcontainer.json

      • All the features listed above, plus:

        • Go (ghcr.io/devcontainers/features/go:1): Installs the latest Go toolchain and common Go linters, so you get instant go vet, golint, goimports, etc.

    Value:

    • New contributors or team members no longer need to juggle local installations of Docker, Go, JFrog CLI, linters, etc.
    • Ensures everyone uses the same versions (e.g., Prettier, shfmt, Go) to avoid “works on my machine” problems.
    • Docker‑in‑Docker support means we can test container builds inside the DevContainer itself instead of installing Docker directly on the host.
  2. Automated Linting Workflow

    Value:

    • Every push and PR triggers a consistent suite of linters (shellcheck, markdownlint, yamllint, gofmt, flake8, etc.) across multiple languages without us having to install/configure each separately.
    • By only linting changed files, we avoid long CI hang times on legacy code.
    • Early feedback loop: style/formatting/low‑severity issues are caught in the PR stage, reducing the chance of merge‑time rework.

Why This Matters

  1. Consistent Onboarding & Productivity

    • New team members simply clone the repo, open it in VS Code, and have everything they need. No manual installation of Go, Docker, JFrog CLI, Prettier, or shfmt—the DevContainer brings it all.
    • Onboarding time drops from “install X, configure Y” to “open in DevContainer, start coding.”
  2. Prevent “Works on My Machine”

    • Every contributor now runs against the same base image (mcr.microsoft.com/devcontainers/base:jammy) with identical feature versions (e.g., Go 1.xx, JFrog CLI latest, Docker‑in‑Docker).
    • Linting/formatting enforcement ensures nobody commits code that breaks on Linux because they have an uncommitted .editorconfig or rely on a different Prettier version locally.
  3. Early Detection of Issues

    • By integrating Super‑Linter into CI, style errors, syntax mistakes, and common misconfigurations are flagged before merging.
    • The custom JSCPD threshold prevents large blocks of copy/paste from creeping into the codebase—duplication can lead to bugs when someone updates one copy but not the other.

User Visual Experience

PR Status Check
image

Individual Linting Report
image

Detailed Linting Report
image

Remediation Steps
image


Next Steps / Recommendations

  • Begin to use the repo to make code changes experience the linter.
  • 90% of linting issues can be resolved with Prettier.
  • After experience linting, use Branch Protection to enforce Linting passes.
  • Figure out which python linters you want to use(there are 20,000 python linters) and configure super linter to focus on the pythong linters you want/or dont want :)

@simardeep1792
Copy link
Collaborator

@KingBain thank you for this :)

@KingBain
Copy link
Collaborator Author

KingBain commented Jun 4, 2025

Natural Language Linting isnt working right now.

@simardeep1792 simardeep1792 requested review from simardeep1792 and sylus and removed request for sylus June 4, 2025 10:53
@KingBain
Copy link
Collaborator Author

KingBain commented Jun 4, 2025

Going to come back to this

@KingBain KingBain closed this Jun 4, 2025
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.

4 participants