Reviewed-on: https://codeberg.org/mvdkleijn/forgejo-sdk/pulls/1
Co-authored-by: Martijn van der Kleijn <martijn.niji@gmail.com>
Co-committed-by: Martijn van der Kleijn <martijn.niji@gmail.com>
Signed-off-by: Martijn van der Kleijn <martijn.niji@gmail.com>
The definition for `Package` in the most recent api switch the
repository field from a string to a `Repository`.
Without this fix api calls like ListPackages will fail to deserialize
the response.
Co-authored-by: diogo464 <diogo464@protonmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/647
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: John Olheiser <jolheiser@noreply.gitea.com>
Co-authored-by: diogo464 <diogo464@noreply.gitea.com>
Co-committed-by: diogo464 <diogo464@noreply.gitea.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/644
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Reviewed-by: John Olheiser <jolheiser@noreply.gitea.com>
Co-authored-by: Simon Ser <contact@emersion.fr>
Co-committed-by: Simon Ser <contact@emersion.fr>
- Update the version of `github.com/hashicorp/go-version` from `v1.5.0` to `v1.6.0`
- Update the version of `golang.org/x/crypto` from `v0.0.0-20220525230936-793ad666bf5e` to `v0.17.0`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/646
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
I noticed that the description limits on gitea were changed to 2048 characters last year, but it was still 255 in the SDK.
Here the corresponding commit on gitea:
8351172b6e
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/645
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Co-authored-by: Andreas Wachter <andreas.wachter@buddyspencer.monster>
Co-committed-by: Andreas Wachter <andreas.wachter@buddyspencer.monster>
- Add a new constant `RepoUnitActions` to represent the actions of a repository
Signed-off-by: appleboy <appleboy.tw@gmail.com>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/643
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
Helps if need to get all data that can not be requested in single page
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/638
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-committed-by: Lauris BH <lauris@nix.lv>
This PR adds the ability to set a custom user-agent to the gitea client
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/637
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Co-authored-by: crapStone <crapstone01@gmail.com>
Co-committed-by: crapStone <crapstone01@gmail.com>
- 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>
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>
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.
Resolvesgitea/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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
- 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>
- 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>
Resolves#582Resolves#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>