-
-
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
tests: add coverage for models migration helpers #18162
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lunny
approved these changes
Jan 3, 2022
GiteaBot
added
the
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
label
Jan 3, 2022
wxiaoguang
reviewed
Jan 3, 2022
If they are not set, Incr("num_closed_issues") will be a noop because the field is null. The would be the case for instance in models/migrate.go [xorm] [info] 2021/12/30 21:38:05.370805 [SQL] UPDATE `milestone` SET `num_issues` = `num_issues` + ?, `num_closed_issues` = `num_closed_issues` + ? WHERE `id`=? [1 1 1] Signed-off-by: Loïc Dachary <loic@dachary.org>
The num_comment field is only about the comments of type CommentTypeComment, i.e. 0. Signed-off-by: Loïc Dachary <loic@dachary.org>
They were previously not covered at all, either by integration tests or unit tests. https://app.codecov.io/gh/go-gitea/gitea/blob/main/models/migrate.go Signed-off-by: Loïc Dachary <loic@dachary.org>
realaravinth
force-pushed
the
forgefriends-mr-31
branch
from
January 3, 2022 14:33
0eca2a3
to
e2eb422
Compare
wxiaoguang
approved these changes
Jan 3, 2022
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
Jan 3, 2022
wxiaoguang
approved these changes
Jan 3, 2022
@wxiaoguang thanks for the merge and for getting rid of the unecessary |
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Jan 4, 2022
* giteaoffical/main: (22 commits) Add MP4 as default allowed attachment type (go-gitea#18170) [skip ci] Updated translations via Crowdin Include folders into size cost (go-gitea#18158) Don't delete branch if other PRs with this branch are open (go-gitea#18164) Remove unused route "/tasks/trigger" (go-gitea#18160) Fix EasyMDE validation (go-gitea#18161) Fix bug (go-gitea#18168) tests: add coverage for models migration helpers (go-gitea#18162) [skip ci] Updated translations via Crowdin Require codereview to have content (go-gitea#18156) chore(lint): use golangci-lint to call revive and misspell checker. (go-gitea#18145) Update owners for 2022 (go-gitea#18155) Refactor auth package (go-gitea#17962) Unify and simplify TrN for i18n (go-gitea#18141) Use correct user when determining max repo limits for error messages (go-gitea#18153) Add singuliere to MAINTAINERS (go-gitea#18148) [skip ci] Updated licenses and gitignores Add API to get issue/pull comments and events (timeline) (go-gitea#17403) Upgrade certmagic from v0.14.1 to v0.15.2 (go-gitea#18138) Upgrade certmagic from v0.14.1 to v0.15.2 (go-gitea#18138) ...
Chianina
pushed a commit
to Chianina/gitea
that referenced
this pull request
Mar 28, 2022
They were previously not covered at all, either by integration tests or unit tests. This PR also fixes a bug where the `num_comments` field was incorrectly set to include all types of comments. It sets num_closed_issues: 0 as default in milestone unit test fixtures. If they are not set, Incr("num_closed_issues") will be a noop because the field is null.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
They were previously not covered at all, either by integration tests
or unit tests.
https://app.codecov.io/gh/go-gitea/gitea/blob/main/models/migrate.go
It fixes a bug where the
num_comments
field was incorrectly set to include all types of comments.It also sets num_closed_issues: 0 as default in milestone fixtures. If they are not set, Incr("num_closed_issues") will be a noop because the field is null.
The would be the case for instance in models/migrate.go
[xorm] [info] 2021/12/30 21:38:05.370805 [SQL] UPDATE
milestone
SETnum_issues
=num_issues
+ ?,num_closed_issues
source: https://lab.forgefriends.org/forgefriends/forgefriends/-/merge_requests/31