-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add more test for login links and fix a bug on action retrieve #2361
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
Conversation
models/action.go
Outdated
@@ -735,7 +735,7 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) { | |||
|
|||
if opts.Collaborate { | |||
cond = builder.Eq{"user_id": opts.RequestedUser.ID}.Or( | |||
builder.Expr(`repo_id IN (SELECT repo_id FROM "access" WHERE access.user_id = ?)`, opts.RequestedUser.ID)) | |||
builder.Expr("repo_id IN (SELECT repo_id FROM `access` WHERE access.user_id = ?)", opts.RequestedUser.ID)) |
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.
Why such change in this PR?
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 find this bug via these tests.
There are conflicts now |
2f32ead
to
cb73d0e
Compare
@lafriks rebased now. |
LGTM |
Integration test failed |
cb73d0e
to
19ddfd0
Compare
LGTM |
} | ||
|
||
reqAPI := NewRequestf(t, "GET", "/api/v1/users/%s/repos", userName) | ||
respAPI := MakeRequest(t, reqAPI, http.StatusOK) |
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.
Shouldn't be here session.MakeRequest
?
|
||
for _, repo := range apiRepos { | ||
for _, link := range repoLinks { | ||
req := NewRequest(t, "GET", fmt.Sprintf("/%s/%s%s", userName, repo.Name, link)) |
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.
NewRequestf
instead of fmt.Sprintf
?
The issue filter links should not be crawled by search engines, because they they only filter results, and contain nothing new, yet, they put a considerable load on the server. To stop - well behaving - search engines from following these links, add a `rel="nofollow"` property to them. The same property is already present on the archive download links, and plenty of other places. Fixes go-gitea#2361. Signed-off-by: Gergely Nagy <[email protected]>
As title.