From 426f46d3271acaf8570e0baa94fde96e0d569057 Mon Sep 17 00:00:00 2001 From: "Mr. Z" Date: Thu, 9 Oct 2025 18:46:06 -0400 Subject: [PATCH] sync: update 9 files from source repository --- .cursorrules | 9 ++-- .devcontainer.json | 4 +- .dockerignore | 16 ++++--- .github/.env.base | 2 +- .github/workflows/codeql-analysis.yml | 6 +-- .github/workflows/scorecard.yml | 2 +- .gitpod.yml | 63 ++++++++++++++++++--------- .goreleaser.yml | 32 ++++++++++++-- codecov.yml | 17 +++++++- 9 files changed, 108 insertions(+), 43 deletions(-) diff --git a/.cursorrules b/.cursorrules index 3841b1f..9c22fe3 100644 --- a/.cursorrules +++ b/.cursorrules @@ -4,9 +4,9 @@ All contributors must read `.github/AGENTS.md` for complete guidelines. If any rule here conflicts with that file, **AGENTS.md** takes precedence. ## Coding Standards -- Format with `go fmt ./...` and `goimports -w .`. -- Lint with `golangci-lint run` and vet with `go vet ./...`. -- Run `go test ./...` before committing. +- Format with `magex format:fix`. +- Lint with `magex lint` and vet with `magex vet`. +- Run `magex test` before committing. - Follow Go naming and commenting conventions described in AGENTS.md. ## Commit Messages @@ -22,8 +22,7 @@ All contributors must read `.github/AGENTS.md` for complete guidelines. If any r 4. **Impact / Risk** ## Dependency Management -- Manage modules with `go mod tidy` after import changes. -- Run `make govulncheck` to check for vulnerabilities when dependencies change. +- Manage modules with `magex tidy` after import changes. ## Security Reporting - Do not open public issues for vulnerabilities. diff --git a/.devcontainer.json b/.devcontainer.json index 31cc2b6..15b63a9 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -8,7 +8,7 @@ ], "settings": { "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, "editor.formatOnSave": true, "go.lintTool": "golangci-lint", @@ -29,7 +29,7 @@ "type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock" ], "name": "go-tx-map dev container", - "postCreateCommand": "make lint && go vet ./... && go test ./...", + "postCreateCommand": "magex lint && magex vet && magex test", "remoteUser": "vscode", "runArgs": [ "--cap-drop=ALL", diff --git a/.dockerignore b/.dockerignore index 491e267..24398bd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -54,16 +54,20 @@ __pycache__/ .LSOverride ._* -# Custom repo notes -todo.md - # Temporary directories in the project bin tmp -.golangci.yml + +# Project files not needed in the container +.cursorrules +.editorconfig +.github +.gitpod.yml .golangci.json +.golangci.yml .goreleaser.yml -.editorconfig -codecov.yml +.vscode +docs LICENSE README.md +codecov.yml diff --git a/.github/.env.base b/.github/.env.base index a0256d1..f11c05f 100644 --- a/.github/.env.base +++ b/.github/.env.base @@ -225,7 +225,7 @@ REDIS_CACHE_FORCE_PULL=false # Force pull Redis images even when cache # đŸĒ„ MAGE-X CONFIGURATION # ================================================================================================ -MAGE_X_VERSION=v1.7.2 # https://github.com/mrz1836/mage-x/releases +MAGE_X_VERSION=v1.7.5 # https://github.com/mrz1836/mage-x/releases MAGE_X_AUTO_DISCOVER_BUILD_TAGS=true # Enable auto-discovery of build tags MAGE_X_AUTO_DISCOVER_BUILD_TAGS_EXCLUDE=race,custom # Comma-separated list of tags to exclude MAGE_X_FORMAT_EXCLUDE_PATHS=vendor,node_modules,.git,.idea # Format exclusion paths (comma-separated directories to exclude from formatting) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1178ab3..967dad2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,7 +47,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5 + uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -58,7 +58,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5 + uses: github/codeql-action/autobuild@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -68,4 +68,4 @@ jobs: # uses a compiled language - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5 + uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 14b7a89..57f9a40 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -78,6 +78,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable the upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e296a935590eb16afc0c0108289f68c87e2a89a5 # v3.29.5 + uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.29.5 with: sarif_file: results.sarif diff --git a/.gitpod.yml b/.gitpod.yml index 1b00fc5..9b33859 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,31 +1,54 @@ -# Gitpod workspace configuration for the local repository. -# This file creates a repeatable cloud development environment. -# It ensures dependencies are installed and the codebase is vetted -# and tested on workspace start. -image: - name: gitpod/workspace-full:1.0.0 +# Gitpod workspace configuration for go-tx-map +# Uses magex for build automation and development tasks +# This creates a one-click development environment for contributors + +image: gitpod/workspace-go:latest + tasks: - name: setup-and-test init: | - echo "Downloading Go modules..." - go mod download - go mod tidy - # Install goimports if not present - if ! command -v goimports >/dev/null; then - go install golang.org/x/tools/cmd/goimports@latest - fi - go fmt ./... - goimports -w . - golangci-lint run - go vet ./... + echo "🚀 Setting up go-tx-map development environment..." + echo "đŸ“Ļ Installing MAGE-X build tool..." + go install github.com/mrz1836/mage-x/cmd/magex@latest + + echo "đŸ“Ĩ Downloading dependencies..." + magex deps:download + + echo "🔧 Initial build..." + magex build + + echo "✅ Running initial tests..." + magex test + command: | - go test ./... + echo "===============================================" + echo "đŸŽ¯ Welcome to go-tx-map development!" + echo "===============================================" + echo "" + echo "đŸ› ī¸ Available magex commands:" + echo " magex test - Run all tests" + echo " magex lint - Run linters" + echo " magex format:fix - Format code" + echo " magex build - Build the project" + echo " magex help - List all available commands" + echo "" + echo "📖 Quick start:" + echo " 1. Try: magex test" + echo " 2. Make your changes" + echo " 3. Run: magex format:fix && magex lint && magex test" + echo " 4. Commit and push your changes" + echo "" + echo "💡 For more help: magex help" + echo "===============================================" + ports: - port: 8080 - onOpen: open-preview - description: Application + onOpen: ignore + description: Application (if needed) + vscode: extensions: - golang.go - github.vscode-pull-request-github - streetsidesoftware.code-spell-checker + - eamodio.gitlens diff --git a/.goreleaser.yml b/.goreleaser.yml index 55e4319..a06a105 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -3,16 +3,17 @@ # General # --------------------------- version: 2 + before: hooks: - - make test + - sh -c 'if [ "$SKIP_GORELEASER_TESTS" = "true" ]; then echo "Skipping tests (SKIP_GORELEASER_TESTS=true)"; else magex test; fi' changelog: sort: asc filters: exclude: - - "^.github:" - "^.vscode:" - "^test:" + # --------------------------- # Builder # --------------------------- @@ -24,12 +25,32 @@ builds: - windows - darwin skip: true + +# --------------------------- +# Archives +# --------------------------- +archives: + - id: go-tx-map + name_template: >- + {{- .ProjectName }}_{{- .Version }}_{{- .Os }}_{{- .Arch }} + files: + - LICENSE + - README.md + +# --------------------------- +# Checksum +# --------------------------- +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" + algorithm: sha256 + # --------------------------- # Github Release # --------------------------- release: prerelease: "false" name_template: "Release v{{.Version}}" + # --------------------------- # Announce # --------------------------- @@ -37,15 +58,17 @@ announce: # See more at: https://goreleaser.com/customization/announce/#slack slack: enabled: false - message_template: "{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/bsv-blockchain/{{ .ProjectName }}/releases/tag/{{ .Tag }}" + message_template: "{{ .ProjectName }} {{ .Tag }} is out! Changelog: https://github.com/{{ .GitOwner }}/{{ .ProjectName }}/releases/tag/{{ .Tag }}" channel: "#test_slack" # username: '' # icon_emoji: '' # icon_url: '' + # See more at: https://goreleaser.com/customization/announce/#twitter twitter: enabled: false message_template: "{{ .ProjectName }} {{ .Tag }} is out!" + # See more at: https://goreleaser.com/customization/announce/#discord discord: enabled: false @@ -56,6 +79,7 @@ announce: color: "" # Defaults to `https://goreleaser.com/static/avatar.png` icon_url: "" + # See more at: https://goreleaser.com/customization/announce/#reddit reddit: enabled: false @@ -64,6 +88,6 @@ announce: # Username for your Reddit account username: "" # Defaults to `{{ .GitURL }}/releases/tag/{{ .Tag }}` - # url_template: 'https://github.com/bsv-blockchain/{{ .ProjectName }}/releases/tag/{{ .Tag }}' + # url_template: 'https://github.com/{{ .GitOwner }}/{{ .ProjectName }}/releases/tag/{{ .Tag }}' # Defaults to `{{ .ProjectName }} {{ .Tag }} is out!` title_template: "{{ .ProjectName }} {{ .Tag }} is out!" diff --git a/codecov.yml b/codecov.yml index 9e38d31..fb9566a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,6 +2,7 @@ # ---------------------- codecov: require_ci_to_pass: true + # Coverage configuration # ---------------------- coverage: @@ -11,14 +12,27 @@ coverage: # (default is 70..100) round: down # up, down, or nearest precision: 2 # Number of decimal places, between 0 and 5 + +# Flag Management - Simple carryforward for everything +# ---------------------- +flag_management: + default_rules: + carryforward: true # This keeps coverage from previous uploads + statuses: + - type: project + target: auto + threshold: 2% + # Ignoring Paths # -------------- # which folders/files to ignore ignore: - ".github/**" - - ".make/**" + - ".mage-cache/**" - ".vscode/**" + - "bin/**" - "examples/**" + # Parsers # -------------- parsers: @@ -28,6 +42,7 @@ parsers: loop: yes method: no macro: no + # Pull request comments: # ---------------------- # Diff is the Coverage Diff of the pull request.