Skip to content

GitLab Next

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 42,971
    • Issues 42,971
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,371
    • Merge requests 1,371
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #325439
Closed
Open
Created Mar 19, 2021 by Waldek Maleska@weakcamel🚲Contributor

REST API: add pipeline source value

Proposal

The REST API for Gitlab pipelines: https://docs.gitlab.com/ee/api/pipelines.html doesn't currently expose information about pipeline source (e.g. whether it was caused by a trigger/push/MR/schedule).

This information is available to running a job as CI_PIPELINE_SOURCE (see https://docs.gitlab.com/ee/ci/variables/predefined_variables.html) however I can't find a way to find it retrospectively.

I believe it would be useful to expose that information via REST. My rationale:

  • feature parity with UI: when browsing Jobs, you can now see which of them were "Scheduled". You currently can't filter them out with REST API though
  • for statistical purposes (external project analytics)
  • for job artifacts retention purposes (which is specifically the reason I started looking for this information): quite often the "scheduled" jobs are re-testing a project or executing some scheduled task which doesn't need record.

To put it in a form user story:

As a Gitlab project administrator, I'd like to be able to archive and delete all job traces coming from scheduled builds. To achieve that, I need access to information about the cause (source) of a particular job (or its parent pipeline).

Edited Mar 19, 2021 by Waldek Maleska
Assignee
Assign to
Time tracking