go-gitea / go-sdk Goto Github PK
View Code? Open in Web Editor NEWThis project forked from gogs/go-gogs-client
Gitea: Golang SDK, moved to https://gitea.com/gitea/go-sdk
Home Page: http://gitea.io
License: MIT License
This project forked from gogs/go-gogs-client
Gitea: Golang SDK, moved to https://gitea.com/gitea/go-sdk
Home Page: http://gitea.io
License: MIT License
It seems that MergePullRequest is out of date for gitea 1.6.
We have this: https://github.com/go-gitea/go-sdk/blob/master/gitea/pull.go#L136
But gitea need additional parameters to merge: https://github.com/go-gitea/gitea/blob/v1.6.4/modules/auth/repo_form.go#L362
Minimalist valid requests looks like:
{
"do": "merge"
}
When calling CreatePullRequest(owner, repo string, opt CreatePullRequestOption)
, I am facing an issue since I do not know how to specify information about the base and head repos, since they are simple strings in the CreatePullRequestOption
struct.
I would expect to be able to specify at least some repo information (such as id, name, owner, etc.) and branch information.
But I do not see how to do it since these fields are simple strings.
Any hints?
Currently we have a 12% for go lint.
I suggest to make multiple PR by files to improve this and to raise the percent higher.
Similar to #40, I noticed this when trying to use this SDK to write a Terraform provider plugin.
package gitea
import (
"fmt"
"testing"
"code.gitea.io/sdk/gitea"
)
func TestGiteaUserCreate(t *testing.T) {
client := gitea.NewClient("http://localhost:3000", "978fd3ee4f71d6cf8a87556201d37293d719230d")
user, err := client.AdminCreateUser(gitea.CreateUserOption{
Email: "[email protected]",
LoginName: "random",
Username: "random",
})
if err != nil {
t.Fatal(err)
}
fmt.Printf("%#v", user)
}
I would like to implement a script to automatically synchronize all mirrored warehouses
On README.md there is a link to the documentation on https://godoc.org/code.gitea.io/sdk/gitea
Although that is not working.
So any change is requested to pass golint (see #21 (comment))
https://godoc.org/code.gitea.io/sdk/gitea#Client.EditRepoGitHook
i use this api to connect my gitea, but it happened in 404
my gitea version is 1.8.0
Hi,
According to the Swagger API, there is an endpoint to delete an organization: https://try.gitea.io/api/swagger#/organization/orgDelete.
I can not find any method in the SDK.
Any idea how to perform the deletion ?
Thanks
Trying to use gitea go sdk (import "code.gitea.io/sdk/gitea"
), the
client.AdminCreateOrg() function returns the following error
json: cannot unmarshal array into Go value of type map[string]interface {}
running with gitea server in docker : 2016 Gitea Version: 1.0.0+276-g9d2b8302
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
i need to list all the commits of one repository, but i can't find the api?
I just tried on 1.7.4 and if I call GetMyUserInfo
IsAdmin
is always false
... even if I'm really an admin
Originally posted by @bclermont in #151 (comment)
Hey @JonasFranzDEV, I get the following compilation error using the latest commit:
# bitbucket.org/gridarrow/gridarrow-manager/vendor/code.gitea.io/sdk/gitea
vendor/code.gitea.io/sdk/gitea/attachment.go:11:2: imported and not used: "io/ioutil"
vendor/code.gitea.io/sdk/gitea/attachment.go:58:21: cannot use file (type *io.Reader) as type io.Reader in argument to io.Copy:
*io.Reader is pointer to interface, not interface
This is with the following glide dependency:
- package: code.gitea.io/sdk
subpackages:
- gitea
Previous commit works fine for me. Not a go expert, so perhaps it's my bad somehow...
go-sdk depends currently on code.gitea.io/gitea that implicates that all dependencies of gitea are needed to for go-sdk. We should consider fixing this since it will increase the size of binaries of tools using the sdk.
I've tried to create an android library out of the gitea go-sdk via gomobile. But gomobile fails with the following errors.
Executed command:
gomobile bind -target android -o gitea.aar -javapkg io.gitea.code.sdk code.gitea.io/sdk/gitea
Error(s):
gomobile: go build -pkgdir=$GOPATH/pkg/gomobile/pkg_android_arm -buildmode=c-shared -o=/tmp/gomobile-work-631988229/android/src/main/jniLibs/armeabi-v7a/libgojni.so /tmp/gomobile-work-631988229/androidlib/main.go failed: exit status 2
# _/tmp/gomobile-work-631988229/gomobile_bind
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:1998:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_CreatePayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:1991:1: note: previous definition is here
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:3658:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_IssuePayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:3651:1: note: previous definition is here
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5048:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_PullRequestPayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5041:1: note: previous definition is here
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5171:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_PushPayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5164:1: note: previous definition is here
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5818:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_RepositoryPayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5811:1: note: previous definition is here
I was trying to create a webhook and was getting this opaque message back:
error: json: cannot unmarshal array into Go value of type map[string]interface {}
After a bit of debugging it turned out a 422 was being returned with nice error message that was hidden.
A PR is on its way shortly to fix this to return the issue with the missing data
The UI lets you configure a Repository to Allow Pull Request merge commits and so forth:
when creating a Repository via the go API all these are false. This means if you create a Pull Request there's no UI in gitea that lets you merge the PR.
I don't see any way to specify or default these values in the go-gitea REST API - so it'd be nice to add these flags so we can pass them into the CreateRepo method
How can someone set up a test environment for adding tests to this SDK? I'm at a loss as I don't quite understand how the main gitea project is doing tests. I'd think it's possible to do something with Docker, but I'm not terribly confident that you can spin up a gitea server and then run go test
with it.
Would it be possible to set up something equivalent to a golden file/db so you could use it as a baseline for tests?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.