Add super class call in the initialization of InternalRelease::Issue

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR modifies the initialize method of the InternalRelease::Issue class by adding a super call after setting the @iteration instance variable. This ensures that the initialization process of the parent classes (including OpenStruct) is properly executed, while still maintaining the specific initialization needs of the InternalRelease::Issue class to prevent the No Method error that we encountered before.

Related to: gitlab-com/gl-infra/delivery#20734 (comment 2264248607)

Testing

For testing purposes, I updated the InternalRelease::Issue class title and assignees method:

def title 
  "TEST PLSSS IGNORE: Internal Release: #{versions_title}"
end

def assignees
# ReleaseManagers::Schedule.new.active_release_managers.collect(&:id)
# rescue ReleaseManagers::Schedule::VersionNotFoundError
  nil 
end

I also set the release_pipeline method of ReleaseTools::Issue class to default to use the fake_pipeline value.

I ran the rake task locally to validate that it will be able to create the test issue and return the URL in the logs

1. Without iteration value: rake "internal:issue" --trace

** Invoke internal:issue (first_time)
** Execute internal:issue
2024-12-18 18:02:01.487664 D ReleaseTools::GitlabClient -- [HTTParty] [2024-12-18 18:02:01 +0800] 200 "GET 
https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues" 2 
2024-12-18 18:02:01.488222 I ReleaseTools::InternalRelease::Issue -- Creating internal release pipeline
--> Issue "TEST PLSSS IGNORE: Internal Release: 17.5.4-internal0, 17.4.6-internal0" created.
2024-12-18 18:02:02.548200 D ReleaseTools::GitlabClient -- [HTTParty] [2024-12-18 18:02:02 +0800] 201 "POST 
https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues" 2307 
    https://gitlab.com/gitlab-org/release/tasks/-/issues/15928
2024-12-18 18:02:03.551169 D ReleaseTools::GitlabClient -- [HTTParty] [2024-12-18 18:02:03 +0800] 200 "GET 
https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues" - 

Created issue: https://gitlab.com/gitlab-org/release/tasks/-/issues/15928

2. When the issue is already created and the same rake task is run, the output will return the URL and the title (expected when the issue exists)

--> Issue "TEST PLSSS IGNORE: Internal Release: 17.5.4-internal0, 17.4.6-internal0" already exists.
    https://gitlab.com/gitlab-org/release/tasks/-/issues/15928
 2024-12-18 18:18:46.114239 D ReleaseTools::GitlabClient -- [HTTParty] [2024-12-18 18:18:46 +0800] 200 "GET 
https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues" - 

3. When iteration is equal to 1: rake "internal:issue[1]" --trace

** Invoke internal:issue (first_time)
** Execute internal:issue
2024-12-18 18:30:45.889431 D ReleaseTools::GitlabClient -- [HTTParty] [2024-12-18 18:30:45 +0800] 200 "GET 
https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues" 2 
2024-12-18 18:30:45.889519 I ReleaseTools::InternalRelease::Issue -- Creating internal release pipeline
--> Issue "TEST PLSSS IGNORE: Internal Release: 17.5.4-internal1, 17.4.6-internal1" created.
2024-12-18 18:30:46.774898 D ReleaseTools::GitlabClient -- [HTTParty] [2024-12-18 18:30:46 +0800] 201 "POST 
https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues" 2307 
    https://gitlab.com/gitlab-org/release/tasks/-/issues/15929
2024-12-18 18:30:47.600178 D ReleaseTools::GitlabClient -- [HTTParty] [2024-12-18 18:30:47 +0800] 200 "GET 
https://gitlab.com/api/v4/projects/gitlab-org%2Frelease%2Ftasks/issues" -

Created issue: https://gitlab.com/gitlab-org/release/tasks/-/issues/15929

Author Check-list

  • Has documentation been updated?
Edited by Mawreen Dela Cruz

Merge request reports

Loading