Skip to content

Commit b5842ea

Browse files
authored
Merge branch 'master' into benchmark_tests
2 parents 20fed13 + f2715b8 commit b5842ea

File tree

167 files changed

+4535
-3357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+4535
-3357
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ audit=false
22
fund=false
33
package-lock=true
44
save-exact=true
5+
cache=.npm-cache

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,11 +671,11 @@ npm-cache: .npm-cache $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui
671671

672672
.npm-cache: package-lock.json
673673
rm -rf .npm-cache
674-
$(eval ESBUILD_VERSION := `node -p "require('./package-lock.json').dependencies.esbuild.version"`)
674+
$(eval ESBUILD_VERSION := $(shell node -p "require('./package-lock.json').dependencies.esbuild.version"))
675675
npm config --userconfig=.npmrc set cache=.npm-cache
676676
rm -rf node_modules && npm install --no-save
677677
npm config --userconfig=$(FOMANTIC_WORK_DIR)/.npmrc set cache=../../.npm-cache
678-
echo esbuild-{darwin-64,linux-{arm,arm64,32,64},windows-{32,64}}@$(ESBUILD_VERSION) | tr " " "\n" | xargs -n 1 -P 4 npm cache add
678+
echo $(foreach build, darwin-64 $(foreach arch,arm arm64 32 64,linux-${arch}) $(foreach arch,32 64,windows-${arch}), esbuild-${build}@$(ESBUILD_VERSION)) | tr " " "\n" | xargs -n 1 -P 4 npm cache add
679679
rm -rf $(FOMANTIC_WORK_DIR)/node_modules
680680
@touch .npm-cache
681681

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ require (
8686
github.com/mgechev/revive v1.0.3
8787
github.com/mholt/acmez v0.1.3 // indirect
8888
github.com/mholt/archiver/v3 v3.5.0
89-
github.com/microcosm-cc/bluemonday v1.0.4
89+
github.com/microcosm-cc/bluemonday v1.0.5
9090
github.com/miekg/dns v1.1.40 // indirect
9191
github.com/minio/md5-simd v1.1.2 // indirect
9292
github.com/minio/minio-go/v7 v7.0.10
@@ -136,9 +136,9 @@ require (
136136
go.uber.org/multierr v1.6.0 // indirect
137137
go.uber.org/zap v1.16.0 // indirect
138138
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
139-
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
139+
golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c
140140
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93
141-
golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46
141+
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44
142142
golang.org/x/text v0.3.5
143143
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
144144
golang.org/x/tools v0.1.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,8 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY
13211321
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
13221322
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
13231323
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
1324-
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
1325-
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
1324+
golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c h1:KHUzaHIpjWVlVVNh65G3hhuj3KB1HnjY6Cq5cTvRQT8=
1325+
golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
13261326
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
13271327
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
13281328
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1418,8 +1418,8 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w
14181418
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
14191419
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
14201420
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
1421-
golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46 h1:V066+OYJ66oTjnhm4Yrn7SXIwSCiDQJxpBxmvqb1N1c=
1422-
golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
1421+
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/BESIg2ze4Pgfh/aI8c=
1422+
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
14231423
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
14241424
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
14251425
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=

integrations/attachment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func TestGetAttachment(t *testing.T) {
122122
t.Run(tc.name, func(t *testing.T) {
123123
//Write empty file to be available for response
124124
if tc.createFile {
125-
_, err := storage.Attachments.Save(models.AttachmentRelativePath(tc.uuid), strings.NewReader("hello world"))
125+
_, err := storage.Attachments.Save(models.AttachmentRelativePath(tc.uuid), strings.NewReader("hello world"), -1)
126126
assert.NoError(t, err)
127127
}
128128
//Actual test

models/attachment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (a *Attachment) LinkedRepository() (*Repository, UnitType, error) {
8585
func NewAttachment(attach *Attachment, buf []byte, file io.Reader) (_ *Attachment, err error) {
8686
attach.UUID = gouuid.New().String()
8787

88-
size, err := storage.Attachments.Save(attach.RelativePath(), io.MultiReader(bytes.NewReader(buf), file))
88+
size, err := storage.Attachments.Save(attach.RelativePath(), io.MultiReader(bytes.NewReader(buf), file), -1)
8989
if err != nil {
9090
return nil, fmt.Errorf("Create: %v", err)
9191
}

models/user.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,6 @@ func (u *User) GenerateEmailActivateCode(email string) string {
331331
return code
332332
}
333333

334-
// GenerateActivateCode generates an activate code based on user information.
335-
func (u *User) GenerateActivateCode() string {
336-
return u.GenerateEmailActivateCode(u.Email)
337-
}
338-
339334
// GetFollowers returns range of user's followers.
340335
func (u *User) GetFollowers(listOptions ListOptions) ([]*User, error) {
341336
sess := x.

modules/lfs/content_store.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,21 @@ func (s *ContentStore) Get(meta *models.LFSMetaObject, fromByte int64) (io.ReadC
5353
}
5454
if fromByte > 0 {
5555
if fromByte >= meta.Size {
56+
err = f.Close()
57+
if err != nil {
58+
log.Error("Whilst trying to read LFS OID[%s]: Unable to close Error: %v", meta.Oid, err)
59+
}
5660
return nil, ErrRangeNotSatisfiable{
5761
FromByte: fromByte,
5862
}
5963
}
6064
_, err = f.Seek(fromByte, io.SeekStart)
6165
if err != nil {
6266
log.Error("Whilst trying to read LFS OID[%s]: Unable to seek to %d Error: %v", meta.Oid, fromByte, err)
67+
errClose := f.Close()
68+
if errClose != nil {
69+
log.Error("Whilst trying to read LFS OID[%s]: Unable to close Error: %v", meta.Oid, errClose)
70+
}
6371
}
6472
}
6573
return f, err
@@ -74,7 +82,7 @@ func (s *ContentStore) Put(meta *models.LFSMetaObject, r io.Reader) error {
7482

7583
// now pass the wrapped reader to Save - if there is a size mismatch or hash mismatch then
7684
// the errors returned by the newHashingReader should percolate up to here
77-
written, err := s.Save(p, wrappedRd)
85+
written, err := s.Save(p, wrappedRd, meta.Size)
7886
if err != nil {
7987
log.Error("Whilst putting LFS OID[%s]: Failed to copy to tmpPath: %s Error: %v", meta.Oid, p, err)
8088
return err

modules/migrations/gitea_uploader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error {
283283
}
284284
}
285285
defer rc.Close()
286-
_, err = storage.Attachments.Save(attach.RelativePath(), rc)
286+
_, err = storage.Attachments.Save(attach.RelativePath(), rc, int64(*asset.Size))
287287
return err
288288
}()
289289
if err != nil {

modules/notification/mail/mail.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ func (m *mailNotifier) NotifyIssueChangeAssignee(doer *models.User, issue *model
104104
// mail only sent to added assignees and not self-assignee
105105
if !removed && doer.ID != assignee.ID && assignee.EmailNotifications() == models.EmailNotificationsEnabled {
106106
ct := fmt.Sprintf("Assigned #%d.", issue.Index)
107-
mailer.SendIssueAssignedMail(issue, doer, ct, comment, []string{assignee.Email})
107+
mailer.SendIssueAssignedMail(issue, doer, ct, comment, []*models.User{assignee})
108108
}
109109
}
110110

111111
func (m *mailNotifier) NotifyPullReviewRequest(doer *models.User, issue *models.Issue, reviewer *models.User, isRequest bool, comment *models.Comment) {
112112
if isRequest && doer.ID != reviewer.ID && reviewer.EmailNotifications() == models.EmailNotificationsEnabled {
113113
ct := fmt.Sprintf("Requested to review %s.", issue.HTMLURL())
114-
mailer.SendIssueAssignedMail(issue, doer, ct, comment, []string{reviewer.Email})
114+
mailer.SendIssueAssignedMail(issue, doer, ct, comment, []*models.User{reviewer})
115115
}
116116
}
117117

@@ -153,7 +153,7 @@ func (m *mailNotifier) NotifyPullRequestPushCommits(doer *models.User, pr *model
153153
}
154154

155155
func (m *mailNotifier) NotifyPullRevieweDismiss(doer *models.User, review *models.Review, comment *models.Comment) {
156-
if err := mailer.MailParticipantsComment(comment, models.ActionPullReviewDismissed, review.Issue, []*models.User{}); err != nil {
156+
if err := mailer.MailParticipantsComment(comment, models.ActionPullReviewDismissed, review.Issue, nil); err != nil {
157157
log.Error("MailParticipantsComment: %v", err)
158158
}
159159
}

0 commit comments

Comments
 (0)