Compare commits

...

4 commits

Author SHA1 Message Date
6543 a4940e22c9 Changelog v0.14.1 (#521)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/521
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2021-07-01 04:38:11 +08:00
6543 0c4f4731f4 [CI] Test against v1.14 (#516)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/516
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2021-05-08 04:16:23 +08:00
6543 7187865c0d Fix setDefaults (#508) (#510)
Backport #508

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/510
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2021-03-30 06:26:45 +08:00
6543 0c3a126b11 test against gitea 1.14.0-rc1 (#506)
has to change to `1.14` after gitea v1.14.0 is released

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/506
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2021-03-23 04:39:20 +08:00
4 changed files with 15 additions and 8 deletions

View file

@ -12,7 +12,7 @@ workspace:
steps:
- name: gitea
image: gitea/gitea:latest
image: gitea/gitea:1.14
detach: true
commands:
- mkdir -p /tmp/conf/

View file

@ -1,5 +1,11 @@
# Changelog
## [v0.14.1](https://gitea.com/gitea/go-sdk/releases/tag/v0.14.1) - 2021-06-30
* BUGFIXES
* Fix setDefaults (#508) (#510)
## [v0.14.0](https://gitea.com/gitea/go-sdk/releases/tag/v0.14.0) - 2021-03-21
* BREAKING

View file

@ -7,7 +7,7 @@ GITEA_SDK_TEST_USERNAME ?= test01
GITEA_SDK_TEST_PASSWORD ?= test01
GITEA_DL := https://dl.gitea.io/gitea/master/gitea-master-
GITEA_DL := https://dl.gitea.io/gitea/1.14/gitea-1.14-
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
GITEA_DL := $(GITEA_DL)linux-
@ -81,8 +81,8 @@ test:
test-instance:
rm -f -r ${WORK_DIR}/test 2> /dev/null; \
mkdir -p ${WORK_DIR}/test/conf/ ${WORK_DIR}/test/data/
wget ${GITEA_DL} -O ${WORK_DIR}/test/gitea-master; \
chmod +x ${WORK_DIR}/test/gitea-master; \
wget ${GITEA_DL} -O ${WORK_DIR}/test/gitea-1.14; \
chmod +x ${WORK_DIR}/test/gitea-1.14; \
echo "[security]" > ${WORK_DIR}/test/conf/app.ini; \
echo "INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1NTg4MzY4ODB9.LoKQyK5TN_0kMJFVHWUW0uDAyoGjDP6Mkup4ps2VJN4" >> ${WORK_DIR}/test/conf/app.ini; \
echo "INSTALL_LOCK = true" >> ${WORK_DIR}/test/conf/app.ini; \
@ -94,9 +94,9 @@ test-instance:
echo "ROOT = ${WORK_DIR}/test/data/" >> ${WORK_DIR}/test/conf/app.ini; \
echo "[server]" >> ${WORK_DIR}/test/conf/app.ini; \
echo "ROOT_URL = ${GITEA_SDK_TEST_URL}" >> ${WORK_DIR}/test/conf/app.ini; \
${WORK_DIR}/test/gitea-master migrate -c ${WORK_DIR}/test/conf/app.ini; \
${WORK_DIR}/test/gitea-master admin user create --username=${GITEA_SDK_TEST_USERNAME} --password=${GITEA_SDK_TEST_PASSWORD} --email=test01@gitea.io --admin=true --must-change-password=false --access-token -c ${WORK_DIR}/test/conf/app.ini; \
${WORK_DIR}/test/gitea-master web -c ${WORK_DIR}/test/conf/app.ini
${WORK_DIR}/test/gitea-1.14 migrate -c ${WORK_DIR}/test/conf/app.ini; \
${WORK_DIR}/test/gitea-1.14 admin user create --username=${GITEA_SDK_TEST_USERNAME} --password=${GITEA_SDK_TEST_PASSWORD} --email=test01@gitea.io --admin=true --must-change-password=false --access-token -c ${WORK_DIR}/test/conf/app.ini; \
${WORK_DIR}/test/gitea-1.14 web -c ${WORK_DIR}/test/conf/app.ini
.PHONY: bench
bench:

View file

@ -26,7 +26,8 @@ func (o ListOptions) getURLQuery() url.Values {
return query
}
func (o ListOptions) setDefaults() {
// setDefaults set default pagination options if none or wrong are set
func (o *ListOptions) setDefaults() {
if o.Page < 1 {
o.Page = 1
}