Skip to content
Snippets Groups Projects

API for downloading latest successful build

Merged Lin Jen-Shin requested to merge artifacts-from-ref-and-build-name-api into master

What does this MR do?

Implement parts of #4255 (closed), particularly the API.

Are there points in the code the reviewer needs to double check?

I still made it that ref could be either branch, tag, or even SHA with:

# ref can't be HEAD, can only be branch/tag name or SHA
scope :latest_successful_for, ->(ref) do
  table = quoted_table_name
  # TODO: Use `where(ref: ref).or(sha: ref)` in Rails 5
  where("#{table}.ref = ? OR #{table}.sha = ?", ref, ref).
    success.order(id: :desc)
end

Because the reasons I put in:

But if you still think that it's not good to do it this way, I'll drop it and let's think about the other way to satisfy the requirement specified in https://gitlab.com/gitlab-org/gitlab-ce/issues/4255#note_13101233 It could be status=any or sha=DEADBEAF

What are the relevant issue numbers?

Part of #4255 (closed)

Does this MR meet the acceptance criteria?

Merge request reports

Checking pipeline status.

Merged by avatar (Mar 29, 2025 12:37pm UTC)

Loading

Pipeline #3755000 passed

Pipeline passed for 4a2a127b on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading