Commit graph

9 commits

Author SHA1 Message Date
William Martin
e5f5427b97 Simplify bump-go.sh toolchain logic
Address review feedback: always set both go and toolchain
directives via go mod edit, then let go mod tidy normalize.
This eliminates complex conditional toolchain handling.

Additional fixes:
- Add go mod tidy after edits to reconcile dependencies
- Commit go.sum alongside go.mod
- Filter PR search to open PRs only (--state open)
- Use GITHUB_REPOSITORY for repo instead of hardcoding
- Use git diff to detect no-op bumps post-tidy
- Read go.mod state via go mod edit -json instead of grep

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-13 15:29:49 +02:00
copilot-swe-agent[bot]
d2cc91bdd4 Remove unnecessary null checks in jq output handling
The jq -r flag with // "" operator already returns empty string
for null/missing values, never the literal string "null".
The checks for == "null" are unnecessary.

Co-authored-by: babakks <36728931+babakks@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
copilot-swe-agent[bot]
355f507c62 Rewrite script to use go mod edit instead of grep/sed
Replace manual parsing and editing with go mod edit:
- Use 'go mod edit -json' to read current go and toolchain directives
- Use 'go mod edit -go' to update go directive
- Use 'go mod edit -toolchain' to update toolchain directive
- Remove manual sed/grep parsing and .bak file handling
- More reliable and maintainable than custom text manipulation

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
copilot-swe-agent[bot]
209ef1d3b8 Address code review comments
- Clarify comment to say "matches" instead of "matches or exceeds"
- Update PR body to accurately reflect final go.mod state
- Show actual toolchain if present, or note it's not specified
- Provide clear explanation when toolchain is omitted

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
copilot-swe-agent[bot]
653ffc23ca Improve version comparison to handle both X.Y.0 and X.Y.Z formats
- Compare major.minor versions instead of exact string match
- Preserve go directive if already at latest major.minor
- Handle cases where go.mod has full patch version (e.g., 1.25.6)
- Update PR body to use actual go directive from modified go.mod
- Add detailed comments explaining version handling logic

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
copilot-swe-agent[bot]
f5610036b9 Update bump-go.sh to handle missing toolchain directive
- Add early trap setup to avoid exit code issues
- Handle missing toolchain directive gracefully with `|| true`
- Add logic to detect when toolchain is expected to be missing
- Add informative messages about missing toolchain
- Implement smart toolchain handling:
  - Skip toolchain when go version matches latest (redundant)
  - Add toolchain when go version is older than latest
  - Update toolchain when it exists but is outdated

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
2026-05-13 14:41:02 +02:00
William Martin
268b11efc9 Ensure go directive is always .0 version
This is because go mod tidy will always add the final minor version so
we might as well handle it in the script ahead of time.
2025-07-09 17:12:11 +02:00
William Martin
00cb1efe83 Ensure go mod tidy is run in bump-go
This is because go mod tidy seems to add minor version to the go mod
directive when it is missing.
2025-07-05 13:17:00 +02:00
William Martin
12aeb1fed2 Add workflow to automate go version bumping 2025-07-01 12:10:22 +02:00