From 5c5cfd6b18e48520af8799f602ef75746b1f11e1 Mon Sep 17 00:00:00 2001 From: mlpo Date: Mon, 3 May 2021 04:43:08 +0200 Subject: [PATCH 001/379] Improve Light Chroma style (#15699) * Improve Light Chroma style * Light Chroma style: avoid close colors Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick --- web_src/less/chroma/light.less | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/web_src/less/chroma/light.less b/web_src/less/chroma/light.less index 4cd1c1d4259d..9e8cb590522e 100644 --- a/web_src/less/chroma/light.less +++ b/web_src/less/chroma/light.less @@ -25,20 +25,20 @@ .chroma .vc { color: #008080; } /* NameVariableClass */ .chroma .vg { color: #008080; } /* NameVariableGlobal */ .chroma .vi { color: #008080; } /* NameVariableInstance */ -.chroma .s { color: #032f62; } /* LiteralString */ -.chroma .sa { color: #032f62; } /* LiteralStringAffix */ -.chroma .sb { color: #032f62; } /* LiteralStringBacktick */ -.chroma .sc { color: #032f62; } /* LiteralStringChar */ -.chroma .dl { color: #032f62; } /* LiteralStringDelimiter */ -.chroma .sd { color: #032f62; } /* LiteralStringDoc */ -.chroma .s2 { color: #032f62; } /* LiteralStringDouble */ -.chroma .se { color: #032f62; } /* LiteralStringEscape */ -.chroma .sh { color: #032f62; } /* LiteralStringHeredoc */ -.chroma .si { color: #032f62; } /* LiteralStringInterpol */ -.chroma .sx { color: #032f62; } /* LiteralStringOther */ +.chroma .s { color: #106303; } /* LiteralString */ +.chroma .sa { color: #106303; } /* LiteralStringAffix */ +.chroma .sb { color: #106303; } /* LiteralStringBacktick */ +.chroma .sc { color: #106303; } /* LiteralStringChar */ +.chroma .dl { color: #106303; } /* LiteralStringDelimiter */ +.chroma .sd { color: #106303; } /* LiteralStringDoc */ +.chroma .s2 { color: #106303; } /* LiteralStringDouble */ +.chroma .se { color: #106303; } /* LiteralStringEscape */ +.chroma .sh { color: #106303; } /* LiteralStringHeredoc */ +.chroma .si { color: #106303; } /* LiteralStringInterpol */ +.chroma .sx { color: #106303; } /* LiteralStringOther */ .chroma .sr { color: #22863a; } /* LiteralStringRegex */ -.chroma .s1 { color: #24292e; } /* LiteralStringSingle */ -.chroma .ss { color: #032f62; } /* LiteralStringSymbol */ +.chroma .s1 { color: #cc7a00; } /* LiteralStringSingle */ +.chroma .ss { color: #106303; } /* LiteralStringSymbol */ .chroma .m { color: #009999; } /* LiteralNumber */ .chroma .mb { color: #009999; } /* LiteralNumberBin */ .chroma .mf { color: #009999; } /* LiteralNumberFloat */ From d11b9fbcce2245592b3f1ebce6766b48fa1422b7 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 3 May 2021 17:16:59 +0100 Subject: [PATCH 002/379] Prevent race in TestChannelQueue_Batch (#15703) There is a potential race in TestChannelQueue_Batch due to boost workers starting up This PR simply removes the boosts from this test. Signed-off-by: Andrew Thornton --- modules/queue/queue_channel_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/queue/queue_channel_test.go b/modules/queue/queue_channel_test.go index 08a64c0ab86c..bca81d50fdae 100644 --- a/modules/queue/queue_channel_test.go +++ b/modules/queue/queue_channel_test.go @@ -68,9 +68,9 @@ func TestChannelQueue_Batch(t *testing.T) { WorkerPoolConfiguration: WorkerPoolConfiguration{ QueueLength: 20, BatchLength: 2, - BlockTimeout: 1 * time.Second, - BoostTimeout: 5 * time.Minute, - BoostWorkers: 5, + BlockTimeout: 0, + BoostTimeout: 0, + BoostWorkers: 0, MaxWorkers: 10, }, Workers: 1, From 1b017fe7ca9df5a8c7d7823a1ded897fc324f9d3 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 3 May 2021 18:24:24 +0100 Subject: [PATCH 003/379] Fix setting redis db path (#15698) There is a bug setting the redis db in the common nosql manager whereby the db path always fails. This PR fixes this. Signed-off-by: Andrew Thornton --- modules/nosql/manager_redis.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nosql/manager_redis.go b/modules/nosql/manager_redis.go index d754a0e07d9c..b4852cecc849 100644 --- a/modules/nosql/manager_redis.go +++ b/modules/nosql/manager_redis.go @@ -152,7 +152,7 @@ func (m *Manager) GetRedisClient(connection string) redis.UniversalClient { opts.Addrs = append(opts.Addrs, strings.Split(uri.Host, ",")...) } if uri.Path != "" { - if db, err := strconv.Atoi(uri.Path); err == nil { + if db, err := strconv.Atoi(uri.Path[1:]); err == nil { opts.DB = db } } @@ -168,7 +168,7 @@ func (m *Manager) GetRedisClient(connection string) redis.UniversalClient { opts.Addrs = append(opts.Addrs, strings.Split(uri.Host, ",")...) } if uri.Path != "" { - if db, err := strconv.Atoi(uri.Path); err == nil { + if db, err := strconv.Atoi(uri.Path[1:]); err == nil { opts.DB = db } } @@ -186,7 +186,7 @@ func (m *Manager) GetRedisClient(connection string) redis.UniversalClient { opts.Addrs = append(opts.Addrs, strings.Split(uri.Host, ",")...) } if uri.Path != "" { - if db, err := strconv.Atoi(uri.Path); err == nil { + if db, err := strconv.Atoi(uri.Path[1:]); err == nil { opts.DB = db } } From 5e047b9bd7ba4bfa1c1ae3683eabe7e290de5728 Mon Sep 17 00:00:00 2001 From: Jonathan Tran Date: Mon, 3 May 2021 13:27:48 -0400 Subject: [PATCH 004/379] Add compare tag dropdown to releases page (#15695) * Add compare tag dropdown to releases page * Change defaults to be more intuitive and remove unneeded option * Fix to select branch on releases page Co-authored-by: Jonathan Tran Co-authored-by: Kyle D --- options/locale/locale_en-US.ini | 2 + routers/repo/release.go | 12 +++++ templates/repo/branch_dropdown.tmpl | 78 +++++++++++++++++------------ templates/repo/commits.tmpl | 2 +- templates/repo/home.tmpl | 2 +- templates/repo/release/list.tmpl | 1 + web_src/js/index.js | 3 +- web_src/less/_repository.less | 14 +++++- 8 files changed, 78 insertions(+), 36 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 25b0a1b0bd33..69923ebb8375 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -855,6 +855,7 @@ branch = Branch tree = Tree clear_ref = `Clear current reference` filter_branch_and_tag = Filter branch or tag +find_tag = Find tag branches = Branches tags = Tags issues = Issues @@ -1913,6 +1914,7 @@ release.new_release = New Release release.draft = Draft release.prerelease = Pre-Release release.stable = Stable +release.compare = Compare release.edit = edit release.ahead.commits = %d commits release.ahead.target = to %s since this release diff --git a/routers/repo/release.go b/routers/repo/release.go index abce3e9ac1a2..6b0b92743d44 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -70,6 +70,11 @@ func TagsList(ctx *context.Context) { func releasesOrTags(ctx *context.Context, isTagList bool) { ctx.Data["PageIsReleaseList"] = true ctx.Data["DefaultBranch"] = ctx.Repo.Repository.DefaultBranch + ctx.Data["IsViewBranch"] = false + ctx.Data["IsViewTag"] = true + // Disable the showCreateNewBranch form in the dropdown on this page. + ctx.Data["CanCreateBranch"] = false + ctx.Data["HideBranchesInDropdown"] = true if isTagList { ctx.Data["Title"] = ctx.Tr("repo.release.tags") @@ -79,6 +84,13 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { ctx.Data["PageIsTagList"] = false } + tags, err := ctx.Repo.GitRepo.GetTags() + if err != nil { + ctx.ServerError("GetTags", err) + return + } + ctx.Data["Tags"] = tags + writeAccess := ctx.Repo.CanWrite(models.UnitTypeReleases) ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index ca805fa5877d..3fd461c64f2f 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -1,64 +1,78 @@ -
-