Show job description on the job details page

What does this MR do and why?

Shows the job description in the right sidebar of the job details page.

A job name is often too short to explain what a job is for. !268380 (merged) added the description keyword. !272225 (merged) added the jobDescription field to CiJob. This MR requests that field.

  • The sidebar details block reads its values from the REST job, which does not carry the description. sidebar_job_details_container.vue runs the getJob query for jobDescription. The page header already runs the same query with the same variables, so Apollo serves it from the cache.
  • The Description row shows in the details block at the top of the right sidebar. It comes right after the Queued row, and before the Timeout, Runner, and Source rows. Nothing renders when the job has no description, for example for jobs from archived pipelines.
  • The job keyword docs now say where the description shows.

This MR targets the branch of !272225 (merged). GitLab retargets it to master when that MR merges.

I did not add a feature flag. The change only shows a value that users set themselves.

References

Screenshots or screen recordings

Before: job without a description After: job with a description
Job details page of a job without a description. The right sidebar has no Description row. Job details page of a job with a description. The right sidebar shows a Description row.

A description at the 128 character limit:

Job details page of a job with a description of 128 characters. The right sidebar shows the full text in the Description row.

How to set up and validate locally

  1. Commit a .gitlab-ci.yml with job descriptions and run the pipeline. The long-description job uses the 128 character limit:

    rspec:
      script: echo
      description: Unit tests for the application
    
    rubocop:
      script: echo
    
    long-description:
      script: echo
      description: Runs the complete unit test suite for the application, including slow tests, and publishes the coverage report for every change.
  2. Open the rspec job page. The details block in the right sidebar shows a Description row with Unit tests for the application, after the Queued row and before the Timeout, Runner, and Source rows.

  3. Open the rubocop job page. The sidebar shows no Description row.

  4. Open the long-description job page. The sidebar shows the full text.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

  • Changelog: the commit has a Changelog: added trailer.
  • Documentation: doc/ci/yaml/_index.md says where the description shows.
  • Translation: the only new user-facing string is Description, which uses the existing __() message.
  • Database: no migrations or queries.
Edited by Marius Bobin

Merge request reports

Loading
Loading