Skip to content

fix: Fix problem with SetConfig field #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ type ConfigInput struct {
UseSignedOffBy string `json:"use_signed_off_by,omitempty"`
CreateNewChangeForAllNotInTarget string `json:"create_new_change_for_all_not_in_target,omitempty"`
RequireChangeID string `json:"require_change_id,omitempty"`
MaxObjectSizeLimit MaxObjectSizeLimitInfo `json:"max_object_size_limit,omitempty"`
MaxObjectSizeLimit interface{} `json:"max_object_size_limit,omitempty"`
SubmitType string `json:"submit_type,omitempty"`
State string `json:"state,omitempty"`
PluginConfigValues map[string]map[string]string `json:"plugin_config_values,omitempty"`
Expand Down
25 changes: 25 additions & 0 deletions projects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,28 @@ func TestProjectsService_GetBranch(t *testing.T) {
}
}
}

func TestProjectsService_SetConfig(t *testing.T) {
setup()
defer teardown()

var configInput gerrit.ConfigInput

// test server url
instance := "https://gerrit-test.uniontech.com/"
client, err := gerrit.NewClient(instance, nil)
if err != nil {
panic(err)
}

// login username and password
client.Authentication.SetBasicAuth("", "")

configInput.Description = "test change description"

_, _, err = client.Projects.SetConfig("my-test", &configInput)
if err != nil {
t.Errorf("Projects.SetConfig returned error: %v", err)
}

}