Commit Graph

500 Commits

Author SHA1 Message Date
appleboy 0141b499c9 docs: update badges in README.md file (#628)
- Remove the badge for build status from the README.md file
- Add a badge for the MIT license to the README.md file
- Add a badge for the release to the README.md file
- Add a badge for the chat to the README.md file
- Add a badge for microbadger to the README.md file
- Add a badge for the Go Report Card to the README.md file
- Add a badge for GoDoc to the README.md file

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

Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/628
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2023-09-06 02:23:01 +00:00
Bo-Yi Wu 091528835f feat: Add API routes to list org secrets (#629)
- Add a new file `gitea/org_action.go`
- Add a new file `gitea/secret.go`

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

block by https://github.com/go-gitea/gitea/pull/26485

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/629
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2023-08-15 15:15:48 +00:00
infinoid ae1583a7be Add missing fields to BranchProtection and related structs (#626)
the `gitea.BranchProtection` struct is missing some fields which are present in the actual gitea API (and swagger).

* BranchProtection.RuleName was added in gitea v1.19.0, via [PR #20825](https://github.com/go-gitea/gitea/pull/20825)
* BranchProtection.UnprotectedFilePatterns was added in gitea v1.16.0, via [PR #16395](https://github.com/go-gitea/gitea/pull/16395)

This PR adds those fields to the BranchProtection struct, and the related Create and Edit option structs, to match the structs [defined](https://github.com/go-gitea/gitea/blob/main/modules/structs/repo_branch.go#L27) on the gitea server side.

Co-authored-by: Mark Glines <mark@glines.org>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/626
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: delvh <dev.lh@web.de>
Co-authored-by: infinoid <infinoid@noreply.gitea.com>
Co-committed-by: infinoid <infinoid@noreply.gitea.com>
2023-08-01 16:26:41 +00:00
John Olheiser 93cfc320cf Update PR template (#627)
Noted by @ infinoid (thanks!)

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/627
2023-08-01 14:50:16 +00:00
b398f0fcac 0fe2ace132 Access the details of packages (#620)
This pull request provides access to the packages API by allowing packages to be listed, retrieved individually and for the files within a package to be listed.

Resolves gitea/go-sdk#619.

Co-authored-by: root <root@prxdevgw.westeros>
Co-authored-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/620
Co-authored-by: b398f0fcac <b398f0fcac@noreply.gitea.com>
Co-committed-by: b398f0fcac <b398f0fcac@noreply.gitea.com>
2023-07-15 02:59:55 +00:00
Alessandro De Blasis f4be505bf6 feat(oauth2): confidential_client handling (#625)
This PR adds support for the `confidential_client` in `oauth2` to reflect the swagger APIs.

It has been surfaced here: https://github.com/Lerentis/terraform-provider-gitea/pull/46

Simple tests have also been added.

Please note that in this PR I am considering the current behaviour:

> if confidential_client is not set, it's assumed that it's false

However, from the swagger, it seems that the implicit default is `true` instead.

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/625
Co-authored-by: Alessandro De Blasis <alex@deblasis.net>
Co-committed-by: Alessandro De Blasis <alex@deblasis.net>
2023-07-15 02:55:06 +00:00
JohnWalkerx 315cf7aac8 Add missing MergePullRequestOption parameters for head_commit_id and merge_when_checks_succeed (#624)
This PR adds the missing parameters for MergePullRequestOption `head_commit_id` and `merge_when_checks_succed` like in the current Gitea API.
Resolves #623

Signed-off-by: Johannes Lauffer <johnwalkerx@mailbox.org>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/624
Co-authored-by: JohnWalkerx <johnwalkerx@mailbox.org>
Co-committed-by: JohnWalkerx <johnwalkerx@mailbox.org>
2023-07-15 02:53:03 +00:00
Zettat123 970776d1c1 Switch to Gitea Actions (#618)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/618
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>
2023-05-09 11:50:20 +08:00
Norwin 24a404e561 Add `GetIssueTemplates()` (#603)
This API was added in 1.16, [template forms](https://github.com/go-gitea/gitea/pull/20987) will be in 1.18.
I don't think we need to add version checks, as the respective `.Form` field will just be empty on unsupported versions, but correct me if I'm wrong here.

fixes #547

- i took the freedom to change the struct property names from the API names for clarity
- I didn't add  tests because it would effectively just test gitea's API to be functional  (as long as there is only this GET method)

Co-authored-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/603
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Co-authored-by: Norwin <git@nroo.de>
Co-committed-by: Norwin <git@nroo.de>
2023-04-20 00:19:26 +08:00
jolheiser 3c5cad657b Add token scopes enum and add to payloads (#617)
Closes #616

/cc @chmouel

---

This should work fine, as the Gitea API accepts a string array and then internally converts the scopes.

Co-authored-by: Chmouel Boudjnah <chmouel@chmouel.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/617
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
2023-04-19 23:57:54 +08:00
6543 6d1bcd107f support error.Is for ErrUnknownVersion (#615)
followup of https://gitea.com/gitea/go-sdk/pulls/612

see https://gitea.com/gitea/tea/pulls/538#issuecomment-734707

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/615
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2023-04-03 11:34:49 +08:00
John Olheiser 7511c6d3cd Set client version to lowest for compat if server version can't be recognized and return specific error (#612)
This is a possible resolution for gitea/tea#531

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/612
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: John Olheiser <john+gitea@jolheiser.com>
Co-committed-by: John Olheiser <john+gitea@jolheiser.com>
2023-04-03 05:30:53 +08:00
Dmitry Afanasiev 846d53e967 add support for api /repos/{owner}/{repo}/collaborators/{collaborator}/permission (#611)
Co-authored-by: Dmitry Afanasiev <afanasiev.dmitry@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/611
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Dmitry Afanasiev <dafanasiev@noreply.gitea.io>
Co-committed-by: Dmitry Afanasiev <dafanasiev@noreply.gitea.io>
2023-03-04 20:31:32 +08:00
John Olheiser df1269f18d Pin CI (#614)
This PR pins the CI and various versions of tools in our Makefile to ensure a more stable run.

Note that they aren't necessarily the most current versions, as the SDK likely needs more work to bring it back up to par with the main repo.

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/614
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john+gitea@jolheiser.com>
Co-committed-by: John Olheiser <john+gitea@jolheiser.com>
2023-03-01 08:50:04 +08:00
John Olheiser 2c35c11772 Add confidential_client to oauth2 struct (#613)
Just updating the struct to match the current API

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/613
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john+gitea@jolheiser.com>
Co-committed-by: John Olheiser <john+gitea@jolheiser.com>
2023-03-01 06:21:34 +08:00
edieruby 2d9ee57af1 update go.mod (#608)
add the depend of github.com/davidmz/go-pageant

Co-authored-by: Y <469960757@qq.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/608
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: edieruby <edieruby@noreply.gitea.io>
Co-committed-by: edieruby <edieruby@noreply.gitea.io>
2022-10-17 02:35:12 +08:00
qwerty287 1c9c71d84a Add `ListPullRequestFiles` (#607)
Was added in 1dfa28ffa5.

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/607
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: qwerty287 <qwerty287@noreply.gitea.io>
Co-committed-by: qwerty287 <qwerty287@noreply.gitea.io>
2022-10-17 02:33:29 +08:00
6543 8f846bdb9b Update PullRequest struct (#606)
Add AllowMaintainerEdit

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/606
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2022-09-27 10:50:37 +08:00
earl-warren aef4e5e2bd Add `DeleteIssue()` (#598)
Fixes: #596

Signed-off-by: Earl Warren <contact@earl-warren.org>

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/598
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: earl-warren <contact@earl-warren.org>
Co-committed-by: earl-warren <contact@earl-warren.org>
2022-09-16 05:45:01 +08:00
6543 7aeaaa45e1 More integration test fixes (#604) 2022-09-16 02:26:31 +08:00
Norwin e5b5b3447a Fix broken CI (#602)
closes #599
"blocks" #598

Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/602
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2022-09-16 01:47:16 +08:00
6543 5852fcc4a3 Update EditPullRequestOption struct (#601)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/601
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
2022-09-15 09:29:50 +08:00
6543 a0127ed0e7 use build tag to support darwin again (#600)
fix https://ci.woodpecker-ci.org/woodpecker-ci/woodpecker/build/3344/11

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/600
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2022-08-31 08:41:39 +08:00
6543 cc14c63ccc Add GetFileReader() & GetFile() support git-lfs (#595)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/595
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: KN4CK3R <kn4ck3r@noreply.gitea.io>
2022-07-29 18:51:05 +08:00
lafriks de34275bb6 Add method to get user organization permissions (#594)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/594
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: lafriks <lafriks@noreply.gitea.io>
Co-committed-by: lafriks <lafriks@noreply.gitea.io>
2022-07-20 10:57:09 +08:00
Wim e5f0c189f2 Add support for http signatures (#553)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/553
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Wim <42wim@noreply.gitea.io>
Co-committed-by: Wim <42wim@noreply.gitea.io>
2022-07-13 00:45:08 +08:00
6543 359c771ce3 Make CI work again (#593)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/593
2022-05-31 06:08:44 +08:00
Gusted 99a9de3172 Add response to `ReadRepoNotifications` (#590)
- This is a breaking change.
- Return the relevant notifications when the Gitea server is 1.16.0 or higher.
- Ref: https://github.com/go-gitea/gitea/pull/17064
- Resolves #543

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/590
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-05-15 23:47:38 +08:00
6543 23e1316337 Relax TestAdminCronTasks (#591)
Relax test since this will be variable upstream ...

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/591
Reviewed-by: Gusted <williamzijl7@hotmail.com>
2022-05-15 06:22:02 +08:00
Gusted f3ebdb8afe Add function to get commit diff/patch (#589)
- Adds function the gets a commit's diff or patch.
- Ref: https://github.com/go-gitea/gitea/pull/17095

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/589
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-05-15 06:16:26 +08:00
arkamar 319a978c6c Allow PR review with comments only (#570)
It is common to create PR review with Comments only, where foreword Body is empty. This is allowed by Gitea API, therefore SDK should return empty body error only if there are no comments.

Co-authored-by: Petr Vaněk <arkamar@atlas.cz>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/570
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: arkamar <arkamar@noreply.gitea.io>
Co-committed-by: arkamar <arkamar@noreply.gitea.io>
2022-05-02 03:09:34 +08:00
Gusted adebf1cd11 Add file commit history (#588)
- Allow to specify to only get commit history of specific file.
- Ref: https://github.com/go-gitea/gitea/pull/17652

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/588
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-05-01 15:48:52 +08:00
Gusted 8fab37e740 Enforce golangci-lint + gofumpt (#587)
- Enforce [gofumpt](https://github.com/mvdan/gofumpt) to enforce a more idiomatic go style.
- Enforce golangci-lint a bunch of linters! Which were able to detect a few issues in the current codebase and have been fixed by this PR.
- Updated the Makefile to use `go install ....` instead of the old deprecated way of `go get`

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/587
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-04-28 23:33:21 +08:00
John Olheiser ce9d46682d Add commit stats and verification (#584)
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/584
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-committed-by: John Olheiser <john.olheiser@gmail.com>
2022-04-28 18:58:54 +08:00
John Olheiser 89a4b0be6e Return error message for 4xx errors (#583)
Resolves #582
Resolves #551

As noted in both issues, we _could_ put the `resp.Body` back, however I think this should also suffice, as it will return error messages when appropriate based on the JSON response.

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/583
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-committed-by: John Olheiser <john.olheiser@gmail.com>
2022-04-28 10:56:33 +08:00
Gusted ad3580e44d Add the Accept/Reject transfer of a repository. (#586)
- Allow to Accept or Reject a transfer of a repository via the API. Only
- available for v1.16+
- Ref: https://github.com/go-gitea/gitea/pull/17963

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/586
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-04-28 09:27:56 +08:00
Gusted 559cc2fb2a Add sorting by owner/team for list search on user (#585)
- Add sorting by Owner and Team for the user list issues endpoint.
- Ref: https://github.com/go-gitea/gitea/pull/16662

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/585
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-04-28 08:43:52 +08:00
Gusted 468d48c978 Add search teams on org API (#577)
- Add the API to search for teams on a organization by the `/orgs/{org}/teams/search` API of Gitea.
- The response body of the API is a bit weird because it the JSON can return three fields "data", "error", "ok", first check if there's a general HTTP error. Otherwise when ok is set to false, return a error with the given error message of the error field. When ok is set to true, simply return the data.

CC @fnetx

Co-authored-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/577
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-04-27 03:21:25 +08:00
Norwin 223f0a75e0 ListOptions.setDefaults(): remove artificial and buggy pagination limits (#573)
fixes #571

Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/573
Reviewed-by: Gusted <williamzijl7@hotmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2022-04-27 03:07:37 +08:00
Gusted 2e8bb53b30 Add `Name` field to `CreateForkOption` (#576)
- As per #558, due https://github.com/go-gitea/gitea/pull/18066

Co-authored-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/576
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-04-27 03:04:20 +08:00
John Olheiser 321bd56d93 Add webhook verification funcs (#580)
This PR adds a func for verifying incoming webhooks from Gitea, as well as a middleware for easier addition to a router stack.

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/580
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Gusted <williamzijl7@hotmail.com>
2022-04-27 02:59:02 +08:00
John Olheiser 2616d10528 Pull newest Gitea dev image always (#581)
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/581
Reviewed-by: Gusted <williamzijl7@hotmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-committed-by: John Olheiser <john.olheiser@gmail.com>
2022-04-27 00:00:40 +08:00
Gusted 603e4358f8 Fix CI tests (#579)
- `master` -> `main`, due to https://github.com/go-gitea/gitea/pull/19354
- Fix incorrect variable being passed into assert in `TestPull`.
- Fix `createTestRepo` to only delete existing TestRepo if the result's repo wasn't redirected(e.g. due to being transferred or renamed). Fixes the error in TransferRepo.
- Remove a check for tag verfication, for some developers this will always fail due to local git configs forcing signing on tags.

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/579
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-04-22 15:52:45 +08:00
Gusted a56a62a4df Update length of cron tasks (#578)
- Bump amount of cron tasks that the dev image of Gitea has to 21.
- Fix TestAdminCronTasks.

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/578
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-04-10 20:10:20 +08:00
Gusted f3162e5333 Update dependencies (#575)
- Update testify to v1.7.0(Thus fixing vulnerabilities https://deps.dev/go/code.gitea.io%2Fsdk%2Fgitea/, quite minor because testify is only used for test code).
- Update go-version to v1.4.0

Co-authored-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/575
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-committed-by: Gusted <williamzijl7@hotmail.com>
2022-03-29 09:16:23 +08:00
Lunny Xiao 22f2853429 Use goproxy.io instead of goproxy.cn (#574)
Fix CI, Fix #572

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/574
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-03-29 07:09:57 +08:00
petergardfjall f0663b3c13 add mirror_updated field to Repository struct (#565)
This PR resolves https://gitea.com/gitea/go-sdk/issues/566.

It ensures that the client-side SDK extracts the `mirror_updated` field introduced on the server by https://github.com/go-gitea/gitea/pull/18267 (issue: https://github.com/go-gitea/gitea/issues/18266).

Co-authored-by: Peter Gardfjäll <peter.gardfjall.work@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/565
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Co-authored-by: petergardfjall <petergardfjall@noreply.gitea.io>
Co-committed-by: petergardfjall <petergardfjall@noreply.gitea.io>
2022-03-28 19:06:48 +08:00
qwerty287 29e6eb37fe Fix URL param (#568)
The URL param for pre-releases was `draft`, it should be `pre-release`.

Co-authored-by: qwerty287 <ndev@web.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/568
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: qwerty287 <qwerty287@noreply.gitea.io>
Co-committed-by: qwerty287 <qwerty287@noreply.gitea.io>
2022-02-15 23:14:18 +08:00
Norwin 36c7f8c8de Fix CI (run gitea without root previleges) (#569)
CI is broken due to gitea upstream changes in deployment; may not run as root.
I have not tested if this actually fixes things, for upstream reference see f0bd1e9896 (diff-b54b39f1afced2465e1f3641db9d5bbf4f3a7fcf890996dfedd3c197bcb7f8c7)

I also switched from `:latest` to `:dev`, see https://github.com/go-gitea/gitea/pull/16421

edit: sorry for the messy commit list below, it's actually just a single commit.
Co-authored-by: Norwin <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/569
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2022-02-14 23:05:57 +08:00
takirala 73182f46eb More descriptive errors when validating repo metadata (#567)
When creating a repository using gitea client, it performs some validation on client options and the errors returned are not descriptive enough. This PR makes the errors more precise so that the user can fix the errors easily.

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/567
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: takirala <takirala@noreply.gitea.io>
Co-committed-by: takirala <takirala@noreply.gitea.io>
2022-02-01 07:14:45 +08:00