Skip to content
Snippets Groups Projects

Return empty array when commit has no statuses in API

Merged Grzegorz Bizon requested to merge fix/commit-status-api-improvement into master

This makes API endpoint for Commit Statuses return empty array instead of 404 when commit exists, but has no statuses.

Closes #3080 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
18 18 # Examples:
19 19 # GET /projects/:id/repository/commits/:sha/statuses
20 20 get ':id/repository/commits/:sha/statuses' do
21 authorize! :read_commit_status, user_project
22 sha = params[:sha]
23 ci_commit = user_project.ci_commit(sha)
24 not_found! 'Commit' unless ci_commit
21 authorize!(:read_commit_status, user_project)
22
23 ci_commit = user_project.ci_commit(params[:sha])
24 not_found!('Commit') unless user_project.commit(params[:sha])
  • Grzegorz Bizon Added 1 commit:

    Added 1 commit:

    • 85a461e0 - Check if commit exists first in commit status API
  • Reassigned to @DouweM

  • Reassigned to @grzesiek

  • Grzegorz Bizon Added 1 commit:

    Added 1 commit:

    • 278f4423 - Improve commit status API specs
  • Author Maintainer

    @ayufan Updated, please check it out :)

  • Reassigned to @DouweM

  • Douwe Maan Status changed to merged

    Status changed to merged

  • Douwe Maan mentioned in commit 9b3c1a8c

    mentioned in commit 9b3c1a8c

  • Please register or sign in to reply
    Loading