From 286769bc50a43f618b66fdaa99b76a2875c98207 Mon Sep 17 00:00:00 2001 From: Hakki Ceylan Date: Sun, 1 Oct 2023 00:29:30 +0300 Subject: [PATCH 1/3] feat: add resource_iteration_events with test Co-authored-by: Hakki Ceylan <21046119+oSoloTurk@users.noreply.github.com> Co-authored-by: Yavuz Turk <39865763+yavuzturk96@users.noreply.github.com> --- gitlab.go | 2 + resource_iteration_events.go | 122 ++++++++++++++++++ resource_iteration_events_test.go | 205 ++++++++++++++++++++++++++++++ 3 files changed, 329 insertions(+) create mode 100644 resource_iteration_events.go create mode 100644 resource_iteration_events_test.go diff --git a/gitlab.go b/gitlab.go index 658628881..aba0eba53 100644 --- a/gitlab.go +++ b/gitlab.go @@ -201,6 +201,7 @@ type Client struct { Repositories *RepositoriesService RepositoryFiles *RepositoryFilesService RepositorySubmodules *RepositorySubmodulesService + ResourceIterationEvents *ResourceIterationEventsService ResourceLabelEvents *ResourceLabelEventsService ResourceMilestoneEvents *ResourceMilestoneEventsService ResourceStateEvents *ResourceStateEventsService @@ -424,6 +425,7 @@ func newClient(options ...ClientOptionFunc) (*Client, error) { c.Repositories = &RepositoriesService{client: c} c.RepositoryFiles = &RepositoryFilesService{client: c} c.RepositorySubmodules = &RepositorySubmodulesService{client: c} + c.ResourceIterationEvents = &ResourceIterationEventsService{client: c} c.ResourceLabelEvents = &ResourceLabelEventsService{client: c} c.ResourceMilestoneEvents = &ResourceMilestoneEventsService{client: c} c.ResourceStateEvents = &ResourceStateEventsService{client: c} diff --git a/resource_iteration_events.go b/resource_iteration_events.go new file mode 100644 index 000000000..64bbc38a6 --- /dev/null +++ b/resource_iteration_events.go @@ -0,0 +1,122 @@ +// +// Copyright 2023, Hakki Ceylan, Yavuz Turk +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +package gitlab + +import ( + "fmt" + "net/http" + "time" +) + +// ResourceIterationEventsService handles communication with the event related +// methods of the GitLab API. +// +// GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html +type ResourceIterationEventsService struct { + client *Client +} + +// IterationEvent represents a resource iteration event. +// +// GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html +type IterationEvent struct { + ID int `json:"id"` + Action string `json:"action"` + CreatedAt *time.Time `json:"created_at"` + ResourceType string `json:"resource_type"` + ResourceID int `json:"resource_id"` + User *BasicUser `json:"user"` + Iteration *ProjectIssueIteration `json:"iteration"` +} + +// ProjectIssueIteration represents a project issue iteration. +// +// GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html +type ProjectIssueIteration struct { + Id int `json:"id"` + Iid int `json:"iid"` + Sequence int `json:"sequence"` + GroupId int `json:"group_id"` + Title string `json:"title"` + Description string `json:"description"` + State int `json:"state"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + DueDate *ISOTime `json:"due_date"` + StartDate *ISOTime `json:"start_date"` + WebUrl string `json:"web_url"` +} + +// ListIterationEventsOptions represents the options for all resource state events +// list methods. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/resource_iteration_events.html#list-project-issue-iteration-events +type ListIterationEventsOptions struct { + ListOptions +} + +// ListIssueIterationEvents retrieves resource iteration events for the specified +// project and issue. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/resource_iteration_events.html#list-project-issue-iteration-events +func (s *ResourceIterationEventsService) ListIssueIterationEvents(pid interface{}, issue int, opt *ListIterationEventsOptions, options ...RequestOptionFunc) ([]*IterationEvent, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/issues/%d/resource_iteration_events", PathEscape(project), issue) + + req, err := s.client.NewRequest(http.MethodGet, u, opt, options) + if err != nil { + return nil, nil, err + } + + var mes []*IterationEvent + resp, err := s.client.Do(req, &mes) + if err != nil { + return nil, resp, err + } + + return mes, resp, nil +} + +// GetIssueIterationEvent gets a single issue iteration event. +// +// GitLab API docs: +// https://docs.gitlab.com/ee/api/resource_iteration_events.html#get-single-issue-iteration-event +func (s *ResourceIterationEventsService) GetIssueIterationEvent(pid interface{}, issue int, event int, options ...RequestOptionFunc) (*IterationEvent, *Response, error) { + project, err := parseID(pid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("projects/%s/issues/%d/resource_iteration_events/%d", PathEscape(project), issue, event) + + req, err := s.client.NewRequest(http.MethodGet, u, nil, options) + if err != nil { + return nil, nil, err + } + + me := new(IterationEvent) + resp, err := s.client.Do(req, me) + if err != nil { + return nil, resp, err + } + + return me, resp, nil +} diff --git a/resource_iteration_events_test.go b/resource_iteration_events_test.go new file mode 100644 index 000000000..fb1b7c440 --- /dev/null +++ b/resource_iteration_events_test.go @@ -0,0 +1,205 @@ +// Copyright 2023, Hakki Ceylan, Yavuz Turk +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package gitlab + +import ( + "fmt" + "net/http" + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestListIssueIterationEvents(t *testing.T) { + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/5/issues/11/resource_iteration_events", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + fmt.Fprintf(w, `[ + { + "id": 142, + "user": { + "id": 1, + "username": "root", + "name": "Administrator", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "web_url": "http://gitlab.example.com/root" + }, + "created_at": "2023-09-22T06:51:04.801Z", + "resource_type": "Issue", + "resource_id": 11, + "iteration": { + "id": 133, + "iid": 1, + "sequence": 1, + "group_id": 153, + "title": "Iteration 1", + "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + "state": 1, + "created_at": "2023-07-15T00:05:06.509Z", + "updated_at": "2023-09-24T00:05:10.476Z", + "start_date": "2023-09-17", + "due_date": "2023-09-23", + "web_url": "" + }, + "action": "add" + } + ]`) + }) + + opt := &ListIterationEventsOptions{ListOptions{Page: 1, PerPage: 10}} + + mes, _, err := client.ResourceIterationEvents.ListIssueIterationEvents(5, 11, opt) + require.NoError(t, err) + + eventCreatedAt, err := time.Parse(time.RFC3339, "2023-09-22T06:51:04.801Z") + require.NoError(t, err) + + createdAt, err := time.Parse(time.RFC3339, "2023-07-15T00:05:06.509Z") + require.NoError(t, err) + + updatedAt, err := time.Parse(time.RFC3339, "2023-09-24T00:05:10.476Z") + require.NoError(t, err) + + startDate, err := time.Parse(time.RFC3339, "2023-09-17T00:00:00.000Z") + require.NoError(t, err) + startDateISOTime := ISOTime(startDate) + + dueDate, err := time.Parse(time.RFC3339, "2023-09-23T00:00:00.000Z") + require.NoError(t, err) + dueDateISOTime := ISOTime(dueDate) + + want := []*IterationEvent{{ + ID: 142, + User: &BasicUser{ + ID: 1, + Username: "root", + Name: "Administrator", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + WebURL: "http://gitlab.example.com/root", + }, + ResourceType: "Issue", + ResourceID: 11, + CreatedAt: &eventCreatedAt, + Iteration: &ProjectIssueIteration{ + Id: 133, + Iid: 1, + Sequence: 1, + GroupId: 153, + Title: "Iteration 1", + Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + State: 1, + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, + StartDate: &startDateISOTime, + DueDate: &dueDateISOTime, + WebUrl: "", + }, + Action: "add", + }} + require.Equal(t, want, mes) +} + +func TestGetIssueIterationEvent(t *testing.T) { + mux, client := setup(t) + + mux.HandleFunc("/api/v4/projects/5/issues/11/resource_iteration_events/143", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, http.MethodGet) + fmt.Fprintf(w, ` + { + "id": 142, + "user": { + "id": 1, + "username": "root", + "name": "Administrator", + "state": "active", + "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "web_url": "http://gitlab.example.com/root" + }, + "created_at": "2023-09-22T06:51:04.801Z", + "resource_type": "Issue", + "resource_id": 11, + "iteration": { + "id": 133, + "iid": 1, + "sequence": 1, + "group_id": 153, + "title": "Iteration 1", + "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + "state": 1, + "created_at": "2023-07-15T00:05:06.509Z", + "updated_at": "2023-09-24T00:05:10.476Z", + "start_date": "2023-09-17", + "due_date": "2023-09-23", + "web_url": "" + }, + "action": "add" + }`, + ) + }) + + me, _, err := client.ResourceIterationEvents.GetIssueIterationEvent(5, 11, 143) + require.NoError(t, err) + + eventCreatedAt, err := time.Parse(time.RFC3339, "2023-09-22T06:51:04.801Z") + require.NoError(t, err) + + createdAt, err := time.Parse(time.RFC3339, "2023-07-15T00:05:06.509Z") + require.NoError(t, err) + + updatedAt, err := time.Parse(time.RFC3339, "2023-09-24T00:05:10.476Z") + require.NoError(t, err) + + startDate, err := time.Parse(time.RFC3339, "2023-09-17T00:00:00.000Z") + require.NoError(t, err) + startDateISOTime := ISOTime(startDate) + + dueDate, err := time.Parse(time.RFC3339, "2023-09-23T00:00:00.000Z") + require.NoError(t, err) + dueDateISOTime := ISOTime(dueDate) + + want := &IterationEvent{ + ID: 142, + User: &BasicUser{ + ID: 1, + Username: "root", + Name: "Administrator", + State: "active", + AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + WebURL: "http://gitlab.example.com/root", + }, + ResourceType: "Issue", + ResourceID: 11, + CreatedAt: &eventCreatedAt, + Iteration: &ProjectIssueIteration{ + Id: 133, + Iid: 1, + Sequence: 1, + GroupId: 153, + Title: "Iteration 1", + Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", + State: 1, + CreatedAt: &createdAt, + UpdatedAt: &updatedAt, + StartDate: &startDateISOTime, + DueDate: &dueDateISOTime, + WebUrl: "", + }, + Action: "add", + } + require.Equal(t, want, me) +} From 7b65344e9aa90410eeaadf7c4bf54f130cac543c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yavuz=20T=C3=BCrk?= Date: Sun, 1 Oct 2023 17:19:52 +0300 Subject: [PATCH 2/3] feat: naming conventions updated --- resource_iteration_events.go | 12 +++--- resource_iteration_events_test.go | 68 +++++++++++-------------------- 2 files changed, 29 insertions(+), 51 deletions(-) diff --git a/resource_iteration_events.go b/resource_iteration_events.go index 64bbc38a6..6c7912e4d 100644 --- a/resource_iteration_events.go +++ b/resource_iteration_events.go @@ -87,13 +87,13 @@ func (s *ResourceIterationEventsService) ListIssueIterationEvents(pid interface{ return nil, nil, err } - var mes []*IterationEvent - resp, err := s.client.Do(req, &mes) + var ies []*IterationEvent + resp, err := s.client.Do(req, &ies) if err != nil { return nil, resp, err } - return mes, resp, nil + return ies, resp, nil } // GetIssueIterationEvent gets a single issue iteration event. @@ -112,11 +112,11 @@ func (s *ResourceIterationEventsService) GetIssueIterationEvent(pid interface{}, return nil, nil, err } - me := new(IterationEvent) - resp, err := s.client.Do(req, me) + ie := new(IterationEvent) + resp, err := s.client.Do(req, ie) if err != nil { return nil, resp, err } - return me, resp, nil + return ie, resp, nil } diff --git a/resource_iteration_events_test.go b/resource_iteration_events_test.go index fb1b7c440..e470692c6 100644 --- a/resource_iteration_events_test.go +++ b/resource_iteration_events_test.go @@ -22,7 +22,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestListIssueIterationEvents(t *testing.T) { +func TestListIssueIterationEventsService_ListIssueIterationEvents(t *testing.T) { mux, client := setup(t) mux.HandleFunc("/api/v4/projects/5/issues/11/resource_iteration_events", func(w http.ResponseWriter, r *http.Request) { @@ -36,7 +36,7 @@ func TestListIssueIterationEvents(t *testing.T) { "name": "Administrator", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", - "web_url": "http://gitlab.example.com/root" + "web_url": "https://gitlab.example.com/root" }, "created_at": "2023-09-22T06:51:04.801Z", "resource_type": "Issue", @@ -53,7 +53,7 @@ func TestListIssueIterationEvents(t *testing.T) { "updated_at": "2023-09-24T00:05:10.476Z", "start_date": "2023-09-17", "due_date": "2023-09-23", - "web_url": "" + "web_url": "https://gitlab.example.com/groups/project/-/iterations/1" }, "action": "add" } @@ -65,23 +65,12 @@ func TestListIssueIterationEvents(t *testing.T) { mes, _, err := client.ResourceIterationEvents.ListIssueIterationEvents(5, 11, opt) require.NoError(t, err) - eventCreatedAt, err := time.Parse(time.RFC3339, "2023-09-22T06:51:04.801Z") + startDateISOTime, err := ParseISOTime("2023-09-17") require.NoError(t, err) - createdAt, err := time.Parse(time.RFC3339, "2023-07-15T00:05:06.509Z") + dueDateISOTime, err := ParseISOTime("2023-09-23") require.NoError(t, err) - updatedAt, err := time.Parse(time.RFC3339, "2023-09-24T00:05:10.476Z") - require.NoError(t, err) - - startDate, err := time.Parse(time.RFC3339, "2023-09-17T00:00:00.000Z") - require.NoError(t, err) - startDateISOTime := ISOTime(startDate) - - dueDate, err := time.Parse(time.RFC3339, "2023-09-23T00:00:00.000Z") - require.NoError(t, err) - dueDateISOTime := ISOTime(dueDate) - want := []*IterationEvent{{ ID: 142, User: &BasicUser{ @@ -90,11 +79,11 @@ func TestListIssueIterationEvents(t *testing.T) { Name: "Administrator", State: "active", AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", - WebURL: "http://gitlab.example.com/root", + WebURL: "https://gitlab.example.com/root", }, ResourceType: "Issue", ResourceID: 11, - CreatedAt: &eventCreatedAt, + CreatedAt: Time(time.Date(2023, time.September, 22, 06, 51, 04, 801000000, time.UTC)), Iteration: &ProjectIssueIteration{ Id: 133, Iid: 1, @@ -103,32 +92,32 @@ func TestListIssueIterationEvents(t *testing.T) { Title: "Iteration 1", Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", State: 1, - CreatedAt: &createdAt, - UpdatedAt: &updatedAt, + CreatedAt: Time(time.Date(2023, time.July, 15, 00, 05, 06, 509000000, time.UTC)), + UpdatedAt: Time(time.Date(2023, time.September, 24, 00, 05, 10, 476000000, time.UTC)), StartDate: &startDateISOTime, DueDate: &dueDateISOTime, - WebUrl: "", + WebUrl: "https://gitlab.example.com/groups/project/-/iterations/1", }, Action: "add", }} require.Equal(t, want, mes) } -func TestGetIssueIterationEvent(t *testing.T) { +func TestListIssueIterationEventsService_GetIssueIterationEvent(t *testing.T) { mux, client := setup(t) mux.HandleFunc("/api/v4/projects/5/issues/11/resource_iteration_events/143", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, http.MethodGet) fmt.Fprintf(w, ` - { - "id": 142, + { + "id": 143, "user": { "id": 1, "username": "root", "name": "Administrator", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", - "web_url": "http://gitlab.example.com/root" + "web_url": "https://gitlab.example.com/root" }, "created_at": "2023-09-22T06:51:04.801Z", "resource_type": "Issue", @@ -145,7 +134,7 @@ func TestGetIssueIterationEvent(t *testing.T) { "updated_at": "2023-09-24T00:05:10.476Z", "start_date": "2023-09-17", "due_date": "2023-09-23", - "web_url": "" + "web_url": "https://gitlab.example.com/groups/project/-/iterations/2" }, "action": "add" }`, @@ -155,36 +144,25 @@ func TestGetIssueIterationEvent(t *testing.T) { me, _, err := client.ResourceIterationEvents.GetIssueIterationEvent(5, 11, 143) require.NoError(t, err) - eventCreatedAt, err := time.Parse(time.RFC3339, "2023-09-22T06:51:04.801Z") + startDateISOTime, err := ParseISOTime("2023-09-17") require.NoError(t, err) - createdAt, err := time.Parse(time.RFC3339, "2023-07-15T00:05:06.509Z") + dueDateISOTime, err := ParseISOTime("2023-09-23") require.NoError(t, err) - updatedAt, err := time.Parse(time.RFC3339, "2023-09-24T00:05:10.476Z") - require.NoError(t, err) - - startDate, err := time.Parse(time.RFC3339, "2023-09-17T00:00:00.000Z") - require.NoError(t, err) - startDateISOTime := ISOTime(startDate) - - dueDate, err := time.Parse(time.RFC3339, "2023-09-23T00:00:00.000Z") - require.NoError(t, err) - dueDateISOTime := ISOTime(dueDate) - want := &IterationEvent{ - ID: 142, + ID: 143, User: &BasicUser{ ID: 1, Username: "root", Name: "Administrator", State: "active", AvatarURL: "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", - WebURL: "http://gitlab.example.com/root", + WebURL: "https://gitlab.example.com/root", }, ResourceType: "Issue", ResourceID: 11, - CreatedAt: &eventCreatedAt, + CreatedAt: Time(time.Date(2023, time.September, 22, 06, 51, 04, 801000000, time.UTC)), Iteration: &ProjectIssueIteration{ Id: 133, Iid: 1, @@ -193,11 +171,11 @@ func TestGetIssueIterationEvent(t *testing.T) { Title: "Iteration 1", Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", State: 1, - CreatedAt: &createdAt, - UpdatedAt: &updatedAt, + CreatedAt: Time(time.Date(2023, time.July, 15, 00, 05, 06, 509000000, time.UTC)), + UpdatedAt: Time(time.Date(2023, time.September, 24, 00, 05, 10, 476000000, time.UTC)), StartDate: &startDateISOTime, DueDate: &dueDateISOTime, - WebUrl: "", + WebUrl: "https://gitlab.example.com/groups/project/-/iterations/2", }, Action: "add", } From 5553955487979b32fc1001a6f6e7d59ea0b957fe Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Sun, 15 Oct 2023 15:04:02 +0200 Subject: [PATCH 3/3] Minor tweaks preparing to merge --- resource_iteration_events.go | 32 +++++++++++++++---------------- resource_iteration_events_test.go | 28 +++++++++++++-------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/resource_iteration_events.go b/resource_iteration_events.go index 6c7912e4d..7ad354a7b 100644 --- a/resource_iteration_events.go +++ b/resource_iteration_events.go @@ -34,21 +34,21 @@ type ResourceIterationEventsService struct { // // GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html type IterationEvent struct { - ID int `json:"id"` - Action string `json:"action"` - CreatedAt *time.Time `json:"created_at"` - ResourceType string `json:"resource_type"` - ResourceID int `json:"resource_id"` - User *BasicUser `json:"user"` - Iteration *ProjectIssueIteration `json:"iteration"` + ID int `json:"id"` + User *BasicUser `json:"user"` + CreatedAt *time.Time `json:"created_at"` + ResourceType string `json:"resource_type"` + ResourceID int `json:"resource_id"` + Iteration *Iteration `json:"iteration"` + Action string `json:"action"` } -// ProjectIssueIteration represents a project issue iteration. +// Iteration represents a project issue iteration. // // GitLab API docs: https://docs.gitlab.com/ee/api/resource_iteration_events.html -type ProjectIssueIteration struct { - Id int `json:"id"` - Iid int `json:"iid"` +type Iteration struct { + ID int `json:"id"` + IID int `json:"iid"` Sequence int `json:"sequence"` GroupId int `json:"group_id"` Title string `json:"title"` @@ -58,11 +58,11 @@ type ProjectIssueIteration struct { UpdatedAt *time.Time `json:"updated_at"` DueDate *ISOTime `json:"due_date"` StartDate *ISOTime `json:"start_date"` - WebUrl string `json:"web_url"` + WebURL string `json:"web_url"` } -// ListIterationEventsOptions represents the options for all resource state events -// list methods. +// ListIterationEventsOptions represents the options for all resource state +// events list methods. // // GitLab API docs: // https://docs.gitlab.com/ee/api/resource_iteration_events.html#list-project-issue-iteration-events @@ -70,8 +70,8 @@ type ListIterationEventsOptions struct { ListOptions } -// ListIssueIterationEvents retrieves resource iteration events for the specified -// project and issue. +// ListIssueIterationEvents retrieves resource iteration events for the +// specified project and issue. // // GitLab API docs: // https://docs.gitlab.com/ee/api/resource_iteration_events.html#list-project-issue-iteration-events diff --git a/resource_iteration_events_test.go b/resource_iteration_events_test.go index e470692c6..f4c707bcd 100644 --- a/resource_iteration_events_test.go +++ b/resource_iteration_events_test.go @@ -83,20 +83,20 @@ func TestListIssueIterationEventsService_ListIssueIterationEvents(t *testing.T) }, ResourceType: "Issue", ResourceID: 11, - CreatedAt: Time(time.Date(2023, time.September, 22, 06, 51, 04, 801000000, time.UTC)), - Iteration: &ProjectIssueIteration{ - Id: 133, - Iid: 1, + CreatedAt: Time(time.Date(2023, time.September, 22, 0o6, 51, 0o4, 801000000, time.UTC)), + Iteration: &Iteration{ + ID: 133, + IID: 1, Sequence: 1, GroupId: 153, Title: "Iteration 1", Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", State: 1, - CreatedAt: Time(time.Date(2023, time.July, 15, 00, 05, 06, 509000000, time.UTC)), - UpdatedAt: Time(time.Date(2023, time.September, 24, 00, 05, 10, 476000000, time.UTC)), + CreatedAt: Time(time.Date(2023, time.July, 15, 0o0, 0o5, 0o6, 509000000, time.UTC)), + UpdatedAt: Time(time.Date(2023, time.September, 24, 0o0, 0o5, 10, 476000000, time.UTC)), StartDate: &startDateISOTime, DueDate: &dueDateISOTime, - WebUrl: "https://gitlab.example.com/groups/project/-/iterations/1", + WebURL: "https://gitlab.example.com/groups/project/-/iterations/1", }, Action: "add", }} @@ -162,20 +162,20 @@ func TestListIssueIterationEventsService_GetIssueIterationEvent(t *testing.T) { }, ResourceType: "Issue", ResourceID: 11, - CreatedAt: Time(time.Date(2023, time.September, 22, 06, 51, 04, 801000000, time.UTC)), - Iteration: &ProjectIssueIteration{ - Id: 133, - Iid: 1, + CreatedAt: Time(time.Date(2023, time.September, 22, 0o6, 51, 0o4, 801000000, time.UTC)), + Iteration: &Iteration{ + ID: 133, + IID: 1, Sequence: 1, GroupId: 153, Title: "Iteration 1", Description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", State: 1, - CreatedAt: Time(time.Date(2023, time.July, 15, 00, 05, 06, 509000000, time.UTC)), - UpdatedAt: Time(time.Date(2023, time.September, 24, 00, 05, 10, 476000000, time.UTC)), + CreatedAt: Time(time.Date(2023, time.July, 15, 0o0, 0o5, 0o6, 509000000, time.UTC)), + UpdatedAt: Time(time.Date(2023, time.September, 24, 0o0, 0o5, 10, 476000000, time.UTC)), StartDate: &startDateISOTime, DueDate: &dueDateISOTime, - WebUrl: "https://gitlab.example.com/groups/project/-/iterations/2", + WebURL: "https://gitlab.example.com/groups/project/-/iterations/2", }, Action: "add", }