Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
fix: 'ip_restriction_ranges' is not a create group field
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremad committed Nov 15, 2024
1 parent cfed26b commit f285de4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ type CreateGroupOptions struct {
ParentID *int `url:"parent_id,omitempty" json:"parent_id,omitempty"`
SharedRunnersMinutesLimit *int `url:"shared_runners_minutes_limit,omitempty" json:"shared_runners_minutes_limit,omitempty"`
ExtraSharedRunnersMinutesLimit *int `url:"extra_shared_runners_minutes_limit,omitempty" json:"extra_shared_runners_minutes_limit,omitempty"`
IPRestrictionRanges *string `url:"ip_restriction_ranges,omitempty" json:"ip_restriction_ranges,omitempty"`
WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"`

// Deprecated: Use EmailsEnabled instead
Expand Down
26 changes: 0 additions & 26 deletions groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,32 +783,6 @@ func TestUnshareGroupFromGroup(t *testing.T) {
}
}

func TestCreateGroupWithIPRestrictionRanges(t *testing.T) {
mux, client := setup(t)

mux.HandleFunc("/api/v4/groups",
func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodPost)
fmt.Fprint(w, `{"id": 1, "name": "g", "path": "g", "ip_restriction_ranges" : "192.168.0.0/24"}`)
})

opt := &CreateGroupOptions{
Name: Ptr("g"),
Path: Ptr("g"),
IPRestrictionRanges: Ptr("192.168.0.0/24"),
}

group, _, err := client.Groups.CreateGroup(opt, nil)
if err != nil {
t.Errorf("Groups.CreateGroup returned error: %v", err)
}

want := &Group{ID: 1, Name: "g", Path: "g", IPRestrictionRanges: "192.168.0.0/24"}
if !reflect.DeepEqual(want, group) {
t.Errorf("Groups.CreateGroup returned %+v, want %+v", group, want)
}
}

func TestUpdateGroupWithIPRestrictionRanges(t *testing.T) {
mux, client := setup(t)

Expand Down

0 comments on commit f285de4

Please sign in to comment.