Commit Graph
16559 Commits
Author SHA1 Message Date
686850e21f Fix cross compile (#10952)
* Fix cross compile

* Add test for cross compile

* Fix drone

* Fix drone

* Also prevent CC environment not to generate

Co-authored-by: zeripath <[email protected]>
2020-04-05 20:28:18 +08:00
John OlheiserandGitHub baadb51445 Add gitea-vet (#10948)
* Add copyright

Signed-off-by: jolheiser <[email protected]>

* Add gitea-vet and fix non-compliance

Signed-off-by: jolheiser <[email protected]>

* Combine tools.go into build.go and clean up

Signed-off-by: jolheiser <[email protected]>

* Remove extra GO111MODULE=on

Signed-off-by: jolheiser <[email protected]>
2020-04-05 07:20:50 +01:00
b74d30ae27 Prevent support libraries from compiling into Gitea (#10964)
* Prevent support libraries from compiling into Gitea

* Fix tag position

* Fix golangci-lint errors

* Refactor to make it work

Co-authored-by: Guillermo Prandi <[email protected]>
2020-04-05 11:35:02 +08:00
6cf71ee0e8 Fix scrollbar issues in dropdowns (#10897)
* Fix scrollbar issues in dropdowns

Fixes: https://github.com/go-gitea/gitea/pull/10835

* remove wrapping

* grammar

Co-authored-by: guillep2k <[email protected]>
2020-04-04 18:29:15 -03:00
mrsdizzieandGitHub a0cc4b3d08 Adjust label padding (#10957)
* Adjust label padding

* fix less complaint

* Make top/bottom padding a bit smaller to create better label look
2020-04-04 14:39:57 -05:00
Vasil MikhalenyaandGitHub 240258a3e5 Avoiding directory execution on hook (#10954) (#10955)
* test -x is not enough https://stackoverflow.com/a/39489087
2020-04-04 11:29:58 -05:00
2a06d3a590 Enable GO111MODULE=on globally in Makefile (#10939)
Now that our minimum required go version is 1.12 we can remove code that disables GO111MODULE globally and turn it on, so each command doesn't need it set specifically.

Also fixes a small bug with make pr that didn't work because GO111MODULE=on wasn't set

Co-authored-by: Lunny Xiao <[email protected]>
2020-04-04 19:41:00 +08:00
b264c30394 Move gocovmerge as vendor (#10947)
* Move gocovmerge as vendor

* Update Makefile

Co-Authored-By: guillep2k <[email protected]>

Co-authored-by: guillep2k <[email protected]>
2020-04-04 11:45:26 +03:00
14c97c0501 Add titles and improve messages on sidebar menus (#10872)
* ui: add more message on sidebar menus

* add title on the menus
* show some message instead of hide choose bar when have nothing to choose
* add simply filter for each menus
* do same changes in mew_form.tmpl
* remove some unusefull comments in mew_form.tmpl

Signed-off-by: a1012112796 <[email protected]>

* do review suggestions

* add filter message  on sidebar filter
* change IsIssueWriter to HasIssuesOrPullsWritePermission

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: guillep2k <[email protected]>
2020-04-04 02:39:48 -03:00
4f63f283c4 Rename scripts to build and add revive command as a new build tool command (#10942)
Co-authored-by: techknowlogick <[email protected]>
2020-04-03 22:29:12 +03:00
techknowlogickandGitHub 4af7c47b38 Update docs to 1.11.4 (#10941) 2020-04-03 13:08:40 -04:00
zeripathandGitHub 97eb37e823 Fix rebase conflict detection in git 2.26 (#10929)
* Fix rebase conflict detection in git 2.26

Git changed the technique used in rebase from
simple apply-patches to use merge. This breaks
our conflict detection code.

Signed-off-by: Andrew Thornton <[email protected]>

* As per @techknowlogick reduce copying

Signed-off-by: Andrew Thornton <[email protected]>
2020-04-03 19:00:41 +03:00
zeripathandGitHub 57cca44c5e Generate Diff and Patch direct from Pull head (#10936)
* Generate Diff and Patch direct from Pull head

Fix #10932
Also fix "Empty Diff/Patch File when pull is merged"

Closes #10934

Signed-off-by: Andrew Thornton <[email protected]>

* Add tests to ensure that diff does not change

Signed-off-by: Andrew Thornton <[email protected]>

* Ensure diffs and pulls pages work if head branch is deleted too

Signed-off-by: Andrew Thornton <[email protected]>
2020-04-03 21:21:41 +08:00
f685edf510 Change review status icons on PR view style to Github style (#10737)
* change the icon of ApproveReview pr from "eye" to "check" like github
* change the icon of RejectReview pr from "x" to "request-change" like github
* add "-" after "{{" which need to be one line (TODO: may be not change all)

Signed-off-by: a1012112796 <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: John Olheiser <[email protected]>
Co-authored-by: guillep2k <[email protected]>
2020-04-03 02:12:42 -03:00
3723b0647f [UI] language status icon size (#10749)
* language status icon size

change the repository language status icon size

* Update _base.less

* fix: eslint rule  length-zero-no-unit

* [ui] .color-icon change size ti 14px

* Update web_src/less/_base.less

* Update web_src/less/_base.less

Co-authored-by: Lauris BH <[email protected]>
2020-04-02 14:18:35 +03:00
GiteaBot 6c27f3e4e5 [skip ci] Updated translations via Crowdin 2020-04-01 19:05:15 +00:00
6543andGitHub a291a0eddc Prevent deadlock in pull_service.GetDiverging(pr) (#10905)
* Switch to use a temporary repository instead of adding remotes to the base gitea repository to prevent deadlocking the base gitea repository.
* Add documentation on how to use func **createTemporaryRepo**
2020-04-01 20:03:08 +01:00
d501aec427 Changelog v1.11.4 (#10916) (#10917)
* output of changelog

* Apply suggestions from code review

* Update CHANGELOG.md

Co-authored-by: zeripath <[email protected]>

Co-authored-by: zeripath <[email protected]>
2020-04-01 12:59:05 -04:00
51140a970f [Docs] Database Preparation - Connection over TLS (#10889)
* Database Preparation - Connection over TLS

* Step 6 MySQL edit

- have been created [before -> earlier]
- recreate user, [and this time]

* Apply suggestions from @guillep2k

Co-Authored-By: guillep2k <[email protected]>

* certificat[e] typo

Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-04-01 12:30:25 -03:00
408bc2c8b5 Only update merge_base in checker if not already merged (#10908)
Fix #10766

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
2020-04-01 15:02:11 +03:00
GiteaBot fbb0880d37 [skip ci] Updated translations via Crowdin 2020-04-01 06:35:41 +00:00
848502d04c Exclude vendor dirs from git CRLF normalization (#10911)
* Exclude vendor dirs from git CRLF normalization

Should get rid of a few warnings like at the end of `lint-backend` like
https://drone.gitea.io/go-gitea/gitea/23117/1/4

* make vendor

Co-authored-by: John Olheiser <[email protected]>
Co-authored-by: guillep2k <[email protected]>
2020-04-01 09:33:49 +03:00
8d99ee2773 Add Organization Wide Labels (#10814)
* Add organization wide labels

Implement organization wide labels similar to organization wide
webhooks. This lets you create individual labels for organizations that can be used
for all repos under that organization (so being able to reuse the same
label across multiple repos).

This makes it possible for small organizations with many repos to use
labels effectively.

Fixes #7406

* Add migration

* remove comments

* fix tests

* Update options/locale/locale_en-US.ini

Removed unused translation string

* show org labels in issue search label filter

* Use more clear var name

* rename migration after merge from master

* comment typo

* update migration again after rebase with master

* check for orgID <=0 per guillep2k review

* fmt

* Apply suggestions from code review

Co-Authored-By: guillep2k <[email protected]>

* remove unused code

* Make sure RepoID is 0 when searching orgID per code review

* more changes/code review requests

* More descriptive translation var per code review

* func description/delete comment when issue label deleted instead of hiding it

* remove comment

* only use issues in that repo when calculating number of open issues for org label on repo label page

* Add integration test for IssuesSearch API with labels

* remove unused function

* Update models/issue_label.go

Co-Authored-By: guillep2k <[email protected]>

* Use subquery in GetLabelIDsInReposByNames

* Fix tests to use correct orgID

* fix more tests

* IssuesSearch api now uses new BuildLabelNamesIssueIDsCondition. Add a few more tests as well

* update comment for clarity

* Revert previous code change now that we can use the new BuildLabelNamesIssueIDsCondition

* Don't sort repos by date in IssuesSearch API

After much debugging I've found a strange issue where in some cases MySQL will return a different result than other enigines if a query is sorted by a null collumn. For example with our integration test data where we don't set updated_unix in repository fixtures:

SELECT `id`, `owner_id`, `owner_name`, `lower_name`, `name`, `description`, `website`, `original_service_type`, `original_url`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `status`, `is_fork`, `fork_id`, `is_template`, `template_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `avatar`, `created_unix`, `updated_unix` FROM `repository` ORDER BY updated_unix DESC LIMIT 15 OFFSET 45

Returns different results for MySQL than other engines. However, the similar query:

SELECT `id`, `owner_id`, `owner_name`, `lower_name`, `name`, `description`, `website`, `original_service_type`, `original_url`, `default_branch`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_empty`, `is_archived`, `is_mirror`, `status`, `is_fork`, `fork_id`, `is_template`, `template_id`, `size`, `is_fsck_enabled`, `close_issues_via_commit_in_any_branch`, `topics`, `avatar`, `created_unix`, `updated_unix` FROM `repository` ORDER BY updated_unix DESC LIMIT 15 OFFSET 30

Returns the same results.

This causes integration tests to fail on MySQL in certain cases but would never show up in a real installation. Since this API call always returns issues based on the optionally provided repo_priority_id or the issueID itself, there is no change to results by changing the repo sorting method used to get ids earlier in the function.

* linter is back!

* code review

* remove now unused option

* Fix newline at end of files

* more unused code

* update to master

* check for matching ids before query

* Update models/issue_label.go

Co-Authored-By: 6543 <[email protected]>

* Update models/issue_label.go

* update comments

* Update routers/org/setting.go

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: 6543 <[email protected]>
2020-04-01 01:14:46 -03:00
John OlheiserandGitHub 36d9237e60 Add accordion to release list and compact non-latest (#10910)
Signed-off-by: jolheiser <[email protected]>
2020-03-31 17:39:54 -05:00
2c25e75dca Various Merge Base fixes (#10786)
* Fix broken merge base migration v128 for merged PR

* Allow PRs with deleted base branches to still show diff

* as per @lunny

Co-authored-by: Lauris BH <[email protected]>
2020-03-31 16:42:44 +03:00
Lunny XiaoandGitHub 73cf0e2614 Fix milestones too many SQL variables bug (#10880)
* Fix milestones too many SQL variables bug

* Fix test

* Don't display repositories with no milestone and fix tests

* Remove unused code and add some comments
2020-03-31 10:47:00 +03:00
zeripathandGitHub bf847b9397 Upgrade golangci-lint to 1.24.0 (#10894)
* upgrade golangci-lint to 1.24.0 to allow go 1.14 compatibility
* fix golangci-lint errors
* make make golangci-lint work when out of go-path

Signed-off-by: Andrew Thornton <[email protected]>
2020-03-30 21:52:45 +03:00
972b3bf3b0 Split dashboard elements into separate template files (#10885)
* Split dashboard elements into separate template files

No code change just Move Heatmap and Repo list/search into separate
template files (like feeds and navbar already are). This will let a
user more easily replace dashboard.tmpl without regularly becoming
out of sync with fixes or changes to the actual code.

Fixes #10870

* End file with an empty line

Co-authored-by: zeripath <[email protected]>
2020-03-30 03:49:54 -03:00
GiteaBot bdfe4e258f [skip ci] Updated translations via Crowdin 2020-03-30 05:32:25 +00:00
f490291bea Use subquery to instead In (#10874)
* Use subquery to instead In

* Support excludedLabelNames on issues options

* Fix tests

Co-authored-by: zeripath <[email protected]>
2020-03-30 02:30:39 -03:00
5c3be56f7b Add IIS Reverse Proxy documentation (#10881)
* Add IIS Reverse Proxy documentation

@mahdiit in #10748 described how to set up IIS as a reverse proxy. This
PR adds these to our documentation.

Close #10748

Signed-off-by: Andrew Thornton <[email protected]>

* Update docs/content/doc/usage/reverse-proxies.en-us.md

Co-Authored-By: mrsdizzie <[email protected]>

Co-authored-by: mrsdizzie <[email protected]>
2020-03-30 00:11:15 +03:00
GiteaBot 29ed07ee02 [skip ci] Updated translations via Crowdin 2020-03-29 19:53:00 +00:00
zeripathandGitHub d01763ee14 Protect against NPEs in notifications list (#10879)
Unfortunately there appears to be potential race with notifications
being set before the associated issue has been committed.

This PR adds protection in to the notifications list to log any failures
and remove these notifications from the display.

References #10815 - and prevents the panic but does not completely fix
this.

Signed-off-by: Andrew Thornton <[email protected]>
2020-03-29 20:51:14 +01:00
20d4f9206d Change the order of issues.closed_by to list opening user first (#10876)
Fix #8266

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
2020-03-29 13:09:23 -03:00
zeripathandGitHub 209045f55b Slight simplification of accessibleRepositoryCondition (#10875)
* Slight simplification of accessibleRepositoryCondition

Signed-off-by: Andrew Thornton <[email protected]>
2020-03-29 15:31:10 +01:00
silverwindandGitHub ad4026431b Add 'make lint', restructure 'compliance' pipeline (#10861)
- Added 'lint', 'lint-frontend', 'lint-backend' targets
- Added 'lint-frontend', 'lint-backend' ci steps and restructure the
  'compliance' pipeline to have a clear separation between frontend and
  backend and use parallelism where possible. Also, the main build
  pipelines now depend on 'compliance' so they will skip if it fails.
- Added dependencies on ci steps so they skip when 'compliance' fails
- Moved JS linters to devDependencies
- Removed deprecated 'js' and 'css' targets
2020-03-29 12:56:58 +01:00
John OlheiserandGitHub 3f0cb8b33a Remove test from installation directions (#10873)
Signed-off-by: jolheiser <[email protected]>
2020-03-29 11:07:40 +01:00
e83daf77ad Avoid logging []byte in queue failures - convert to string first (#10865)
Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: guillep2k <[email protected]>
2020-03-29 15:12:15 +08:00
61f603cd8a Create a new function to build search repository condition (#10858)
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: guillep2k <[email protected]>
2020-03-29 02:27:06 -03:00
zeripathandGitHub 48890ce546 Allow site admin to check /api/v1/orgs endpoints (#10867)
Fix #9950

Signed-off-by: Andrew Thornton <[email protected]>
2020-03-28 19:45:55 +00:00
052bff0cff Convert plumbing.ErrObjectNotFound to git.ErrNotExist in getCommit (#10862)
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: guillep2k <[email protected]>
Co-authored-by: Antoine GIRARD <[email protected]>
2020-03-28 20:59:21 +02:00
zeripathandGitHub ea67e563dd Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen (#10863)
* Use ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen

Fix #3985

Signed-off-by: Andrew Thornton <[email protected]>

* Pass up the unable to verify
2020-03-28 19:24:55 +02:00
赵智超andGitHub f9f2c163b1 bug: fix assignees double load bug (#10856)
Because the assigness has been loaded in

compare.go 416:
    RetrieveRepoMetas(ctx, ctx.Repo.Repository, true)
then
issue.go 381
	RetrieveRepoMilestonesAndAssignees(ctx, repo)
then

issue.go 361 -- 365 , they are load assignees

So the code on compare.go 425 -- 427 is double work,
and which is the reason of #10853

Signed-off-by: a1012112796 <[email protected]>
2020-03-28 14:22:52 +00:00
828a27feeb Add Matrix webhook (#10831)
* Add Matrix webhook

Signed-off-by: Till Faelligen <[email protected]>

* Add template and related translations for Matrix hook

Signed-off-by: Till Faelligen <[email protected]>

* Add actual webhook routes and form

Signed-off-by: Till Faelligen <[email protected]>

* Add missing file

Signed-off-by: Till Faelligen <[email protected]>

* Update modules/webhook/matrix_test.go

* Use stricter regex to replace URLs

Signed-off-by: Till Faelligen <[email protected]>

* Escape url and text

Signed-off-by: Till Faelligen <[email protected]>

* Remove unnecessary whitespace

* Fix copy and paste mistake

Co-Authored-By: Tulir Asokan <[email protected]>

* Fix indention inconsistency

* Use Authorization header instead of url parameter

* Add raw commit information to webhook

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Tulir Asokan <[email protected]>
2020-03-28 15:09:55 +02:00
7cd47046ea Handle push rejection in branch and upload (#10854)
* Handle push rejections and push out-of-date in branch creation and
file upload.
* Remove the duplicated sanitize from services/pull/merge
* Move the errors Err(Merge)PushOutOfDate and ErrPushRejected to
modules/git
* Handle errors better in the upload file dialogs

Fix #10460

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: guillep2k <[email protected]>
2020-03-28 01:13:18 -03:00
cac30abefc [Docs] Config Cheat Sheet: SSL_MODE Value Description (#10834)
* Add description of SSL_MODE values

* Apply suggestions from @guillep2k

Rewording suggestions

Co-Authored-By: guillep2k <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Antoine GIRARD <[email protected]>
2020-03-28 00:24:12 -03:00
GiteaBot 7e8ced07b3 [skip ci] Updated translations via Crowdin 2020-03-27 21:28:54 +00:00
zeripathandGitHub 1737fca220 make gitea admin auth list formatting configurable (#10844)
* make admin auth list formatting configurable

Signed-off-by: Andrew Thornton <[email protected]>

* As per @guillep2k

Signed-off-by: Andrew Thornton <[email protected]>
2020-03-27 22:26:43 +01:00
Success GoandGitHub 8cffae65a6 Fix typo of MSSQL (#10850) 2020-03-27 16:12:39 +02:00
e6baa656f7 make avatar lookup occur at image request (#10540)
speed up page generation by making avatar lookup occur at the browser
not at page generation

* Protect against evil email address ".."

* hash the complete email address

Signed-off-by: Andrew Thornton <[email protected]>

Co-Authored-By: Lauris BH <[email protected]>
2020-03-27 14:34:39 +02:00