Comments (6)
- I've reproduced against the latest 3.2, 3.3, 3.4 (3.2.12, 3.3.6, and 3.4.1, respectively).
- Here's the snippet, nb
localhost
is 192.168.208.1, a local docker bridge network host.
func initGerrit() error {
var err error
gerritClient, err = gerrit.NewClient(fmt.Sprintf("http://%s:8080", localhost), nil)
if err != nil {
return fmt.Errorf("initializing gerrit client: %w", err)
}
gerritClient.Authentication.SetBasicAuth("admin", "secret")
data := &gerrit.ProjectInput{
Name: gerritProject,
Branches: []string{gerritBranch},
CreateEmptyCommit: true,
}
if _, _, err := gerritClient.Projects.CreateProject(gerritProject, data); err != nil {
return fmt.Errorf("creating test project: %w", err)
}
return nil
}
It ends up with:
creating test project: API call to http://192.168.208.1:8080/a/projects/test/ failed: 400 Bad Request
from go-gerrit.
I have a patch in hand and will submit a PR shortly:
--- a/go-gerrit/projects.go 2021-09-08 19:04:43.850861477 -0700
+++ b/go-gerrit/projects.go 2021-09-08 19:21:12.533485144 -0700
@@ -37,7 +37,7 @@
Owners []string `json:"owners,omitempty"`
- UseContributorAgreements string `json:"use_contributor_agreements"`
- UseSignedOffBy string `json:"use_signed_off_by"`
- CreateNewChangeForAllNotInTarget string `json:"create_new_change_for_all_not_in_target"`
- UseContentMerge string `json:"use_content_merge"`
- RequireChangeID string `json:"require_change_id"`
+ UseContributorAgreements string `json:"use_contributor_agreements,omitempty"`
+ UseSignedOffBy string `json:"use_signed_off_by,omitempty"`
+ CreateNewChangeForAllNotInTarget string `json:"create_new_change_for_all_not_in_target,omitempty"`
+ UseContentMerge string `json:"use_content_merge,omitempty"`
+ RequireChangeID string `json:"require_change_id,omitempty"`
MaxObjectSizeLimit string `json:"max_object_size_limit,omitempty"`
from go-gerrit.
Hey @wwade,
thanks for reporting the issue.
I have two questions:
- Which Gerrit version do you use?
- Do you have a piece of an example code in Go to reproduce the issue?
from go-gerrit.
Great. Thanks a lot, @wwade.
I will try to find time to reproduce this as soon as I can.
from go-gerrit.
Sure, thanks! FWIW, I think the PR is safe either way :)
from go-gerrit.
Thanks @wwade for raising the issue and following up with a fix.
Fixed in #94
from go-gerrit.
Related Issues (20)
- Update CHANGELOG.md
- Craft a new release HOT 2
- Where to get the revisionID for the GetComment API ? HOT 2
- Projects.SetConfig endpoint fails with 400 Bad Request due to ConfigInput.MaxObjectSizeLimit zero value not being omitted HOT 5
- Contexts HOT 1
- Can't get the library working for repo names containing slashes HOT 1
- `ProjectBaseOptions` improper uri tag for `Skip` field
- API-Methods: Return map/slice directly, rather than a pointer to one
- Proposal: Use Timestamp type for all time fields. HOT 3
- Simpler fix for credentials with characters such as '/'. HOT 2
- Optimize Error-Handling-Code of read body
- Only 500 changes are being pulled HOT 8
- labels should not be pre-escaped HOT 3
- All DELETE api calls returns error 400 (Bad request) HOT 5
- Function DeleteDraftChange should be renamed as DeleteChange HOT 1
- Hello? <crickets> HOT 6
- SetReview support for --project option HOT 2
- Document missing OpenAPI/Swagger-Defintion/API-Spec HOT 2
- Add support for context package HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-gerrit.