Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Do not mutate incoming options to RenderUserSearch and SearchUsers#34544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@philip-peterson
Copy link
Contributor

@philip-petersonphilip-peterson commentedMay 27, 2025
edited
Loading

This PR changes theopts argument inSearchUsers() to be passed by value instead of by pointer, as its mutations do not escape the function scope and are not used elsewhere. This simplifies reasoning about the function and avoids unnecessary pointer usage.

This insight emerged during an initial attempt to refactorRenderUserSearch(), which currently intermixes multiple concerns.

Issue targeted: none

@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelMay 27, 2025
@github-actionsgithub-actionsbot added modifies/apiThis PR adds API routes or modifies them modifies/goPull requests that update Go code labelsMay 27, 2025
@GiteaBotGiteaBot added lgtm/need 1This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelsMay 27, 2025
@GiteaBotGiteaBot added lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1This PR needs approval from one additional maintainer to be merged. labelsMay 27, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commentedMay 27, 2025
edited
Loading

No need to force-push or rebase or squash (and actually please don't do these after the review starts 🙏 otherwise it would be difficult to review new changes)

The final merge will be a squash merge.

@philip-peterson
Copy link
ContributorAuthor

@wxiaoguang Oh, sorry about that! 😬 Will keep it in mind for next time...

wxiaoguang reacted with laugh emojiwxiaoguang reacted with heart emoji

@wxiaoguangwxiaoguangenabled auto-merge (squash)May 27, 2025 19:16
@wxiaoguangwxiaoguang merged commitb0936f4 intogo-gitea:mainMay 27, 2025
26 checks passed
@GiteaBotGiteaBot added this to the1.25.0 milestoneMay 27, 2025
@philip-petersonphilip-peterson deleted the peterson/no-mutate-opts branchMay 28, 2025 00:50
lunny pushed a commit that referenced this pull requestJun 2, 2025
Similar to#34544, this PR changes the `opts` argument in`SearchRepositoryByName()` to be passed by value instead of by pointer,as its mutations do not escape the function scope and are not usedelsewhere. This simplifies reasoning about the function and avoidsunnecessary pointer usage.This insight emerged during an initial attempt to refactor`RenderUserSearch()`, which currently intermixes multiple concerns.---------Co-authored-by: Philip Peterson <philip-peterson@users.noreply.github.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull requestJun 3, 2025
* giteaofficial/main:  Refactor some tests (go-gitea#34580)  Do not mutate incoming options to SearchRepositoryByName (go-gitea#34553)  Fix/improve avatar sync from LDAP (go-gitea#34573)  Fix some trivial problems (go-gitea#34579)  Retain issue sort type when a keyword search is introduced (go-gitea#34559)  Always use an empty line to separate the commit message and trailer (go-gitea#34512)  Fix line-button issue after file selection in file tree (go-gitea#34574)  [skip ci] Updated translations via Crowdin  Fix doctor deleting orphaned issues attachments (go-gitea#34142)  [skip ci] Updated translations via Crowdin  Fix actions skipped commit status indicator (go-gitea#34507)  Clean up "file-view" related styles (go-gitea#34558)  Add "View workflow file" to Actions list page (go-gitea#34538)  Do not mutate incoming options to RenderUserSearch and SearchUsers  (go-gitea#34544)  Add webhook assigning test and fix possible bug (go-gitea#34420)  Fix possible nil description of pull request when migrating from CodeCommit (go-gitea#34541)  Refactor commit reader (go-gitea#34542)
hantang pushed a commit to qundao/mirror-forgejo that referenced this pull requestJun 17, 2025
## Checklist- [x] go to the last cherry-pick PR (forgejo/forgejo#7965) to figure out how far it went: [gitea@9d4ebc1f2c](go-gitea/gitea@9d4ebc1)- [x] cherry-pick and open PR (forgejo/forgejo#8040)- [ ] have the PR pass the CI- end-to-end (specially important if there are actions related changes)  - [ ] add `run-end-to-end` label  - [ ] check the result- [ ] write release notes- [ ] assign reviewers- [ ] 48h later, last call- merge 1 hour after the last call## Legend- ❓ - No decision about the commit has been made.- 🍒 - The commit has been cherry picked.- ⏩ - The commit has been skipped.- 💡 - The commit has been skipped, but should be ported to Forgejo.- ✍️ - The commit has been skipped, and a port to Forgejo already exists.## Commits- 🍒 [`gitea`](go-gitea/gitea@50d9565) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/c3e6eab73235ac189ca3a36ce2b8ea8d8ad82c81) Add sort option recentclose for issues and pulls ([gitea#34525](go-gitea/gitea#34525))## TODO- 💡 [`gitea`](go-gitea/gitea@d5bbaee) Retain issue sort type when a keyword search is introduced ([gitea#34559](go-gitea/gitea#34559))  UI: Small bat might be nice. Test needed? Do we've frontend tests covering the search?------- 💡 [`gitea`](go-gitea/gitea@82ea238) Always use an empty line to separate the commit message and trailer ([gitea#34512](go-gitea/gitea#34512))  Needs merge------- 💡 [`gitea`](go-gitea/gitea@74858dc) Fix line-button issue after file selection in file tree ([gitea#34574](go-gitea/gitea#34574))  Frontend: Makes it sense to pick/port ui logic in *.ts files?------- 💡 [`gitea`](go-gitea/gitea@7149c9c) Fix doctor deleting orphaned issues attachments ([gitea#34142](go-gitea/gitea#34142))  Doctor: seems useful.------- 💡 [`gitea`](go-gitea/gitea@0cec4b8) Fix actions skipped commit status indicator ([gitea#34507](go-gitea/gitea#34507))  Actions: Might benefit from additional tests.------- 💡 [`gitea`](go-gitea/gitea@4cb0c64) Add "View workflow file" to Actions list page ([gitea#34538](go-gitea/gitea#34538))  Actions: Needs tests------- 💡 [`gitea`](go-gitea/gitea@b0936f4) Do not mutate incoming options to RenderUserSearch and SearchUsers ([gitea#34544](go-gitea/gitea#34544))  Nice refactoring but needs manual merge.------- 💡 [`gitea`](go-gitea/gitea@498088c) Add webhook assigning test and fix possible bug ([gitea#34420](go-gitea/gitea#34420))  Integrationtest has conflicts needs merge.------- 💡 [`gitea`](go-gitea/gitea@24a5105) Fix possible nil description of pull request when migrating from CodeCommit ([gitea#34541](go-gitea/gitea#34541))  Is this relevant to forgejo? Did not find the place to apply this small change.------- 💡 [`gitea`](go-gitea/gitea@688da55) Split GetLatestCommitStatus as two functions ([gitea#34535](go-gitea/gitea#34535))  Merge required.------- 💡 [`gitea`](go-gitea/gitea@ab96912) Don't display error log when .git-blame-ignore-revs doesn't exist ([gitea#34457](go-gitea/gitea#34457))  Unsure wheter this affects forgejo. Tests missing.------- 💡 [`gitea`](go-gitea/gitea@11ee7ff) fix: return 201 Created for CreateVariable API responses ([gitea#34517](go-gitea/gitea#34517))  Actions: This is marked as breaking the api. Pls think about whether this breaking change iss needed & how this impact api-version-increase.  The corresponding clinet change can be found here:https://gitea.com/gitea/go-sdk/pulls/713/files------- 💡 [`gitea`](go-gitea/gitea@9b295e9) Actions list ([gitea#34530](go-gitea/gitea#34530))  Actions: Regression fromgo-gitea/gitea#34337 Part ofhttps://codeberg.org/forgejo/forgejo/pulls/7909------## Skipped- ⏩ [`gitea`](go-gitea/gitea@bb6377d) [skip ci] Updated translations via Crowdin------- ⏩ [`gitea`](go-gitea/gitea@07d802a) [skip ci] Updated translations via Crowdin------- ⏩ [`gitea`](go-gitea/gitea@c6e2093) Clean up "file-view" related styles ([gitea#34558](go-gitea/gitea#34558))  - gitea ui specific specific------- ⏩ [`gitea`](go-gitea/gitea@9f10885) Refactor commit reader ([gitea#34542](go-gitea/gitea#34542))  - gitea refactor specific------<details><summary><h2>Stats</h2></summary><br>Between [`gitea@9d4ebc1f2c`](go-gitea/gitea@9d4ebc1) and [`gitea@d5bbaee64e`](go-gitea/gitea@d5bbaee), **18** commits have been reviewed. We picked **1**, skipped **4**, and decided to port **13**.</details>Co-authored-by: Markus Amshove <scm@amshove.org>Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>Reviewed-on:https://codeberg.org/forgejo/forgejo/pulls/8040Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de>Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
@go-giteago-gitea locked asresolvedand limited conversation to collaboratorsAug 26, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@lunnylunnylunny approved these changes

@wxiaoguangwxiaoguangwxiaoguang approved these changes

Assignees

No one assigned

Labels

lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/apiThis PR adds API routes or modifies themmodifies/goPull requests that update Go code

Projects

None yet

Milestone

1.25.0

Development

Successfully merging this pull request may close these issues.

4 participants

@philip-peterson@wxiaoguang@lunny@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp