Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nil dereference on error #30740

Merged
merged 2 commits into from
Apr 28, 2024
Merged

Conversation

harryzcy
Copy link
Contributor

@harryzcy harryzcy commented Apr 27, 2024

In both cases, the err is nil because of if checks before

Reference: #30729

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 27, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 27, 2024
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Apr 27, 2024
@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 28, 2024
@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 28, 2024
@lunny lunny added reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. backport/v1.22 This PR should be backported to Gitea 1.22 backport/v1.21 This PR should be backported to Gitea 1.21 labels Apr 28, 2024
@lunny lunny merged commit 970965f into go-gitea:main Apr 28, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Apr 28, 2024
@GiteaBot
Copy link
Contributor

I was unable to create a backport for 1.21. @harryzcy, please send one manually. 🍵

go run ./contrib/backport 30740
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added backport/manual No power to the bots! Create your backport yourself! and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Apr 28, 2024
@wxiaoguang
Copy link
Contributor

@yardenshoham Now the main branch and 1.22 branch should be almost the same, but this backport fails. I have manually tried to cherry-pick this commit, there is no conflict. Do you have some ideas about this failure?

@yardenshoham
Copy link
Member

Relevant log:

2024-04-28 07:13:59.000	Set milestone 1.23 for PR #30740
2024-04-28 07:14:00.000	Parsing #30740
2024-04-28 07:14:00.000	Cherry-picking #30740
2024-04-28 07:14:03.000	Cherry-pick failed:
2024-04-28 07:14:03.000	Auto-merging routers/api/actions/artifacts.go
2024-04-28 07:14:03.000	CONFLICT (content): Merge conflict in routers/api/actions/artifacts.go
2024-04-28 07:14:03.000	Auto-merging routers/web/repo/actions/view.go
2024-04-28 07:14:03.000	error: could not apply 970965f6d... Fix nil dereference on error (#30740)
2024-04-28 07:14:03.000	hint: After resolving the conflicts, mark them with
2024-04-28 07:14:03.000	hint: "git add/rm <pathspec>", then run
2024-04-28 07:14:03.000	hint: "git cherry-pick --continue".
2024-04-28 07:14:03.000	hint: You can instead skip this commit with "git cherry-pick --skip".
2024-04-28 07:14:03.000	hint: To abort and get back to the state before "git cherry-pick",
2024-04-28 07:14:03.000	hint: run "git cherry-pick --abort".
2024-04-28 07:14:04.000	Added comment to #30740

@lunny
Copy link
Member

lunny commented Apr 28, 2024

I can manually cherry-pick successfully. Maybe the branch release/v1.22 has been cached and needs to be updated, since this is a new release/v1.22, a force pull is necessary or just delete it.

image

@yardenshoham
Copy link
Member

The container restarted a few hours ago so we should be good now

@harryzcy harryzcy deleted the fix-nill-dereference branch April 28, 2024 12:06
wxiaoguang pushed a commit to wxiaoguang/gitea that referenced this pull request Apr 28, 2024
In both cases, the `err` is nil because of `if` checks before

Reference: go-gitea#30729
@wxiaoguang wxiaoguang added the backport/done All backports for this PR have been created label Apr 28, 2024
@wxiaoguang
Copy link
Contributor

Backport to 1.22 manually: Fix nil dereference on error (#30740) #30746

I didn't backport it to 1.21 because actions/artifacts.go bug is a regression of #28610 , actions/view.go bug has been there for long time and it doesn't occur in daily usage.

@wxiaoguang wxiaoguang removed the backport/v1.21 This PR should be backported to Gitea 1.21 label Apr 28, 2024
silverwind pushed a commit that referenced this pull request Apr 29, 2024
Backport #30740 manually

Co-authored-by: Chongyi Zheng <git@zcy.dev>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 29, 2024
* giteaofficial/main:
  [skip ci] Updated licenses and gitignores
  add built js files to eslint ignore (go-gitea#30737)
  Gitea with first upper case + typos (go-gitea#30739)
  Fix documentation build problems because of MDX syntax conflicts (go-gitea#30744)
  Remove disk-clean workflow (go-gitea#30741)
  Bump `github.com/google/go-github` to v61 (go-gitea#30738)
  Fix nil dereference on error (go-gitea#30740)
silverwind added a commit to silverwind/gitea that referenced this pull request Apr 30, 2024
* origin/main: (55 commits)
  Fix dashboard commit status null access (go-gitea#30771)
  Fix tautological conditions (go-gitea#30735)
  Get repo assignees and reviewers should ignore deactivated users (go-gitea#30770)
  Right align the "Settings" menu item in overflow-menu (go-gitea#30764)
  Fix duplicate status check contexts (go-gitea#30660)
  Fix issue label rendering in the issue popup (go-gitea#30763)
  Fix all rounded borders, change affected tab menus to pills (go-gitea#30707)
  Rename CodeIndexerEnabled to IsRepoIndexerEnabled (go-gitea#30762)
  Remove fomantic dimmer module (go-gitea#30723)
  Resolve lint for unused parameter and unnecessary type arguments (go-gitea#30750)
  Add support for npm bundleDependencies (go-gitea#30751)
  Fix cross-compilation errors when CGO_CFLAGS/CGO_LDFLAGS is set (go-gitea#30749)
  [skip ci] Updated licenses and gitignores
  add built js files to eslint ignore (go-gitea#30737)
  Gitea with first upper case + typos (go-gitea#30739)
  Fix documentation build problems because of MDX syntax conflicts (go-gitea#30744)
  Remove disk-clean workflow (go-gitea#30741)
  Bump `github.com/google/go-github` to v61 (go-gitea#30738)
  Fix nil dereference on error (go-gitea#30740)
  Use `ProtonMail/go-crypto` for `opengpg` in tests (go-gitea#30736)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants