Skip to content

Link external CI/CD status badges to their URLs if present

Description

After introducing detailed status objects for builds, and commit statuses in general, in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7989, badge for generic commit status no longer links to generic_commit_status.target_url.

Proposal

We should create a separate statuses factory with Status::Generic::Common helpers linking to generic_commit_status.target_url as details_path and has_details? method where we check can?(current_user, :read_commit_status, generic_commit_status).

Links / references

See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7989/diffs#note_19998464