diff --git a/.dockerignore b/.dockerignore index 24398bd..32b8aa1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -38,7 +38,7 @@ __pycache__/ *.py[cod] *$py.class .pytest_cache/ -..mypy_cache/ +.mypy_cache/ # Test binary, build with `go test -c` *.test diff --git a/.github/.env.base b/.github/.env.base index 53fed8b..00dd75b 100644 --- a/.github/.env.base +++ b/.github/.env.base @@ -238,7 +238,7 @@ MAGE_X_AUTO_DISCOVER_BUILD_TAGS_EXCLUDE=race,custom # Comma-separated MAGE_X_FORMAT_EXCLUDE_PATHS=vendor,node_modules,.git,.idea # Format exclusion paths (comma-separated directories to exclude from formatting) MAGE_X_GITLEAKS_VERSION=8.28.0 # https://github.com/gitleaks/gitleaks/releases MAGE_X_GOFUMPT_VERSION=v0.9.1 # https://github.com/mvdan/gofumpt/releases -MAGE_X_GOLANGCI_LINT_VERSION=v2.5.0 # https://github.com/golangci/golangci-lint/releases +MAGE_X_GOLANGCI_LINT_VERSION=v2.6.0 # https://github.com/golangci/golangci-lint/releases MAGE_X_GORELEASER_VERSION=v2.12.7 # https://github.com/goreleaser/goreleaser/releases MAGE_X_GOVULNCHECK_VERSION=v1.1.4 # https://pkg.go.dev/golang.org/x/vuln MAGE_X_GO_SECONDARY_VERSION=1.24.x # Secondary Go version for MAGE-X (also our secondary) @@ -256,6 +256,9 @@ MAGE_X_YAMLFMT_VERSION=v0.17.2 # https://github.c # Optional Overrides (use .env.custom to override these defaults) # MAGE_X_BINARY_NAME=magex +# MAGE_X_BUILD_BATCH_DELAY_MS=200 +# MAGE_X_BUILD_BATCH_SIZE=2 +# MAGE_X_BUILD_STRATEGY=incremental # MAGE_X_BUILD_TAGS=mage # MAGE_X_DOWNLOAD_BACKOFF=2.0 # MAGE_X_DOWNLOAD_INITIAL_DELAY=300 @@ -315,7 +318,7 @@ GO_PRE_COMMIT_MAX_FILES_OPEN=100 GO_PRE_COMMIT_ALL_FILES=true # Tool Versions -GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.5.0 # https://github.com/golangci/golangci-lint +GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.6.0 # https://github.com/golangci/golangci-lint GO_PRE_COMMIT_FUMPT_VERSION=v0.9.1 # https://github.com/mvdan/gofumpt GO_PRE_COMMIT_GOIMPORTS_VERSION=latest # https://github.com/golang/tools diff --git a/.github/tech-conventions/pre-commit.md b/.github/tech-conventions/pre-commit.md index 644ddb4..316f0cc 100644 --- a/.github/tech-conventions/pre-commit.md +++ b/.github/tech-conventions/pre-commit.md @@ -392,7 +392,7 @@ go-pre-commit install go install github.com/mrz1836/go-pre-commit/cmd/go-pre-commit@latest # Update tool versions in .env.base -GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.5.0 +GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.6.0 GO_PRE_COMMIT_FUMPT_VERSION=v0.9.0 ``` diff --git a/.github/workflows/fortress-code-quality.yml b/.github/workflows/fortress-code-quality.yml index 2b18ef9..9ad730d 100644 --- a/.github/workflows/fortress-code-quality.yml +++ b/.github/workflows/fortress-code-quality.yml @@ -263,6 +263,14 @@ jobs: runner-os: ${{ inputs.primary-runner }} use-local: ${{ env.MAGE_X_USE_LOCAL }} + # -------------------------------------------------------------------- + # Capture golangci-lint version for outputs and reporting + # -------------------------------------------------------------------- + - name: 🔍 Capture golangci-lint version + id: golangci-lint-version + run: | + echo "version=${{ env.MAGE_X_GOLANGCI_LINT_VERSION }}" >> $GITHUB_OUTPUT + # -------------------------------------------------------------------- # Restore Cache golangci-lint # -------------------------------------------------------------------- @@ -271,7 +279,7 @@ jobs: uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ env.GOLANGCI_LINT_CACHE }} - key: ${{ inputs.primary-runner }}-golangci-lint-analysis-${{ hashFiles('.golangci.json', env.GO_SUM_FILE) }} + key: ${{ inputs.primary-runner }}-golangci-lint-analysis-${{ hashFiles('.golangci.json', env.GO_SUM_FILE) }}-${{ steps.golangci-lint-version.outputs.version }} - name: 🔍 Debug cache usage run: | diff --git a/.github/workflows/fortress-security-scans.yml b/.github/workflows/fortress-security-scans.yml index afb2ec2..0c16437 100644 --- a/.github/workflows/fortress-security-scans.yml +++ b/.github/workflows/fortress-security-scans.yml @@ -245,7 +245,7 @@ jobs: with: path: | ~/.cache/govulncheck-bin - key: ${{ inputs.primary-runner }}-govulncheck-${{ env.GOVULNCHECK_VERSION }} + key: ${{ inputs.primary-runner }}-govulncheck-${{ env.GOVULNCHECK_VERSION }}-go${{ env.GOVULNCHECK_GO_VERSION }} - name: 🛠️ Make cached govulncheck usable run: | diff --git a/.github/workflows/fortress.yml b/.github/workflows/fortress.yml index 54b1b84..89c30ae 100644 --- a/.github/workflows/fortress.yml +++ b/.github/workflows/fortress.yml @@ -149,8 +149,9 @@ jobs: needs: [load-env, setup, test-magex, warm-cache] if: | !cancelled() && - needs.warm-cache.result != 'failure' && - needs.warm-cache.result != 'cancelled' && + needs.setup.result == 'success' && + needs.test-magex.result == 'success' && + (needs.warm-cache.result == 'success' || needs.warm-cache.result == 'skipped') && needs.setup.outputs.security-scans-enabled == 'true' permissions: contents: read # Read repository content for security scanning @@ -176,8 +177,9 @@ jobs: needs: [load-env, setup, test-magex, warm-cache] if: | !cancelled() && - needs.warm-cache.result != 'failure' && - needs.warm-cache.result != 'cancelled' + needs.setup.result == 'success' && + needs.test-magex.result == 'success' && + (needs.warm-cache.result == 'success' || needs.warm-cache.result == 'skipped') permissions: contents: read # Read repository content for code quality checks uses: ./.github/workflows/fortress-code-quality.yml @@ -199,8 +201,9 @@ jobs: needs: [load-env, setup, test-magex, warm-cache] if: | !cancelled() && - needs.warm-cache.result != 'failure' && - needs.warm-cache.result != 'cancelled' && + needs.setup.result == 'success' && + needs.test-magex.result == 'success' && + (needs.warm-cache.result == 'success' || needs.warm-cache.result == 'skipped') && needs.setup.outputs.pre-commit-enabled == 'true' permissions: contents: read # Read repository content for pre-commit checks @@ -219,8 +222,9 @@ jobs: needs: [load-env, setup, test-magex, warm-cache] if: | !cancelled() && - needs.warm-cache.result != 'failure' && - needs.warm-cache.result != 'cancelled' + needs.setup.result == 'success' && + needs.test-magex.result == 'success' && + (needs.warm-cache.result == 'success' || needs.warm-cache.result == 'skipped') permissions: contents: write # Write repository content and push to gh-pages branch for test execution pull-requests: write # Required: Coverage workflow needs to create PR comments @@ -259,8 +263,9 @@ jobs: needs: [load-env, setup, test-magex, warm-cache] if: | !cancelled() && - needs.warm-cache.result != 'failure' && - needs.warm-cache.result != 'cancelled' && + needs.setup.result == 'success' && + needs.test-magex.result == 'success' && + (needs.warm-cache.result == 'success' || needs.warm-cache.result == 'skipped') && needs.setup.outputs.benchmarks-enabled == 'true' permissions: contents: read # Read repository content for benchmarking