Fix image URL constructions
This MR updates the URL construction for grabbing the images for release post items.
The pattern for attachments/uploads URLs must have changed at some point and we didn't update the code, so when creating release post items, the URL would 404. This should fix the issue so that the CI job can grab the images.
Closes #35296 (closed)
Validation
Testing the code locally in IRB, it outputs the expected URLs.
Testing epic:
# For the epic
puts "Epic group_id: #{epic.group_id}"
puts "Correct URL: https://gitlab.com/-/group/#{epic.group_id}#{real_issue.image_url}"
Output:
Epic group_id: 9970
Correct URL: https://gitlab.com/-/group/9970/uploads/3339963cb7891f2a77a8b638d2cdd694/Screenshot_2025-08-05_at_2.17.42_p.m..png
Testing issue:
issue_url = 'https://gitlab.com/api/v4/projects/278964/issues/358416'
issue_response = URI.open(issue_url).read
issue_hash = JSON.parse(issue_response)
real_gitlab_issue = ReleasePosts::Issue.new(issue_hash, 'secondary')
puts "\nIssue project_id: #{real_gitlab_issue.project_id}"
puts "Correct URL: https://gitlab.com/-/project/#{real_gitlab_issue.project_id}#{real_gitlab_issue.image_url}"
Output:
Issue project_id: 278964
Correct URL: https://gitlab.com/-/project/278964/uploads/f8d9245f51946e519d7ef95d11b75701/Screenshot_2025-09-05_at_11.22.44_a.m..png