Skip to content

Remove error returns from crypto random helpers and callers#37240

Merged
wxiaoguang merged 5 commits intomainfrom
copilot/remove-error-return-value
Apr 16, 2026
Merged

Remove error returns from crypto random helpers and callers#37240
wxiaoguang merged 5 commits intomainfrom
copilot/remove-error-return-value

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

  • Review new PR comment and confirm scope (fix lint)
  • Reproduce lint failure locally using repository lint targets
  • Make minimal code/test changes to resolve lint failure
  • Run targeted validation for touched code
  • Reply to PR comment with commit hash

Co-Authored-By: Copilot <copilot@openai.com>
Co-Authored-By: GPT-5 <gpt-5@openai.com>

Agent-Logs-Url: https://github.com/go-gitea/gitea/sessions/c341b362-61c7-4c3a-aabb-8aae3fece250

Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 16, 2026
@wxiaoguang wxiaoguang marked this pull request as ready for review April 16, 2026 15:30
@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 Apr 16, 2026
@silverwind
Copy link
Copy Markdown
Member

silverwind commented Apr 16, 2026

@copilot what are "failure modes that are not expected in normal runtime", describe them.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

@copilot what are "failure modes that are not expected in normal runtime", describe them.

It means low-level OS randomness failures coming from crypto/rand (for example, system RNG device/syscall failure or an unavailable entropy source), which would indicate a broken runtime environment rather than an application-level condition we can recover from. In this code path we treat that as unrecoverable and panic instead of propagating error through all callers.

— Authored by Copilot (GPT-5)

Copilot AI requested a review from silverwind April 16, 2026 16:02
@silverwind
Copy link
Copy Markdown
Member

@copilot fix lint

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Apr 16, 2026

Copilot is such garbage, it does apparently not even read AGENTS.md which has the lint instruction.

Copilot AI and others added 2 commits April 16, 2026 16:17
Co-Authored-By: Copilot <copilot@openai.com>

Co-Authored-By: GPT-5 <gpt-5@openai.com>

Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
# Conflicts:
#	models/actions/runner.go
#	models/actions/task.go
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

@copilot fix lint

Fixed in a3e7fac.

make lint-go now passes after removing always-nil error returns from the two internal token helper paths and updating callers accordingly.

— Authored by Copilot (GPT-5)

@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 Apr 16, 2026
@wxiaoguang wxiaoguang merged commit 4a2bba9 into main Apr 16, 2026
30 checks passed
@wxiaoguang wxiaoguang deleted the copilot/remove-error-return-value branch April 16, 2026 16:59
@GiteaBot GiteaBot added this to the 1.27.0 milestone Apr 16, 2026
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 17, 2026
* main:
  Replace `dropzone` with `@deltablot/dropzone` (go-gitea#37237)
  Add `ExternalIDClaim` option for OAuth2 OIDC auth source (go-gitea#37229)
  Remove error returns from crypto random helpers and callers (go-gitea#37240)
  Use Content-Security-Policy: script nonce (go-gitea#37232)
  Remove htmx (go-gitea#37224)
  Refactor "htmx" to "fetch action" (go-gitea#37208)
  Fix UI regression (go-gitea#37218)
  Fix corrupted JSON caused by goccy library (go-gitea#37214)
  Add test for "fetch redirect", add CSS value validation for external render (go-gitea#37207)
  Fix incorrect concurrency check (go-gitea#37205)
  refactor: simplify ParseCatFileTreeLine and catBatchParseTreeEntries (go-gitea#37210)
  Update go js py dependencies (go-gitea#37204)
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants