-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Followup to pinned Issues #24945
Followup to pinned Issues #24945
Conversation
Test failure unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unpin works now for me.
The https://github.com/go-gitea/gitea/actions/runs/5098326031/jobs/9165402897?pr=24948 @JakobDev can you check it? If you think you can not fix it, please skip the test on CI. We can not tolerate flaky tests.
|
I've seen this |
Is there any Way to cause this failure replaceable? |
If you can run integration locally (I personally have not figured it out yet how to), try running it a few hundret times, maybe while creating a bit of load in the background: while true; do GITEA_CONF=tests/sqlite.ini go test -tags sqlite,sqlite_unlock_notify -count=1 -run TestAPIListPinnedIssues ./tests/integration done Otherwise, try adding some debug prints here maybe and run it on the CI. |
About CI failure, I guess it's caused by this line:
Sometimes you get a plain issue, sometimes you get a PR issue (IsPullRequest=true), database doesn't guarantee the result's order if the query is only "SELECT" without "ORDER BY" -> Test query must have order by explicilty to avoid unstable results #24963 And I can see there are also some (unrelated to the failure) bugs in old code, eg: // If we don't do this, it will crash when trying to add the unpin event to the comment history
err = issue.LoadRepo(ctx)
if err != nil {
ctx.Error(http.StatusInternalServerError, "LoadRepo", err)
// FIXME: return here
}
err = issue.Unpin(ctx, ctx.Doer)
if err != nil {
ctx.Error(http.StatusInternalServerError, "UnpinIssue", err)
// FIXME: return here
}
ctx.Status(http.StatusNoContent) |
It is really weird, that the test suite gives |
See my comment above, there are more than one issue records for
#24963 will fix this problem for all tests, including this TestAPIListPinnedIssues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Two nits:
log.Error(err.Error())
could be improved tolog.Error("{detailed message}: %v", err)
, to provide more useful information in log.- And
log.Error(userString)
is not right in some cases, if there is a%
inuserString
, it breaks the formatter.
- And
, IsPull: false
could be reverted to before, because by default IsPull is false, this statement is a no-op.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I had to guess, there are still some routes that don't handle the case "issue cannot pinned as too many are pinned" correctly.
Either way, I can accept this PR as it is now.
Need to run |
All requested changes have been done!
Why do I forget this so often? |
* upstream/main: Remove the service worker (go-gitea#25010) Add user level action runners (go-gitea#24995) Update github.com/google/go-github to v52 (go-gitea#24004) various style fixes (go-gitea#25008) Add show timestamp/seconds and fullscreen options to action page (go-gitea#24876) Fix markdown link to awesome gitea (go-gitea#25009) Followup to pinned Issues (go-gitea#24945) revert the removed method to fix tmpl break on graph page (go-gitea#25005) Refactor diffFileInfo / DiffTreeStore (go-gitea#24998) Fix delete user account modal (go-gitea#25004) Clean up github actions (go-gitea#24984)
This addressees some things from #24406 that came up after the PR was merged. Mostly from @delvh.