Commit graph

102 commits

Author SHA1 Message Date
Ethan Koenig
f26f4a7e01 Update swagger documentation (#2899)
* Update swagger documentation

Add docs for missing endpoints
Add documentation for request parameters
Make parameter naming consistent
Fix response documentation

* Restore delete comments
2017-11-13 09:02:25 +02:00
Antoine GIRARD
619b9b5547 Move swagger-ui under /api/v1 (#2746)
* Move swagger interface under /api/v1

* Update swagger-ui

* Add /api/swagger and prepare for multiple api version

* Update test links

* Fix footer link
2017-10-21 22:05:50 +08:00
Morlinest
086eb62691 Compress css with nodejs (#2580) 2017-09-24 22:47:10 +03:00
silverwind
1fbfccb4fc Use standard lessc and minify CSS using Node.js (#2337)
* Use standard lessc and minify CSS using Node.js

This changes the previous nonstandard `lessc` to the official one and
enables CSS minification via the clean-css module.

To build CSS, Node.js is required along with a `npm install` to get the
tools installed locally in node_modules so there is no dependency on
binaries in PATH. Benefits include:

- Allows one to have a standard lessc in PATH.
- Can now use command line switches on lessc.
- Minified CSS brings faster page load times and also has the benefit
  of discouraging contributors from editing CSS directly.

To build CSS, Node.js is required along with a `npm install` to get the
tools installed locally based on the information in `package.json`.

The 'make stylesheet' task was modified to run without condition. This
makes it easier to work on the make task itself without having to delete
files.

Also fixes: https://github.com/go-gitea/gitea/issues/2198

* install node, npm and modules on drone

* .PHONY

* use 'minify' to minify CSS
2017-09-21 11:35:11 +08:00
Ethan Koenig
fa1cbc2896 Always run fmt check in CI (#2546) 2017-09-21 09:34:32 +08:00
Lauris BH
6f380a22a4 Remove go version check for make fmt (#2558) 2017-09-20 08:58:29 -03:00
Ethan Koenig
b0f7457d9e Improve issue search (#2387)
* Improve issue indexer

* Fix new issue sqlite bug

* Different test indexer paths for each db

* Add integration indexer paths to make clean
2017-09-16 23:16:21 +03:00
Bo-Yi Wu
3e89e89670 add codecov.io service. (#2493)
* add codecov.io service.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* only PR or master branch (for coverage badge)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update init

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-09-13 20:57:55 +08:00
Lauris BH
377cd1ae38 Allow changing integration test database connection using env variables (#2484) 2017-09-13 14:03:20 +08:00
Antoine GIRARD
69dfe43ffc Fix some tests : make coverage -> test (#2492)
* Fix test : make coverage -> test

* Refactor integration tests to be able to run them in parallel

* Add custom local repository temp path
2017-09-12 13:51:12 +08:00
Thomas Boerger
4b8fef143e Changes for latest DroneCI (#2362) 2017-09-07 19:22:15 +02:00
Michael Lustfield
a915a09e4f Moved vendored js/css into public/vendor and documented sources (#1484) (#2241)
* Cleaning up public/ and documenting js/css libs.

This commit mostly addresses #1484 by moving vendor'ed plugins into a
vendor/ directory and documenting their upstream source and license in
vendor/librejs.html.

This also proves gitea is using only open source js/css libraries which
helps toward reaching #1524.

* Removing unused css file.

The version of this file in use is located at:
  vendor/plugins/highlight/github.css

* Cleaned up librejs.html and added javascript header

A SafeJS function was added to templates/helper.go to allow keeping
comments inside of javascript.

A javascript comment was added in the header of templates/base/head.tmpl
to mark all non-inline source as free.

The librejs.html file was updated to meet the current librejs spec. I
have now verified that the librejs plugin detects most of the scripts
included in gitea and suspect the non-free detections are the result of
a bug in the plugin. I believe this commit is enough to meet the C0.0
requirement of #1534.

* Updating SafeJS function per lint suggestion

* Added VERSIONS file, per request
2017-08-23 16:58:05 +02:00
Bo-Yi Wu
be4f6a754c Revert "Changes for latest DroneCI (#2355)" (#2358)
This reverts commit faf4b503b2.
2017-08-22 20:56:57 -05:00
Thomas Boerger
faf4b503b2 Changes for latest DroneCI (#2355) 2017-08-22 20:08:30 -05:00
Sandro Santilli
100ec93a65 Remove integration test executables on make clean (#2340) 2017-08-20 11:09:24 +08:00
Bo-Yi Wu
722bcefbbf refactor(Makefile): allow overriding default go program (#2310) 2017-08-16 08:46:41 +08:00
Antoine GIRARD
a804f0e052 go get github.com/wadey/gocovmerge when needed (#2235) 2017-07-31 09:29:50 +08:00
silverwind
d74d8ecc2e Generate small and large logos at 4x resolution (#2233)
To support High-DPI displays, generate images at 4 times their displayed
resolution, which should be enough to support all current devices
according to https://material.io/devices/.
2017-07-30 23:04:01 +03:00
Lunny Xiao
a9cc538ab5 remove unused variable on makefile (#2225) 2017-07-29 12:22:10 +03:00
Lauris BH
60d7e56c69 Add task to generate images from SVG and change to new logo (#2194)
* Add makefile task to generate images from SVG and change to new logo

* use absolute path on generate-images
2017-07-28 13:51:20 +08:00
Bo-Yi Wu
f011d6d4d7 fix: replace tmp with TMPDIR. (#2152) 2017-07-13 14:09:29 +03:00
Bo-Yi Wu
2c3efd72ce fix typo (#2145)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-07-12 16:52:00 +08:00
Bo-Yi Wu
2b05b104ef Add verify changed less-file step to Makefile (#1861) 2017-07-12 04:28:57 +02:00
Roy Marples
c016d48735 Use POSIX complaint ! operator in find (#2132)
* Use POSIX complaint ! operator in find

-not is a GNU extension and not all find(8) implementations
support it. It's just an alias for ! which is POSIX compliant.

Now gitea compiles on NetBSD at least.

* Revert change in vendor directory as requested
2017-07-10 09:48:46 +08:00
Lunny Xiao
dde9a8648e Add make command update-translations for update translations from crodwin (#2097)
* add make command update-translations for update translations from crowdin to options/locale

* use curl & resolve double quote on make file
2017-07-03 16:37:00 +03:00
Mura Li
754482bf5d Add integration test for repository migration (#1983) 2017-06-20 19:23:16 +08:00
Antoine GIRARD
2bcd9471c9 Separate generate swagger + fix sed os specific (#1791)
* Separate generate-swagger

* Remove go generate rules

* Add missing definition replacement + remove use of -i sed flag

for compatibility with mac os default sed version.
This is a little hacky a better solution could be use.

* Use custom SED_INPLACE

depending of platform detection

* Use SED_INPLACE for swagger-ui also
2017-06-15 08:51:23 -05:00
Ethan Koenig
792cde7081 Coverage reports for integration tests (#1960) 2017-06-15 17:38:33 +08:00
Sandro Santilli
f6b58964d7 Include formatting check to the make test (and thus also check) rule (#1366)
* Include formatting check to the `make check` rule

... and give it its own standalone target too (make fmt-check)

Show diff on fmt-check failure
Do not allow running "fmt-check" with incompatible go version
Also simplify the `fmt` rule

* Forbid running "make fmt" with Go version != 1.7 or 1.8

* Ignore bindata.go for spelling and formatting checks

also remove duplicated variable assignment for GOFILES

* Run `make fmt`
2017-06-06 08:53:16 -05:00
Bo-Yi Wu
703d18e50d feat: add check misspelling (#1877) 2017-06-05 02:49:46 -05:00
Bo-Yi Wu
e7ae13deef fix: error from mktemp command in MacOS. (#1837)
* fix: error from mktemp command in MacOS.

* [ci skip] udpate temp name.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-04 03:48:18 -05:00
himaaaatti
0f5b399e35 Add variable for docker tag (#1825)
Signed-off-by: Shunsuke Mie <sux2mfgj@gmail.com>
2017-05-31 09:16:51 +08:00
Ethan Koenig
cb74f1b84d Remove stale rule from Makefile (#1782) 2017-05-25 08:53:03 +08:00
Ethan Koenig
ff96bda138 Only run coverage on merges/pushes to master (#1783) 2017-05-25 00:13:18 +08:00
Lunny Xiao
d98a86d2a2 remove sqlite tag when integration test with mysql/postgres AND recreate database when init integration test (#1693) 2017-05-09 15:42:55 +02:00
Thomas Boerger
c864ccf9b1 Enforce netgo build tag while cross-compilation (#1690) 2017-05-07 22:06:30 +08:00
Antoine GIRARD
3edb0c5894 Generate swagger json (#1402)
- Generate swagger.json into public/
- Add swagger-ui auto-installation
- Add footer link to local swagger-ui
- Add /swagger url for using app url.
- Fix Swagger-UI version via git tag
2017-05-02 15:35:59 +02:00
Antoine GIRARD
bb5f694fc5 Improve govendor testing (#1623)
- Use `govendor list +outside +unused` for finding missing or unused deps and govendor status for catching modified vendor.  
- Remove appengine import
2017-05-02 15:22:21 +02:00
Lauris BH
0144817971 Do not allow commiting to protected branch from online editor (#1502)
* Do not allow commiting to protected branch from online editor

* Add editor integration tests for adding new file and not allowing to add new file to protected branch
2017-05-02 08:49:55 +08:00
Ethan Koenig
66c803fae2 MySQL, Postgres integration tests in drone (#1638)
* MySQL, Postgres integration tests in drone

* Fix .drone.yml

* sign drone

* resign drone
2017-04-30 14:30:12 +08:00
Kim "BKC" Carlbäcker
cebe3a6b2f Revert "Set VERSION from git once, in a variable (#1447)"
This reverts commit 410af6971b.
2017-04-28 20:28:38 +02:00
Lunny Xiao
fca7ddc6ea improve integration test to resue models/fixtures and store git repos with tests (#1627)
* improve integration test to resue models/fixtures and store git repos with source

* use gitea-integration-meta dir instead .tar.gz and cleanup every before every test

* fix import package name
2017-04-28 21:23:28 +08:00
Ethan Koenig
c58708d3ee Integration test framework (#1290)
* Integration test framework

* udpate drone sign

* Formatting fixes and move router.go to routers/

* update sign for drone
2017-04-25 15:24:51 +08:00
Antoine GIRARD
eb1075dd4c Check if missing/modified/unused deps in vendor and fix errors (#1468)
* Check if missing deps in vendor

This will catch import from other repos. (maybe by auto-import)

* Remove github.com/smartystreets unused deps

* Remove github.com/boltdb/bolt unused dep

* Fetch github.com/go-xorm/core + sync gopkg.in/ldap.v2/ldap.go

* Auto-install govendor + reinstall github.com/boltdb/bolt needed by vendor/github.com/blevesearch/bleve/index/store/boltdb

* Update go-xorm/xorm to a5cb21 in vendor.json

* Use a custom repo for implementing change to bolt dep.

* Switching bolt to github.com/go-gitea/bolt

* Switching bolt to github.com/go-gitea/bolt (fork version)

* change the drone sign
2017-04-24 22:31:46 +08:00
Sandro Santilli
410af6971b Set VERSION from git once, in a variable (#1447) 2017-04-06 23:32:28 +08:00
Mura Li
2d1efcc270 Add GOFLAGS and EXTRA_GOFLAGS (#1438) 2017-04-05 16:10:32 +08:00
Thomas Boerger
7ed00b6e8d Split the binary build (#985)
As we can not compile darwin binaries with static flags I have split the
build process into different make tasks. Now we get static linked
binaries especially for linux so that it also can run on older versions
of CenOS and so on.

Signed-off-by: Thomas Boerger <thomas@webhippie.de>
2017-03-07 21:49:24 +08:00
Mura Li
848293671b Add basic integration test infrastructure (and new endpoint /api/v1/version for testing it) (#741)
* Implement '/api/v1/version'

* Cleanup and various fixes

* Enhance run.sh

* Add install_test.go

* Add parameter utils.Config for testing handlers

* Re-organize TestVersion.go

* Rename functions

* handling process cleanup properly

* Fix missing function renaming

* Cleanup the 'retry' logic

* Cleanup

* Remove unneeded logging code

* Logging messages tweaking

* Logging message tweaking

* Fix logging messages

* Use 'const' instead of hardwired numbers

* We don't really need retries anymore

* Move constant ServerHttpPort to install_test.go

* Restore mistakenly removed constant

* Add required comments to make the linter happy.

* Fix comments and naming to address linter's complaints

* Detect Gitea executale version automatically

* Remove tests/run.sh, `go test` suffices.

* Make `make build` a prerequisite of `make test`

* Do not sleep before trying

* Speedup the server pinging loop

* Use defined const instead of hardwired numbers

* Remove redundant error handling

* Use a dedicated target for running code.gitea.io/tests

* Do not make 'test' depend on 'build' target

* Rectify the excluded package list

* Remove redundant 'exit 1'

* Change the API to allow passing test.T to test handlers

* Make testing.T an embedded field

* Use assert.Equal to comparing results

* Add copyright info

* Parametrized logging output

* Use tmpdir instead

* Eliminate redundant casting

* Remove unneeded variable

* Fix last commit

* Add missing copyright info

* Replace fmt.Fprintf with fmt.Fprint

* rename the xtest to integration-test

* Use Symlink instead of hard-link for cross-device linking

* Turn debugging logs on

* Follow the existing framework for APIs

* Output logs only if test.v is true

* Re-order import statements

* Enhance the error message

* Fix comment which breaks the linter's rule

* Rename 'integration-test' to 'e2e-test' for saving keystrokes

* Add comment to avoid possible confusion

* Rename tests -> integration-tests

Also change back the Makefile to use `make integration-test`.

* Use tests/integration for now

* tests/integration -> integrations

Slightly flattened directory hierarchy is better.

* Update Makefile accordingly

* Fix a missing change in Makefile

* govendor update code.gitea.io/sdk/gitea

* Fix comment of struct fields

* Fix conditional nonsense

* Fix missing updates regarding version string changes

* Make variable naming more consistent

* Check http status code

* Rectify error messages
2017-03-06 22:13:17 +08:00
Jonas
a201977590 Fix for #828: Embed build tags (#1051)
* Fix for #828
Add build tags to ldflags and print in version output

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Reworked formatBuiltWith function

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Add tags to version information in admin panel

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Added new variable for use on admin page.

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Fixed incorrect indentation
2017-02-28 08:40:02 +08:00
silverwind
ab462fb95f Makefile: Use hash over which (#1069)
`hash` is a much faster shell-builtin alternative to `which`.
2017-02-26 16:27:45 +01:00