Commit Graph

7 Commits

Author SHA1 Message Date
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
6543 6b6fdd91ce UrlEscape Function Arguments used in UrlPath (#273)
close #271

* [x] add check if user/repo-name is empty
* [x] use net/url for links to encode

Co-authored-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/273
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2021-03-22 04:20:32 +08:00
6543 8947cd3b00 Update Structs (#486)
* FileOptions: add Signoff
* Commit: add CommitAffectedFiles
* BranchProtection, CreateBranchProtectionOption, EditBranchProtectionOption: add BlockOnOfficialReviewRequests
* MigrateRepoOption: add MirrorInterval & enable gogs as source option
* EditRepoOption: Add new fields
* Repository: Add new fields & related structs
* PullReview: Add fields
* StopWatch: Add new fields
* EditIssueOption: Add option to delete Deadline
* EditUserOption: lot of options got optional

close #479

Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/486
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2021-02-14 03:24:00 +08:00
6543 9c81fa936f Use Predefind Versions & Compare Function (#442)
update min go requrement & update required go-version lib

use special version in notifications

migrate to new version check function

add predefined versions & comparsion function

Co-authored-by: 6543 <6543@noreply.gitea.io>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/442
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-Authored-By: 6543 <6543@obermui.de>
Co-Committed-By: 6543 <6543@obermui.de>
2020-11-13 04:59:04 +08:00
6543 688ee1978e All Function return http responce (#416)
Add Docs on how to deal with this breaking change

doResponse should return responce in all cases, to prosses things manualy if wanted

helper func return http response

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/416
Reviewed-by: Andrew Thornton <art27@cantab.net>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-14 02:37:09 +00:00
6543 5d880baff1 Add Validate func for Create/Edit Options (#370)
add TestLabels TEST

fix ...

impruve CreatePullReviewOptions Validate

some code refactor & reformat

add Validate functions where it make sence

add Validate() for CreateLabelOption

rm ToDo - not needed

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/370
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-06-09 10:47:55 +00:00
6543 2e81813c45 Add BranchProtection functions (#341)
Merge branch 'master' into branch-protection

Merge branch 'master' into branch-protection

Merge branch 'master' into branch-protection

Merge branch 'master' into branch-protection

Merge branch 'master' into branch-protection

fix + add TESTS

first draft

Add structs and placeholder

Update Branch struct

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/341
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-05-21 17:52:51 +00:00