-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix some trivial problems and TODOs (#33473)
1. Fix incorrect `MentionCount` (actually it seems to be deadcode, affects nothing) 2. Remove fallback sha1 support for time limit token 3. Use route middleware `reqRepoActionsWriter` for `ArtifactsDeleteView` 4. Use clearer message "Failed to authenticate user" instead of "Verify" when auth fails 5. `tests/integration/benchmarks_test.go` is not quite right, actually it is never used, so delete it. 6. Remove or update TODO comments
- Loading branch information
1 parent
34692a2
commit 5dddcc1
Showing
10 changed files
with
18 additions
and
104 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ func TestComposeIssueCommentMessage(t *testing.T) { | |
|
||
recipients := []*user_model.User{{Name: "Test", Email: "[email protected]"}, {Name: "Test2", Email: "[email protected]"}} | ||
msgs, err := composeIssueCommentMessages(&mailCommentContext{ | ||
Context: context.TODO(), // TODO: use a correct context | ||
Context: context.TODO(), | ||
Issue: issue, Doer: doer, ActionType: activities_model.ActionCommentIssue, | ||
Content: fmt.Sprintf("test @%s %s#%d body", doer.Name, issue.Repo.FullName(), issue.Index), | ||
Comment: comment, | ||
|
@@ -131,7 +131,7 @@ func TestComposeIssueMessage(t *testing.T) { | |
|
||
recipients := []*user_model.User{{Name: "Test", Email: "[email protected]"}, {Name: "Test2", Email: "[email protected]"}} | ||
msgs, err := composeIssueCommentMessages(&mailCommentContext{ | ||
Context: context.TODO(), // TODO: use a correct context | ||
Context: context.TODO(), | ||
Issue: issue, Doer: doer, ActionType: activities_model.ActionCreateIssue, | ||
Content: "test body", | ||
}, "en-US", recipients, false, "issue create") | ||
|
@@ -178,14 +178,14 @@ func TestTemplateSelection(t *testing.T) { | |
} | ||
|
||
msg := testComposeIssueCommentMessage(t, &mailCommentContext{ | ||
Context: context.TODO(), // TODO: use a correct context | ||
Context: context.TODO(), | ||
Issue: issue, Doer: doer, ActionType: activities_model.ActionCreateIssue, | ||
Content: "test body", | ||
}, recipients, false, "TestTemplateSelection") | ||
expect(t, msg, "issue/new/subject", "issue/new/body") | ||
|
||
msg = testComposeIssueCommentMessage(t, &mailCommentContext{ | ||
Context: context.TODO(), // TODO: use a correct context | ||
Context: context.TODO(), | ||
Issue: issue, Doer: doer, ActionType: activities_model.ActionCommentIssue, | ||
Content: "test body", Comment: comment, | ||
}, recipients, false, "TestTemplateSelection") | ||
|
@@ -194,14 +194,14 @@ func TestTemplateSelection(t *testing.T) { | |
pull := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{ID: 2, Repo: repo, Poster: doer}) | ||
comment = unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{ID: 4, Issue: pull}) | ||
msg = testComposeIssueCommentMessage(t, &mailCommentContext{ | ||
Context: context.TODO(), // TODO: use a correct context | ||
Context: context.TODO(), | ||
Issue: pull, Doer: doer, ActionType: activities_model.ActionCommentPull, | ||
Content: "test body", Comment: comment, | ||
}, recipients, false, "TestTemplateSelection") | ||
expect(t, msg, "pull/comment/subject", "pull/comment/body") | ||
|
||
msg = testComposeIssueCommentMessage(t, &mailCommentContext{ | ||
Context: context.TODO(), // TODO: use a correct context | ||
Context: context.TODO(), | ||
Issue: issue, Doer: doer, ActionType: activities_model.ActionCloseIssue, | ||
Content: "test body", Comment: comment, | ||
}, recipients, false, "TestTemplateSelection") | ||
|
@@ -220,7 +220,7 @@ func TestTemplateServices(t *testing.T) { | |
|
||
recipients := []*user_model.User{{Name: "Test", Email: "[email protected]"}} | ||
msg := testComposeIssueCommentMessage(t, &mailCommentContext{ | ||
Context: context.TODO(), // TODO: use a correct context | ||
Context: context.TODO(), | ||
Issue: issue, Doer: doer, ActionType: actionType, | ||
Content: "test body", Comment: comment, | ||
}, recipients, fromMention, "TestTemplateServices") | ||
|
@@ -263,7 +263,7 @@ func testComposeIssueCommentMessage(t *testing.T, ctx *mailCommentContext, recip | |
func TestGenerateAdditionalHeaders(t *testing.T) { | ||
doer, _, issue, _ := prepareMailerTest(t) | ||
|
||
ctx := &mailCommentContext{Context: context.TODO() /* TODO: use a correct context */, Issue: issue, Doer: doer} | ||
ctx := &mailCommentContext{Context: context.TODO(), Issue: issue, Doer: doer} | ||
recipient := &user_model.User{Name: "test", Email: "[email protected]"} | ||
|
||
headers := generateAdditionalHeaders(ctx, "dummy-reason", recipient) | ||
|
This file was deleted.
Oops, something went wrong.