Skip to content

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Oct 14, 2025

This PR updates Go to the latest stable release.

  • go directive: 1.25.0
  • toolchain: 1.25.3

Other changes:

  • All docs pointing to Go version are updated.
  • Devcontainer dependency on Go is updated and tested in Codespaces.
  • An old backport of strings.CutSuffix is now dropped in favour of stdlib implementation.

The reported vulnerabilities (e.g. here) are false positives. It's because govluncheck thinks we're importing the latest untagged cli/cli as an external dependency.

@github-actions github-actions bot requested a review from a team as a code owner October 14, 2025 03:20
@github-actions github-actions bot requested a review from babakks October 14, 2025 03:20
This was referenced Oct 17, 2025
@babakks babakks self-assigned this Oct 31, 2025
Signed-off-by: Babak K. Shandiz <babakks@github.com>
The `cutSuffix` function was added to backport the functionality of
`strings.CutSuffix` from Go 1.20. Now that we're using Go 1.25, we can
safely replace our backport with the standard library function. Our
backport was an intact copy/paste of the stdlib implementation, so this
change does not alter any behavior.

Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
@babakks babakks requested review from BagToad and Copilot and removed request for babakks October 31, 2025 12:28
Comment on lines -100 to -106
// Backport strings.CutSuffix from Go 1.20.
func cutSuffix(s, suffix string) (string, bool) {
if !strings.HasSuffix(s, suffix) {
return s, false
}
return s[:len(s)-len(suffix)], true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an intact copy/paste of the stdlib implementation (below), so it's safe to just use the stdlib now:

func CutSuffix(s, suffix string) (before string, found bool) {
	if !HasSuffix(s, suffix) {
		return s, false
	}
	return s[:len(s)-len(suffix)], true
}

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the project's Go version requirement from 1.24 to 1.25 and removes a custom cutSuffix backport function in favor of using the standard library's strings.CutSuffix.

  • Upgrades Go version from 1.24 to 1.25 in go.mod
  • Replaces custom cutSuffix function with strings.CutSuffix from the standard library
  • Updates documentation and development environment configurations to reflect the new Go version requirement

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/ghinstance/host.go Removes custom cutSuffix backport function and uses strings.CutSuffix
go.mod Updates Go version to 1.25.0 and toolchain to go1.25.3
docs/source.md Updates documentation to require Go 1.25+
docs/install_source.md Updates installation instructions to require Go 1.25+
.github/CONTRIBUTING.md Updates contributor prerequisites to require Go 1.25+
.devcontainer/devcontainer.json Updates dev container image to use Go 1.25

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@BagToad BagToad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think there are issues with this branch. Govulncheck is failing 🤔

@babakks
Copy link
Member

babakks commented Oct 31, 2025

Yeah, I've noticed them. Already touched on this in the body:

The reported vulnerabilities (e.g. here) are false positives. It's because govluncheck thinks we're importing the latest untagged cli/cli as an external dependency.

@babakks
Copy link
Member

babakks commented Nov 3, 2025

@BagToad, I think I reproduced this by shallow cloning the repo (--depth 1) and running govulncheck on the binary (expand below). This is what happens in our CI. govulncheck compalins because it doesn't know the actual version of the binary it's testing. So, I think we're okay.

Details

➜  cli git:(trunk) govulncheck ./...
No vulnerabilities found.
➜  cli git:(trunk) make
GOOS= GOARCH= GOARM= GOFLAGS= CGO_ENABLED= go build -o script/build script/build.go
go build -trimpath -ldflags "-X github.com/cli/cli/v2/internal/build.Date=2025-11-03 -X github.com/cli/cli/v2/internal/build.Version=cd9e5e5 " -o bin/gh ./cmd/gh
➜  cli git:(trunk) govulncheck -mode binary ./bin/gh
=== Symbol Results ===

Vulnerability #1: GO-2024-3310
    Downloading malicious GitHub Actions workflow artifact results in path
    traversal vulnerability in github.com/cli/cli
  More info: https://pkg.go.dev/vuln/GO-2024-3310
  Module: github.com/cli/cli/v2
    Found in: github.com/cli/cli/v2@v2.0.0-20251101001944-cd9e5e534fc0
    Fixed in: github.com/cli/cli/v2@v2.63.1
    Vulnerable symbols found:
      #1: accessibility.NewCmdAccessibility
      #2: actions.NewCmdActions
      #3: add.NewCmdAdd
      #4: add.NewCmdAdd
      #5: add.NewCmdAdd
      Use '-show traces' to see the other 1518 found symbols

Vulnerability #2: GO-2024-3296
    Recursive repository cloning can leak authentication tokens to non-GitHub
    submodule hosts in github.com/cli/cli
  More info: https://pkg.go.dev/vuln/GO-2024-3296
  Module: github.com/cli/cli/v2
    Found in: github.com/cli/cli/v2@v2.0.0-20251101001944-cd9e5e534fc0
    Fixed in: github.com/cli/cli/v2@v2.63.0
    Vulnerable symbols found:
      #1: accessibility.NewCmdAccessibility
      #2: actions.NewCmdActions
      #3: add.NewCmdAdd
      #4: add.NewCmdAdd
      #5: add.NewCmdAdd
      Use '-show traces' to see the other 1518 found symbols

Vulnerability #3: GO-2024-3269
    Connecting to a malicious Codespaces via GH CLI could allow command
    execution on the user's computer in github.com/cli/cli
  More info: https://pkg.go.dev/vuln/GO-2024-3269
  Module: github.com/cli/cli/v2
    Found in: github.com/cli/cli/v2@v2.0.0-20251101001944-cd9e5e534fc0
    Fixed in: github.com/cli/cli/v2@v2.62.0
    Vulnerable symbols found:
      #1: accessibility.NewCmdAccessibility
      #2: actions.NewCmdActions
      #3: add.NewCmdAdd
      #4: add.NewCmdAdd
      #5: add.NewCmdAdd
      Use '-show traces' to see the other 1518 found symbols

Your code is affected by 3 vulnerabilities from 1 module.
This scan found no other vulnerabilities in packages you import or modules you
require.
Use '-show verbose' for more details.

@BagToad
Copy link
Member

BagToad commented Nov 3, 2025

@babakks oh wow good catch! I'm a bit confused because won't this happen in every PR CI run if we merge this? I suspect the answer is "no" and we're good to merge this, but do you know? My gut tells me this is going to happen on every CI run, but then again this shallow clone is there in trunk too, so I don't know why it's only causing an issue now in this PR.

@BagToad
Copy link
Member

BagToad commented Nov 3, 2025

BTW, should we bump Go in go-gh too?

@BagToad
Copy link
Member

BagToad commented Nov 3, 2025

Update from @babakks and I discussing this more:

It looks like the vcs stamp is now different in Go 1.25 when built with a shallow clone. It now drops the minor and patch versions v2.xx.xx and instead uses an arbitrary v2.0.0 causing govulncheck to think we are building gh with vulnerabilities discovered and fixed between v2.0.0 and the latest v2.85.x. We're not sure why exactly this changed.

Setting buildvcs to false fixes the issue because that version information doesn't get stamped into the binary, but that's probably not a great fix.

We also noticed that scanning in source code mode instead of binary mode fixes the issue, probably because the source code scan can resolve the real versions.

At one point I changed the govulncheck.yml from binary scanning to source code scanning to fix our code scanning alerts and configuration, since scanning in binary mode does not include the line number information that GitHub Code Scanning requires.

That said, a safe change is to update the liny.yml workflow to also scan in source code mode, as this was likely an oversight on my part anyway when I proposed we update the govulncheck workflow.

Additionally, we can also leverage code scanning for the lint workflow by exporting the SARIF file, enabling rich line annotations for govulncheck findings directly in PRs down the line.

@BagToad BagToad merged commit e73a0e0 into trunk Nov 3, 2025
10 of 11 checks passed
@BagToad BagToad deleted the bump-go-1.25.3 branch November 3, 2025 18:32
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 6, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cli/cli](https://github.com/cli/cli) | minor | `v2.82.1` -> `v2.83.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.83.0`](https://github.com/cli/cli/releases/tag/v2.83.0): GitHub CLI 2.83.0

[Compare Source](cli/cli@v2.82.1...v2.83.0)

#### What's Changed

##### ✨ Features

- Add `isImmutable` to `release list` JSON output by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;12064](cli/cli#12064)
- `gh agent-task create`: support `--custom-agent`/`-a` flag by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;12068](cli/cli#12068)
- 💡 (gh repo delete) Add warning when `--yes` is ignored without a repository, Closes: [#&#8203;12033](cli/cli#12033) by [@&#8203;Shion1305](https://github.com/Shion1305) in [#&#8203;12039](cli/cli#12039)
- feat: implement gh `pr revert` by [@&#8203;lucasmelin](https://github.com/lucasmelin) in [#&#8203;8826](cli/cli#8826)

##### 🐛 Fixes

- fix(gist): add support for editing & viewing large files  by [@&#8203;luxass](https://github.com/luxass) in [#&#8203;11761](cli/cli#11761)
- Fix gh attestation verify to work when Public Good Instance of Sigstore is unavailable by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;11989](cli/cli#11989)

##### 📚 Docs & Chores

- chore: add basic linters by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;12084](cli/cli#12084)
- CI: Update lint govulncheck to use source mode by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;12089](cli/cli#12089)
- chore: add `workflow_dispatch` to govulncheck triggers by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;12085](cli/cli#12085)
- Exclude `third-party` from Golangci-lint formatting paths by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;12058](cli/cli#12058)
- Apply `go fix` to remove deprecated `// +build` tags by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;12056](cli/cli#12056)
- Bump Golangci-lint to `v2.6.0` by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;12049](cli/cli#12049)
- Mention `pr checks` in `run list` docs by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;12050](cli/cli#12050)
- Fix typo in comment for `gh issue develop` branch checkout command by [@&#8203;jonzfisher](https://github.com/jonzfisher) in [#&#8203;12042](cli/cli#12042)
- Use "release" sentinel value for release attestation verification by [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;11991](cli/cli#11991)
- Improve docstring for release-create by [@&#8203;bdehamer](https://github.com/bdehamer) in [#&#8203;11945](cli/cli#11945)
- Improve `api` command docs around `--input` and `--field` by [@&#8203;babakks](https://github.com/babakks) in [#&#8203;12062](cli/cli#12062)
- Fix `--interval` flags docs in `gh pr checks` by [@&#8203;2003Aditya](https://github.com/2003Aditya) in [#&#8203;12053](cli/cli#12053)

##### :dependabot: Dependencies

- Bump Go to 1.25.3 by [@&#8203;github-actions](https://github.com/github-actions)\[bot] in [#&#8203;11926](cli/cli#11926)
- chore(deps): bump github.com/cli/go-gh/v2 from 2.12.2 to 2.13.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12095](cli/cli#12095)
- Update Go toolchain version to 1.24.9 by [@&#8203;BagToad](https://github.com/BagToad) in [#&#8203;12054](cli/cli#12054)
- chore(deps): bump golang.org/x/text from 0.29.0 to 0.30.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11973](cli/cli#11973)
- chore(deps): bump golang.org/x/crypto from 0.42.0 to 0.43.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11974](cli/cli#11974)
- chore(deps): bump actions/upload-artifact from 4 to 5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12031](cli/cli#12031)
- chore(deps): bump actions/download-artifact from 5 to 6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12032](cli/cli#12032)
- chore(deps): bump github.com/rivo/tview from 0.0.0-20250625164341-a4a78f1e05cb to 0.42.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;12000](cli/cli#12000)
- chore(deps): bump goreleaser/goreleaser-action from 6.3.0 to 6.4.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11509](cli/cli#11509)
- chore(deps): bump mislav/bump-homebrew-formula-action from 3.4 to 3.6 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;11750](cli/cli#11750)

#### New Contributors

- [@&#8203;lucasmelin](https://github.com/lucasmelin) made their first contribution in [#&#8203;8826](cli/cli#8826)
- [@&#8203;jonzfisher](https://github.com/jonzfisher) made their first contribution in [#&#8203;12042](cli/cli#12042)
- [@&#8203;2003Aditya](https://github.com/2003Aditya) made their first contribution in [#&#8203;12053](cli/cli#12053)

**Full Changelog**: <cli/cli@v2.82.1...v2.83.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNjkuMyIsInVwZGF0ZWRJblZlciI6IjQxLjE2OS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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.

5 participants