]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoFix broken .comment > .content caused by #13457 (#13482)
Cirno the Strongest [Tue, 10 Nov 2020 01:43:08 +0000 (02:43 +0100)]
Fix broken .comment > .content caused by #13457 (#13482)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix panic bug in handling multiple references in commit (#13486)
zeripath [Mon, 9 Nov 2020 22:57:47 +0000 (22:57 +0000)]
Fix panic bug in handling multiple references in commit (#13486)

* Fix panic bug in handling multiple references in commit

The issue lay in determining the position of matches on a second run round
a commit message in FindAllIssueReferences.

Fix #13483

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Extract function and make testable

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix the comment

Signed-off-by: Andrew Thornton <art27@cantab.net>
* cleaning up the comments a bit more

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 9 Nov 2020 18:22:53 +0000 (18:22 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoChange search and filter icons to SVG (#13473)
silverwind [Mon, 9 Nov 2020 18:21:47 +0000 (19:21 +0100)]
Change search and filter icons to SVG (#13473)

Unfortunately, the Fomantic CSS relies on i.icon instead of .icon so a
wrapper is necessary for these with an accompanying class to center the
icon.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 9 Nov 2020 06:16:15 +0000 (06:16 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoComments on review should have the same sha (#13448)
zeripath [Mon, 9 Nov 2020 06:15:09 +0000 (06:15 +0000)]
Comments on review should have the same sha (#13448)

* When replying to an outdated comment it should not appear on the files page

This happened because the comment took the latest commitID as its base instead of the
reviewID that it was replying to.

There was also no way of creating an already outdated comment - and a
reply to a review on an outdated line should be outdated.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix test

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix broken migration

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix mssql

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Create temporary table because ... well MSSQL ...

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Create temporary table because ... well MSSQL ...

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Create temporary table because ... well MSSQL ...

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix mssql

Signed-off-by: Andrew Thornton <art27@cantab.net>
* move session within the batch

Signed-off-by: Andrew Thornton <art27@cantab.net>
* regen the sqlcmd each time round the loop

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per @lunny

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agodocs(comparison): GitHub Actions (#13474)
Simon Legner [Sun, 8 Nov 2020 22:35:28 +0000 (23:35 +0100)]
docs(comparison): GitHub Actions (#13474)

https://github.com/features/actions

3 years agoMake TestCreateBranch and TestRepoCommitsSearch less noisy (#13471)
zeripath [Sun, 8 Nov 2020 21:24:54 +0000 (21:24 +0000)]
Make TestCreateBranch and TestRepoCommitsSearch less noisy (#13471)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd note about installation on kubernetes to docs (#13469)
techknowlogick [Sun, 8 Nov 2020 20:50:40 +0000 (15:50 -0500)]
Add note about installation on kubernetes to docs (#13469)

Co-authored-by: zeripath <art27@cantab.net>
3 years ago2nd attempt at re-request APIMergePullRequest (#13468)
zeripath [Sun, 8 Nov 2020 19:23:00 +0000 (19:23 +0000)]
2nd attempt at re-request APIMergePullRequest (#13468)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 8 Nov 2020 18:03:03 +0000 (18:03 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoOverride fonts using Fomantic config (#13465)
silverwind [Sun, 8 Nov 2020 18:01:38 +0000 (19:01 +0100)]
Override fonts using Fomantic config (#13465)

Saves is from doing it manually and saves a few CSS bytes.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoMultiple GitGraph improvements: Exclude PR heads, Add branch/PR links, Show only...
zeripath [Sun, 8 Nov 2020 17:21:54 +0000 (17:21 +0000)]
Multiple GitGraph improvements: Exclude PR heads, Add branch/PR links, Show only certain branches, (#12766)

* Multiple GitGraph improvements.

Add backend support for excluding PRs, selecting branches and files.

Fix #10327

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per @silverwind

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per @silverwind

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Only show refs in dropdown we display on the graph

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per @silverwind

Signed-off-by: Andrew Thornton <art27@cantab.net>
* use flexbox for ui header

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move Hide Pull Request button to the dropdown

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add SHA and user pictures

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix test

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix test 2

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fixes

* async

* more tweaks

* use tabs in tmpl

Signed-off-by: Andrew Thornton <art27@cantab.net>
* remove commented thing

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix linting

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update web_src/js/features/gitgraph.js

Co-authored-by: silverwind <me@silverwind.io>
* graph tweaks

* more tweaks

* add title

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix loading indicator z-index and position

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 8 Nov 2020 16:30:44 +0000 (16:30 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix colors and triangles in issues (#13463)
silverwind [Sun, 8 Nov 2020 16:29:18 +0000 (17:29 +0100)]
Fix colors and triangles in issues (#13463)

- Fix misaligned triangles
- Fix triangle and header background colors
- Adjust timeline color

3 years agoFix double border introduced by #13434 (#13457)
Cirno the Strongest [Sat, 7 Nov 2020 23:15:09 +0000 (00:15 +0100)]
Fix double border introduced by #13434 (#13457)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoFrontpage and Heatmap CSS tweaks (#13443)
silverwind [Sat, 7 Nov 2020 21:04:40 +0000 (22:04 +0100)]
Frontpage and Heatmap CSS tweaks (#13443)

* Frontpage and Heatmap CSS tweaks

- Make heatmap use primary color
- Defined secondary color shades
- Set various blue colors to CSS vars
- Misc tweaks

* remove a useless variable

* remove another useless variable

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[RFC] Make archival asynchronous (#11296)
Kyle Evans [Sat, 7 Nov 2020 20:27:28 +0000 (14:27 -0600)]
[RFC] Make archival asynchronous (#11296)

* Make archival asynchronous

The prime benefit being sought here is for large archives to not
clog up the rendering process and cause unsightly proxy timeouts.
As a secondary benefit, archive-in-progress is moved out of the
way into a /tmp file so that new archival requests for the same
commit will not get fulfilled based on an archive that isn't yet
finished.

This asynchronous system is fairly primitive; request comes in, we'll
spawn off a new goroutine to handle it, then we'll mark it as done.
Status requests will see if the file exists in the final location,
and report the archival as done when it exists.

Fixes #11265

* Archive links: drop initial delay to three-quarters of a second

Some, or perhaps even most, archives will not take all that long to archive.
The archive process starts as soon as the download button is initially
clicked, so in theory they could be done quite quickly.  Drop the initial
delay down to three-quarters of a second to make it more responsive in the
common case of the archive being quickly created.

* archiver: restructure a little bit to facilitate testing

This introduces two sync.Cond pointers to the archiver package. If they're
non-nil when we go to process a request, we'll wait until signalled (at all)
to proceed. The tests will then create the sync.Cond so that it can signal
at-will and sanity-check the state of the queue at different phases.

The author believes that nil-checking these two sync.Cond pointers on every
archive processing will introduce minimal overhead with no impact on
maintainability.

* gofmt nit: no space around binary + operator

* services: archiver: appease golangci-lint, lock queueMutex

Locking/unlocking the queueMutex is allowed, but not required, for
Cond.Signal() and Cond.Broadcast().  The magic at play here is just a little
too much for golangci-lint, as we take the address of queueMutex and this is
mostly used in archiver.go; the variable still gets flagged as unused.

* archiver: tests: fix several timing nits

Once we've signaled a cond var, it may take some small amount of time for
the goroutines released to hit the spot we're wanting them to be at. Give
them an appropriate amount of time.

* archiver: tests: no underscore in var name, ungh

* archiver: tests: Test* is run in a separate context than TestMain

We must setup the mutex/cond variables at the beginning of any test that's
going to use it, or else these will be nil when the test is actually ran.

* archiver: tests: hopefully final tweak

Things got shuffled around such that we carefully build up and release
requests from the queue, so we can validate the state of the queue at each
step. Fix some assertions that no longer hold true as fallout.

* repo: Download: restore some semblance of previous behavior

When archival was made async, the GET endpoint was only useful if a previous
POST had initiated the download. This commit restores the previous behavior,
to an extent; we'll now submit the archive request there and return a
"202 Accepted" to indicate that it's processing if we didn't manage to
complete the request within ~2 seconds of submission.

This lets a client directly GET the archive, and gives them some indication
that they may attempt to GET it again at a later time.

* archiver: tests: simplify a bit further

We don't need to risk failure and use time.ParseDuration to get 2 *
time.Second.

else if isn't really necessary if the conditions are simple enough and lead
to the same result.

* archiver: tests: resolve potential source of flakiness

Increase all timeouts to 10 seconds; these aren't hard-coded sleeps, so
there's no guarantee we'll actually take that long. If we need longer to
not have a false-positive, then so be it.

While here, various assert.{Not,}Equal arguments are flipped around so that
the wording in error output reflects reality, where the expected argument is
second and actual third.

* archiver: setup infrastructure for notifying consumers of completion

This API will *not* allow consumers to subscribe to specific requests being
completed, just *any* request being completed. The caller is responsible for
determining if their request is satisfied and waiting again if needed.

* repo: archive: make GET endpoint synchronous again

If the request isn't complete, this endpoint will now submit the request and
wait for completion using the new API. This may still be susceptible to
timeouts for larger repos, but other endpoints now exist that the web
interface will use to negotiate its way through larger archive processes.

* archiver: tests: amend test to include WaitForCompletion()

This is a trivial one, so go ahead and include it.

* archiver: tests: fix test by calling NewContext()

The mutex is otherwise uninitialized, so we need to ensure that we're
actually initializing it if we plan to test it.

* archiver: tests: integrate new WaitForCompletion a little better

We can use this to wait for archives to come in, rather than spinning and
hoping with a timeout.

* archiver: tests: combine numQueued declaration with next-instruction assignment

* routers: repo: reap unused archiving flag from DownloadStatus()

This had some planned usage before, indicating whether this request
initiated the archival process or not. After several rounds of refactoring,
this use was deemed not necessary for much of anything and got boiled down
to !complete in all cases.

* services: archiver: restructure to use a channel

We now offer two forms of waiting for a request:
- WaitForCompletion: wait for completion with no timeout
- TimedWaitForCompletion: wait for completion with timeout

In both cases, we wait for the given request's cchan to close; in the latter
case, we do so with the caller-provided timeout. This completely removes the
need for busy-wait loops in Download/InitiateDownload, as it's fairly clean
to wait on a channel with timeout.

* services: archiver: use defer to unlock now that we can

This previously carried the lock into the goroutine, but an intermediate
step just added the request to archiveInProgress outside of the new
goroutine and removed the need for the goroutine to start out with it.

* Revert "archiver: tests: combine numQueued declaration with next-instruction assignment"

This reverts commit bcc52140238e16680f2e05e448e9be51372afdf5.

Revert "archiver: tests: integrate new WaitForCompletion a little better"

This reverts commit 9fc8bedb5667d24d3a3c7843dc28a229efffb1e6.

Revert "archiver: tests: fix test by calling NewContext()"

This reverts commit 709c35685eaaf261ebbb7d3420e3376a4ee8e7f2.

Revert "archiver: tests: amend test to include WaitForCompletion()"

This reverts commit 75261f56bc05d1fa8ff7e81dcbc0ccd93fdc9d50.

* archiver: tests: first attempt at WaitForCompletion() tests

* archiver: tests: slight improvement, less busy-loop

Just wait for the requests to complete in order, instead of busy-waiting
with a timeout.  This is slightly less fragile.

While here, reverse the arguments of a nearby assert.Equal() so that
expected/actual are correct in any test output.

* archiver: address lint nits

* services: archiver: only close the channel once

* services: archiver: use a struct{} for the wait channel

This makes it obvious that the channel is only being used as a signal,
rather than anything useful being piped through it.

* archiver: tests: fix expectations

Move the close of the channel into doArchive() itself; notably, before these
goroutines move on to waiting on the Release cond.

The tests are adjusted to reflect that we can't WaitForCompletion() after
they've already completed, as WaitForCompletion() doesn't indicate that
they've been released from the queue yet.

* archiver: tests: set cchan to nil for comparison

* archiver: move ctx.Error's back into the route handlers

We shouldn't be setting this in a service, we should just be validating the
request that we were handed.

* services: archiver: use regex to match a hash

This makes sure we don't try and use refName as a hash when it's clearly not
one, e.g. heads/pull/foo.

* routers: repo: remove the weird /archive/status endpoint

We don't need to do this anymore, we can just continue POSTing to the
archive/* endpoint until we're told the download's complete. This avoids a
potential naming conflict, where a ref could start with "status/"

* archiver: tests: bump reasonable timeout to 15s

* archiver: tests: actually release timedReq

* archiver: tests: run through inFlight instead of manually checking

While we're here, add a test for manually re-processing an archive that's
already been complete. Re-open the channel and mark it incomplete, so that
doArchive can just mark it complete again.

* initArchiveLinks: prevent default behavior from clicking

* archiver: alias gitea's context, golang context import pending

* archiver: simplify logic, just reconstruct slices

While the previous logic was perhaps slightly more efficient, the
new variant's readability is much improved.

* archiver: don't block shutdown on waiting for archive

The technique established launches a goroutine to do the wait,
which will close a wait channel upon termination. For the timeout
case, we also send back a value indicating whether the timeout was
hit or not.

The timeouts are expected to be relatively small, but still a multi-
second delay to shutdown due to this could be unfortunate.

* archiver: simplify shutdown logic

We can just grab the shutdown channel from the graceful manager instead of
constructing a channel to halt the caller and/or pass a result back.

* Style issues

* Fix mis-merge

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoUpdate JS dependencies (#13455)
silverwind [Sat, 7 Nov 2020 18:44:47 +0000 (19:44 +0100)]
Update JS dependencies (#13455)

- Update all JS dependencies minus Webpack
- Add postcss again to avoid warnings about missing peerDependencies

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd Vue linting (#13447)
silverwind [Sat, 7 Nov 2020 15:11:09 +0000 (16:11 +0100)]
Add Vue linting (#13447)

* Add Vue linting

Turns out the .vue files were not linted at all, so I added that as well
as re-indented the file to 2-space and fixed all reasonable issues that
cam up except one case of a unintended side effect for which I have no
idea how to fix it, so the rule was disabled.

* misc tweaks

* update lockfile

* use overrides to include .vue files

* treat warnings as errors on lint-frontend

* also treat stylelint warnings as errors

* use equal sign syntax

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 7 Nov 2020 12:55:59 +0000 (12:55 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix monospace font size for .mono CSS class (#13453)
Cirno the Strongest [Sat, 7 Nov 2020 12:54:38 +0000 (13:54 +0100)]
Fix monospace font size for .mono CSS class (#13453)

3 years agoupdateSize when create a repo with init commit (#13441)
a1012112796 [Sat, 7 Nov 2020 04:44:08 +0000 (12:44 +0800)]
updateSize when create a repo with init commit (#13441)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoAdd docs command (#13429)
John Olheiser [Sat, 7 Nov 2020 00:32:57 +0000 (18:32 -0600)]
Add docs command (#13429)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years agoVendor Update Go Libs (#13444)
6543 [Fri, 6 Nov 2020 18:41:42 +0000 (19:41 +0100)]
Vendor Update Go Libs (#13444)

* denisenkom/go-mssqldb untagged -> v0.9.0

* github.com/editorconfig/editorconfig-core-go v2.3.7 -> v2.3.8

* github.com/go-testfixtures/testfixtures v3.4.0 -> v3.4.1

* github.com/mholt/archiver v3.3.2 -> v3.5.0

* github.com/olivere/elastic v7.0.20 -> v7.0.21

* github.com/urfave/cli v1.22.4 -> v1.22.5

* github.com/xanzy/go-gitlab v0.38.1 -> v0.39.0

* github.com/yuin/goldmark-meta untagged -> v1.0.0

* github.com/ethantkoenig/rupture 0a76f03a811a -> c3b3b810dc77

* github.com/jaytaylor/html2text 8fb95d837f7d -> 3577fbdbcff7

* github.com/kballard/go-shellquote cd60e84ee657 -> 95032a82bc51

* github.com/msteinert/pam 02ccfbfaf0cc -> 913b8f8cdf8b

* github.com/unknwon/paginater 7748a72e0141 -> 042474bd0eae

* CI.restart()

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoOverride fomantic monospace fonts and set size (#13435)
silverwind [Fri, 6 Nov 2020 17:16:21 +0000 (18:16 +0100)]
Override fomantic monospace fonts and set size (#13435)

We did not override those yet so default `monospace` was applied. Also
added a tweak to slightly reduce font size because monospace fonts
usually render slightly larger than proportional ones.

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agouse registry mirror for docker-in-docker (#13438)
techknowlogick [Fri, 6 Nov 2020 07:35:10 +0000 (02:35 -0500)]
use registry mirror for docker-in-docker (#13438)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoRevert "Replies to outdated code comments should also be outdated (#13217)" (#13439)
Lunny Xiao [Fri, 6 Nov 2020 07:04:21 +0000 (15:04 +0800)]
Revert "Replies to outdated code comments should also be outdated (#13217)" (#13439)

This reverts commit 3cab3bee5750a12da9ef8a9ba5cbe3da00594921.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 5 Nov 2020 19:35:13 +0000 (19:35 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoRework focused comment styling (#13434)
silverwind [Thu, 5 Nov 2020 19:34:04 +0000 (20:34 +0100)]
Rework focused comment styling (#13434)

Had to tweak a few borders to make it work properly in all cases, also
added .comment-body class to specifically target that body.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 5 Nov 2020 14:21:49 +0000 (14:21 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoTags cleanup (#13428)
John Olheiser [Thu, 5 Nov 2020 14:20:42 +0000 (08:20 -0600)]
Tags cleanup (#13428)

* Tags cleanup

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* fmt

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years agoVarious style tweaks (#13418)
silverwind [Thu, 5 Nov 2020 01:51:17 +0000 (02:51 +0100)]
Various style tweaks (#13418)

- Change code review '+' to SVG and increase size slightly
- Set placeholder color in both themes
- Set proper font for textareas
- Fix black code in arc-green
- Various arc-green fixes

3 years agoAlternative fix for HTML diff entity split (#13425)
mrsdizzie [Thu, 5 Nov 2020 00:35:05 +0000 (19:35 -0500)]
Alternative fix for HTML diff entity split (#13425)

* Alternative fix for HTML diff entity split

This commit both reverts PR #13357 and uses the exiting implementation alredy used for spans to fix the same issue. That PR duplicates most of logic that is already present elsewhere and still was failing for some cases. This should be simpler as it uses the existing logic that already works for <span>s being split apart.

Added both test cases as well.

* Update gitdiff_test.go

* fmt

* entity can have uppercase letter, also add detailed comment per @zeripath

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 4 Nov 2020 22:56:17 +0000 (22:56 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoReplies to outdated code comments should also be outdated (#13217)
zeripath [Wed, 4 Nov 2020 22:55:15 +0000 (22:55 +0000)]
Replies to outdated code comments should also be outdated (#13217)

* When replying to an outdated comment it should not appear on the files page

This happened because the comment took the latest commitID as its base instead of the
reviewID that it was replying to.

There was also no way of creating an already outdated comment - and a
reply to a review on an outdated line should be outdated.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix test

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd missing full names when DEFAULT_SHOW_FULL_NAME is enabled (#13417)
Wim [Wed, 4 Nov 2020 09:11:19 +0000 (10:11 +0100)]
Add missing full names when DEFAULT_SHOW_FULL_NAME is enabled (#13417)

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 4 Nov 2020 07:15:15 +0000 (07:15 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix whitespace rendering in diff (#13415)
silverwind [Wed, 4 Nov 2020 07:14:07 +0000 (08:14 +0100)]
Fix whitespace rendering in diff (#13415)

- Introduce new .code-inner class that sets the CSS attributes on
rendered code lines like view,blame and diff.
- Rename .wrap class to .word-break to reflect what it actually does
- Remove .raw which was only used on webhook page
- Set white-space: pre-wrap except on blame where it can break the
layout

Fixes: https://github.com/go-gitea/gitea/issues/13406
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 3 Nov 2020 15:49:01 +0000 (15:49 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix bug on release publisherid migrations (#13410)
Lunny Xiao [Tue, 3 Nov 2020 15:47:54 +0000 (23:47 +0800)]
Fix bug on release publisherid migrations (#13410)

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 3 Nov 2020 11:36:19 +0000 (11:36 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFixed git args duplication (#13411)
Viktor Suprun [Tue, 3 Nov 2020 11:35:09 +0000 (22:35 +1100)]
Fixed git args duplication (#13411)

Because newGit() invoked twice (inside PreInstallInit() and
GlobalInit()) and git parameters is global object, all
git commands call with duplicated args
`-c credential.helper= -c protocol.version=2`

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 3 Nov 2020 06:05:23 +0000 (06:05 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[Vendor] update macaron related (#13409)
6543 [Tue, 3 Nov 2020 06:04:09 +0000 (07:04 +0100)]
[Vendor] update macaron related (#13409)

* Vendor: update gitea.com/macaron/session to a177a270

* make vendor

* Vendor: update gitea.com/macaron/macaron to 0db5d458

* make vendor

* Vendor: update gitea.com/macaron/cache to 905232fb

* make vendor

* Vendor: update gitea.com/macaron/i18n to 4ca3dd0c

* make vendor

* Vendor: update gitea.com/macaron/gzip to efa5e847

* make vendor

* Vendor: update gitea.com/macaron/captcha to e8597820

* make vendor

3 years agoAdd the tag list page to the release page (#12096)
a1012112796 [Mon, 2 Nov 2020 23:10:22 +0000 (07:10 +0800)]
Add the tag list page to the release page (#12096)

* Add the tag list page to the release page

* Add the tags list view
* Add the delete tag way on ui
* Not delete tag and clear message when delete a release

Signed-off-by: a1012112796 <1012112796@qq.com>
* Apply suggestions from code review

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
* fix ui

* Add to header

* ui

* permission

* ui

* Update options/locale/locale_en-US.ini

Co-authored-by: Lauris BH <lauris@nix.lv>
* tweaks

* monospace commit hashes

* Add read permission check

* fix permission

* fix nit

* Update web_src/less/_base.less

Co-authored-by: silverwind <me@silverwind.io>
* ui fixes

* title tweaks

* fix lint

* fix test

* fix test and some ui nits

* Apply suggestions from code review

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: silverwind <me@silverwind.io>
3 years agofix docker rootless manifest (#13386)
Antoine GIRARD [Mon, 2 Nov 2020 19:50:13 +0000 (20:50 +0100)]
fix docker rootless manifest (#13386)

3 years agoRefactor image paste code (#13354)
silverwind [Mon, 2 Nov 2020 17:08:30 +0000 (18:08 +0100)]
Refactor image paste code (#13354)

Some minor refactors I did while investigating another issue.
Functionalily should be pretty much the same as before.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 2 Nov 2020 15:59:27 +0000 (15:59 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix 'add code comment' button being invisible all the time (#13389)
Cirno the Strongest [Mon, 2 Nov 2020 15:58:14 +0000 (16:58 +0100)]
Fix 'add code comment' button being invisible all the time (#13389)

* Fix 'add code comment' button being invisible all the time

* Fix off-center icon

* Remove old JS hover hack

* Show on full-line hover

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix reactions on code comments (#13390)
Cirno the Strongest [Mon, 2 Nov 2020 08:56:02 +0000 (09:56 +0100)]
Fix reactions on code comments (#13390)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoRemove specific indexer path (#13388)
Antoine GIRARD [Sun, 1 Nov 2020 23:34:38 +0000 (00:34 +0100)]
Remove specific indexer path (#13388)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 1 Nov 2020 20:05:29 +0000 (20:05 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMisc UI fixes, add secondary color (#13378)
silverwind [Sun, 1 Nov 2020 20:04:26 +0000 (21:04 +0100)]
Misc UI fixes, add secondary color (#13378)

* Misc UI fixes, add secondary color

- Add secondary color, primarily used in arc-green currently
- Convert icons on release page to SVG
- Improve resolved conversation placeholder
- Diff fixes on arc-green
- Misc color tweaks

* fix comment header, adjust arc-green dropzone

* label margin, sidebar margin

* flexbox commits table and add primary button styles

* tooltip styles

* file header fixes

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoSet auto-tag to false on rootless manifest (#13383)
techknowlogick [Sun, 1 Nov 2020 11:30:01 +0000 (06:30 -0500)]
Set auto-tag to false on rootless manifest (#13383)

Current overrides rootful container

3 years agoFix typo (#13380)
Lunny Xiao [Sun, 1 Nov 2020 02:09:16 +0000 (10:09 +0800)]
Fix typo (#13380)

3 years agodocker: rootless image (#10154)
Antoine GIRARD [Sun, 1 Nov 2020 00:58:22 +0000 (01:58 +0100)]
docker: rootless image (#10154)

* docker: rootless image

* improve docs + remove check for write perm on custom

* add more info on ssh passtrough

* Add comment for internal ssh server in container config

3 years agodon't append key file if asked not to (#13368)
Antoine GIRARD [Sun, 1 Nov 2020 00:57:41 +0000 (01:57 +0100)]
don't append key file if asked not to (#13368)

3 years agoComment box tweaks and SVG dropdown triangles (#13376)
silverwind [Sat, 31 Oct 2020 22:15:11 +0000 (23:15 +0100)]
Comment box tweaks and SVG dropdown triangles (#13376)

* Comment box tweaks and SVG dropdown triangles

- Change all dropdown triangles to SVG
- Bring inline review comment box closer to regular comment boxes
- Enhance arc-green checkbox contrast
- Minor reaction tweaks
- Flexbox the diff file header

* remove a border

* fix type marker in arc-green

* add small code padding

* fix position regression and remove useless rules

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoStorage configuration support `[storage]` (#13314)
Lunny Xiao [Sat, 31 Oct 2020 20:51:48 +0000 (04:51 +0800)]
Storage configuration support `[storage]` (#13314)

* Fix minio bug

* Add tests for storage configuration

* Change the Seek flag to keep compitable minio?

* Fix test when first-byte-pos of all ranges is greater than the resource length

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 31 Oct 2020 17:25:33 +0000 (17:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoWhen creating line diffs do not split within an html entity (#13357)
zeripath [Sat, 31 Oct 2020 17:24:32 +0000 (17:24 +0000)]
When creating line diffs do not split within an html entity (#13357)

* When creating line diffs do not split within an html entity

Fix #13342

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add test case

Signed-off-by: Andrew Thornton <art27@cantab.net>
* improve test

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix a bug on refactoring (#13373)
Lunny Xiao [Sat, 31 Oct 2020 15:42:54 +0000 (23:42 +0800)]
Fix a bug on refactoring (#13373)

3 years agoRevert "Dockerfile: Support socat use cases (#13208)" (#13369)
Antoine GIRARD [Sat, 31 Oct 2020 13:19:41 +0000 (14:19 +0100)]
Revert "Dockerfile: Support socat use cases (#13208)" (#13369)

This reverts commit ff50274ff34e4342d8f6b9470345a1df341d8428.

3 years agoComment Header fixes (#13356)
silverwind [Sat, 31 Oct 2020 13:17:52 +0000 (14:17 +0100)]
Comment Header fixes (#13356)

Apply more flexboxes on comment header and remove float hacks. Needs
1.13 backport.

Fixes: https://github.com/go-gitea/gitea/issues/13316
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 31 Oct 2020 12:18:38 +0000 (12:18 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoVarious style fixes (#13372)
silverwind [Sat, 31 Oct 2020 12:17:32 +0000 (13:17 +0100)]
Various style fixes (#13372)

- Add alpha variants for primary color
- Make timeline items solid background color
- Fix reaction styles recently regressed
- Fix diff header and make it flexbox
- Numerous smaller fixes for arc green

3 years agoRefactor Logger (#13294)
zeripath [Sat, 31 Oct 2020 05:36:46 +0000 (05:36 +0000)]
Refactor Logger (#13294)

Refactor Logger to make a logger interface and make it possible to
wrap loggers for specific purposes.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix scrolling to resolved comment anchors (#13343)
zeripath [Sat, 31 Oct 2020 04:35:35 +0000 (04:35 +0000)]
Fix scrolling to resolved comment anchors (#13343)

* Fix scrolling to resolved comment anchors

As described on discord, when the window.location.hash refers to a
resolved comment then the scroll to functionality does not work.

This PR fixes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Apply suggestions from code review

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUse CSS Vars for primary color (#13361)
silverwind [Sat, 31 Oct 2020 03:52:10 +0000 (04:52 +0100)]
Use CSS Vars for primary color (#13361)

* Use CSS Vars for primary color

- Create 15 color shades derived from primary color
- Change blue-ish colors to use that primary color
- Move styles for scrollbars, selection from arc-green to base
- Remove obsolete arc-green styles that now use those variables

* simplify webkit scrollbar style

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoDelete tag API (#13358)
John Olheiser [Sat, 31 Oct 2020 01:56:34 +0000 (20:56 -0500)]
Delete tag API (#13358)

* Delete tag API

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Wording

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add conflict response and fix API tests

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix other test

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 30 Oct 2020 22:00:02 +0000 (22:00 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoRefactor: Move PushUpdateOptions (#13363)
Lunny Xiao [Fri, 30 Oct 2020 21:59:02 +0000 (05:59 +0800)]
Refactor: Move PushUpdateOptions (#13363)

Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
3 years agoFix --port setting (#13288)
zeripath [Fri, 30 Oct 2020 19:26:03 +0000 (19:26 +0000)]
Fix --port setting (#13288)

* Fix --port setting

Unfortunately there was an error in #13195 which set the --port
option before the settings were read. This PR fixes this by
moving applying this option to after the the settings are read

However, on looking further into this code I believe that the setPort
code was slightly odd.

Firstly, it may make sense to run the install page on a different
temporary port to the full system and this should be possible with
a --install-port option.

Secondy, if the --port option is provided we should apply it to both
otherwise there will be unusual behaviour on graceful restart

Thirdly, the documentation for --port says that the setting is
temporary - it should therefore not save its result to the configuration

(This however, does mean that authorized_keys and internal links may
not be correct. - I think we need to discuss this option further.)

Fix #13277

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update cmd/web.go

* Apply suggestions from code review

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoChange repo home page icons to SVG (#13364)
silverwind [Fri, 30 Oct 2020 18:54:58 +0000 (19:54 +0100)]
Change repo home page icons to SVG (#13364)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 30 Oct 2020 16:28:07 +0000 (16:28 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix links to repositories in /user/setting/repos (#13360)
zeripath [Fri, 30 Oct 2020 16:27:01 +0000 (16:27 +0000)]
Fix links to repositories in /user/setting/repos (#13360)

* Fix links to repositories in /user/setting/repos

somehow the links gained a spurious $ in the links.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* And fix #13359

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 29 Oct 2020 21:42:52 +0000 (21:42 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMigrations should not fail for comment reactions (#13352)
zeripath [Thu, 29 Oct 2020 21:41:49 +0000 (21:41 +0000)]
Migrations should not fail for comment reactions (#13352)

An extension to #13444 - where we now ensure that comment reaction failures do not cause migrations failure

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoIssue comment reactions should also check pull type (#13349)
zeripath [Thu, 29 Oct 2020 12:48:07 +0000 (12:48 +0000)]
Issue comment reactions should also check pull type (#13349)

* Migrating reactions is just not that important

A failure during migrating reactions should not cause failure of
migration.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* When checking issue reactions check the correct permission

Signed-off-by: Andrew Thornton <art27@cantab.net>
* And there is another one ...

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoMigration failure during reaction migration from gitea (#13344)
zeripath [Thu, 29 Oct 2020 02:23:31 +0000 (02:23 +0000)]
Migration failure during reaction migration from gitea (#13344)

* Migrating reactions is just not that important

A failure during migrating reactions should not cause failure of
migration.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* When checking issue reactions check the correct permission

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoRemove obsolete change of email on profile page (#13341)
zeripath [Wed, 28 Oct 2020 22:33:14 +0000 (22:33 +0000)]
Remove obsolete change of email on profile page (#13341)

* Remove obsolete change of email on profile page

The change email on the account profile page is out-of-date
and unnecessary.

Changing email should be done using the account page.

Fix #13336

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFully remove fomantic-ui from frontend build dependencies (#13340)
silverwind [Wed, 28 Oct 2020 21:51:03 +0000 (22:51 +0100)]
Fully remove fomantic-ui from frontend build dependencies (#13340)

Followup to https://github.com/go-gitea/gitea/pull/13332. Turns out I
missed this dependency which resulted in fomantic-ui being uselessly
rebuild on CI. This fully removes it from the chain so it's not
attempted to be build as part of the main build process.

3 years agoFix command-line doc examples (#13337)
Shikaku [Wed, 28 Oct 2020 20:47:51 +0000 (05:47 +0900)]
Fix command-line doc examples (#13337)

3 years agoPrecompile fomantic-ui files (#13332)
silverwind [Tue, 27 Oct 2020 23:44:06 +0000 (00:44 +0100)]
Precompile fomantic-ui files (#13332)

We rarely change fomantic-ui or its configuration so it's kind of a
waste to have it rebuild on every CI run. These changes remove the
fomantic files from the build and instead add the relevant output files
to the git index, which should shave of 2-3 minutes on every CI run.

`make fomantic` should still work and should be ran whenever fomantic is
updated or its configuration is changed.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd migrated pulls to pull request task queue (#13331)
zeripath [Tue, 27 Oct 2020 21:34:56 +0000 (21:34 +0000)]
Add migrated pulls to pull request task queue (#13331)

* Add migrated pulls to pull request task queue

Fix #13321

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Improve error reports

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agofix quotation marks in launch.json (#13325)
Elena Neuschild [Tue, 27 Oct 2020 20:58:09 +0000 (21:58 +0100)]
fix quotation marks in launch.json (#13325)

Co-authored-by: zeripath <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 27 Oct 2020 20:07:43 +0000 (20:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd deprecation notice for webhook payload's secret field (#13330)
JustAnotherArchivist [Tue, 27 Oct 2020 20:06:35 +0000 (20:06 +0000)]
Add deprecation notice for webhook payload's secret field (#13330)

3 years ago[UI] Hide consecutive additions and removals of the same label (#13315)
Pedro Alves [Tue, 27 Oct 2020 07:12:01 +0000 (07:12 +0000)]
[UI] Hide consecutive additions and removals of the same label (#13315)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 26 Oct 2020 16:43:30 +0000 (16:43 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix send mail (#13312)
Lunny Xiao [Mon, 26 Oct 2020 16:42:27 +0000 (00:42 +0800)]
Fix send mail (#13312)

* Fix send mail

* Fix send mail

* Update modules/private/mail.go

Co-authored-by: techknowlogick <matti@mdranta.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 26 Oct 2020 09:06:29 +0000 (09:06 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoDeny wrong pull (#13308)
M4RKUS-11111 [Mon, 26 Oct 2020 09:05:27 +0000 (10:05 +0100)]
Deny wrong pull (#13308)

* Deny wrong pull

* Update routers/api/v1/repo/pull.go

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Markus <git+markus@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoGroup Label Changed Comments in timeline (#13304)
Pedro Alves [Sun, 25 Oct 2020 21:49:48 +0000 (21:49 +0000)]
Group Label Changed Comments in timeline (#13304)

* Create function to group label comments

* Combine multiple label additions into one

* Group removed and added labels in the same comment

* Fix indentation on comments.tmpl

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 25 Oct 2020 20:57:54 +0000 (20:57 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAttempt to handle unready PR in tests (#13305)
zeripath [Sun, 25 Oct 2020 20:56:51 +0000 (20:56 +0000)]
Attempt to handle unready PR in tests (#13305)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago#12897 - add mastodon provider (#13293)
Divyam Bhasin [Sun, 25 Oct 2020 18:21:49 +0000 (14:21 -0400)]
#12897 - add mastodon provider (#13293)

* added mastodon provider to oauth code

* changed go.mod and vendor/modules.txt to add updated goth

* vendored mastodon and new goth

* committing result of go mod tidy && go mod vendor

* added pic and mastodon to oauth models

* handled instance url

* applied lafriks suggestion

* Update web_src/js/index.js

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 25 Oct 2020 17:20:28 +0000 (17:20 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix Storage mapping (#13297)
zeripath [Sun, 25 Oct 2020 17:19:06 +0000 (17:19 +0000)]
Fix Storage mapping (#13297)

This PR fixes several bugs in setting storage

* The default STORAGE_TYPE should be the provided type.
* The Storage config should be passed in to NewStorage as a pointer - otherwise the Mappable interface function MapTo will not be found
* There was a bug in the MapTo function.

Fix #13286

Signed-off-by: Andrew Thornton <art27@cantab.net>