-
-
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
Replace 'userxx' with 'orgxx' in all test files when the user type is org #27052
Conversation
models/fixtures/user.yml
Outdated
lower_name: user6 | ||
name: user6 | ||
lower_name: org6 | ||
name: org6 | ||
full_name: User Six |
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.
Shoudn't we change this too for consistency.
full_name: User Six | |
full_name: Org Six |
I like these changes, we need more unit test cases in Gitea. Appreciated for your initiate.
I will take a closer look today. Could you please wait for my review. If it is on priority you can go ahead and merge after other maintainers approvals.
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.
Furture related :- Could you slice this PR into multiple Pr. easy for me to keep track of changes, Thare are 90+ files. So.
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.
Thanks for your patient review. As I mentioned in the PR information, there are only three non-trivial changes that are not 'find and replace' in IDE. I don't think this can break into different parts because it's weird that both 'user3' and 'org3' are referred to the same user.
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.
Shoudn't we change this too for consistency.
I like these changes, we need more unit test cases in Gitea. Appreciated for your initiate. I will take a closer look today. Could you please wait for my review. If it is on priority you can go ahead and merge after other maintainers approvals.
Not in a rush. Take your time 👍
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.
I don't think this can break into different parts because it's weird that both 'user3' and 'org3' are referred to the same user.
You can use git blame to root this.
models/issues/issue_search.go
Outdated
maxReview := builder.Select("MAX(r.id)"). | ||
From("review as r"). | ||
Where(builder.In("review.type", []ReviewType{ReviewTypeApprove, ReviewTypeReject, ReviewTypeRequest})) | ||
|
||
subQuery := builder.Select("review.issue_id"). | ||
From("review"). | ||
Where(builder.And( | ||
builder.In("review.type", []ReviewType{ReviewTypeRequest, ReviewTypeReject, ReviewTypeApprove}), | ||
builder.Eq{"review.type": ReviewTypeRequest}, |
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.
Heads up, when doing changes in queries.
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.
Thanks for your review. Those are from my other PR and I accidentally mixed them up.
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.
Could you point all of your PRs I can go one by one.
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.
Never mind. I already deleted this.
Does it required backport? |
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.
LGTM if tests pass
|
This fix (cdbfb2e) is because when getting all orgs from API, the result is ordered by alphabet asc, and the test compares the first org full name. The older name |
* giteaofficial/main: Display all user types and org types on admin management UI (go-gitea#27050) Apply lng2020 to maintainers (go-gitea#27068) Fix incorrect default branch label while switching between branches (go-gitea#27053) set version in snapcraft yaml Replace 'userxx' with 'orgxx' in all test files when the user type is org (go-gitea#27052) [skip ci] Updated translations via Crowdin Load reviewer before sending notification (go-gitea#27063) bump all nightly builds to 16gb Show the repo count in code tab on both user profile and org page. (go-gitea#27048) Fix Fomantic's line-height causing vertical scrollbars to appear (go-gitea#26961) Dashboard context dropdown position fix on landing page in mobile view. (go-gitea#27047)
Currently 'userxx' and 'orgxx' are both used as username in test files when the user type is org, which is confusing. This PR replaces all 'userxx' with 'orgxx' when the user type is org(
user.type==1
).Some non-trivial changes
user3
dir toorg3
intests/git-repositories-meta
end
inissue reference
because 'org3' is one char shorter than 'user3'user/repo2
becauseuser3/repo21
can't be searched noworg 17
is beforeorg25
Other modifications are just find all and replace all.
Unit tests with SQLite are all passed.