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

Commit f285de4

Browse files
committed
fix: 'ip_restriction_ranges' is not a create group field
1 parent cfed26b commit f285de4

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

groups.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ type CreateGroupOptions struct {
384384
ParentID *int `url:"parent_id,omitempty" json:"parent_id,omitempty"`
385385
SharedRunnersMinutesLimit *int `url:"shared_runners_minutes_limit,omitempty" json:"shared_runners_minutes_limit,omitempty"`
386386
ExtraSharedRunnersMinutesLimit *int `url:"extra_shared_runners_minutes_limit,omitempty" json:"extra_shared_runners_minutes_limit,omitempty"`
387-
IPRestrictionRanges *string `url:"ip_restriction_ranges,omitempty" json:"ip_restriction_ranges,omitempty"`
388387
WikiAccessLevel *AccessControlValue `url:"wiki_access_level,omitempty" json:"wiki_access_level,omitempty"`
389388

390389
// Deprecated: Use EmailsEnabled instead

groups_test.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -783,32 +783,6 @@ func TestUnshareGroupFromGroup(t *testing.T) {
783783
}
784784
}
785785

786-
func TestCreateGroupWithIPRestrictionRanges(t *testing.T) {
787-
mux, client := setup(t)
788-
789-
mux.HandleFunc("/api/v4/groups",
790-
func(w http.ResponseWriter, r *http.Request) {
791-
testMethod(t, r, http.MethodPost)
792-
fmt.Fprint(w, `{"id": 1, "name": "g", "path": "g", "ip_restriction_ranges" : "192.168.0.0/24"}`)
793-
})
794-
795-
opt := &CreateGroupOptions{
796-
Name: Ptr("g"),
797-
Path: Ptr("g"),
798-
IPRestrictionRanges: Ptr("192.168.0.0/24"),
799-
}
800-
801-
group, _, err := client.Groups.CreateGroup(opt, nil)
802-
if err != nil {
803-
t.Errorf("Groups.CreateGroup returned error: %v", err)
804-
}
805-
806-
want := &Group{ID: 1, Name: "g", Path: "g", IPRestrictionRanges: "192.168.0.0/24"}
807-
if !reflect.DeepEqual(want, group) {
808-
t.Errorf("Groups.CreateGroup returned %+v, want %+v", group, want)
809-
}
810-
}
811-
812786
func TestUpdateGroupWithIPRestrictionRanges(t *testing.T) {
813787
mux, client := setup(t)
814788

0 commit comments

Comments
 (0)