Skip to content

Update minimum go version to 1.26.1, golangci-lint to 2.11.2, fix test style#36876

Merged
silverwind merged 3 commits intogo-gitea:mainfrom
bircni:feature/go-findings
Mar 10, 2026
Merged

Update minimum go version to 1.26.1, golangci-lint to 2.11.2, fix test style#36876
silverwind merged 3 commits intogo-gitea:mainfrom
bircni:feature/go-findings

Conversation

@bircni
Copy link
Copy Markdown
Member

@bircni bircni commented Mar 9, 2026

Hey, I bumped Go to 1.26.1 and fixed a couple of things I ran into while poking around.

Changes

  • Bump go.mod from 1.26.0 to 1.26.1 (security patch)
  • Bump golangci-lint from v2.10.1 to v2.11.2
  • Run make tidy, fmt, lint-go

- Bump go.mod from 1.26.0 to 1.26.1 (security patch)
- Refactor TestMatchIssuesEvent to use tagged switch on tc.eventType
- Run make tidy, fmt, lint-go
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 9, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 9, 2026
@silverwind
Copy link
Copy Markdown
Member

Written by Claude for silverwind.

  1. workflows_test.go: semantic change, not just a refactor — The original switch on tc.payload.Action explicitly handled the HookIssueLabelCleared"unlabeled" mapping regardless of eventType. The new switch on tc.eventType loses that explicit relationship. With current test data it produces the same results, but if a HookIssueLabelCleared test case were added with a non-"unlabeled" eventType, the new code would fall through to default and produce string(api.HookIssueLabelCleared) instead of "unlabeled". The original code better expressed the domain logic.

  2. Unmentioned golangci-lint bump — The Makefile bumps golangci-lint from v2.10.1 to v2.11.2 but the PR description doesn't mention it. This is a meaningful change that could introduce new lint rules or behavior changes.

@silverwind silverwind enabled auto-merge (squash) March 10, 2026 04:59
@silverwind silverwind disabled auto-merge March 10, 2026 04:59
Restore the original switch on tc.payload.Action which explicitly
handles the HookIssueLabelCleared → "unlabeled" mapping, preserving
the domain logic relationship.

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
@silverwind
Copy link
Copy Markdown
Member

silverwind commented Mar 10, 2026

  1. Logic change reverted. A refactor is not supposed to change logic
  2. Mention the golangci-lint bump in PR title and description

@silverwind silverwind changed the title go: bump to 1.26.1, fix test style, verify lint Update minimum go version to 1.26.1, golangci-lint to 2.11.2, fix test style Mar 10, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 10, 2026
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 10, 2026
@silverwind silverwind enabled auto-merge (squash) March 10, 2026 05:56
@silverwind silverwind merged commit 8d06a94 into go-gitea:main Mar 10, 2026
26 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Mar 10, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 10, 2026
@bircni bircni deleted the feature/go-findings branch March 10, 2026 06:59
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 10, 2026
* giteaofficial/main:
  Update minimum go version to 1.26.1, golangci-lint to 2.11.2, fix test style (go-gitea#36876)
  Add render cache for SVG icons (go-gitea#36863)
  Fix incorrect viewed files counter if reverted change was viewed (go-gitea#36819)
  [skip ci] Updated translations via Crowdin
  Clean up `refreshViewedFilesSummary` (go-gitea#36868)
  Remove `util.URLJoin` and replace all callers with direct path concatenation (go-gitea#36867)
  Optimize Docker build with dependency layer caching (go-gitea#36864)
  Fix URLJoin, markup render link reoslving, sign-in/up/linkaccount page common data (go-gitea#36861)
  Fix CodeQL code scanning alerts (go-gitea#36858)
  Refactor auth middleware (go-gitea#36848)
  Update Nix flake (go-gitea#36857)
  Update JS deps (go-gitea#36850)
  Load `mentionValues` asynchronously (go-gitea#36739)
  [skip ci] Updated translations via Crowdin
  Fix dbfs error handling (go-gitea#36844)
  Fix OAuth2 authorization code expiry and reuse handling (go-gitea#36797)
  Fix org permission API visibility checks for hidden members and private orgs (go-gitea#36798)
@bircni bircni mentioned this pull request Mar 22, 2026
lunny pushed a commit that referenced this pull request Mar 22, 2026
I'd like to apply as a maintainer.

Thanks to @TheFox0x7 for the suggestion.

Merged PRs:
- #36441
- #36571
- #36603
- #36768
- #36776
- #36783
- #36876
- #36883
- #36924

Ongoing work:
- #36514
- #36752
- #36912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/dependencies modifies/go Pull requests that update Go code modifies/internal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants