GitLab API

GitlabTool

Actions905

Overview

This node operation retries a specific job in a GitLab project by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/jobs/{job_id}/retry`. It is useful for automating the retry of failed or canceled jobs within a CI/CD pipeline in GitLab projects. For example, if a job fails due to a transient error, this node can be used to programmatically trigger a retry without manual intervention.

Use Case Examples

  1. Automate retrying failed CI jobs in a GitLab project.
  2. Integrate job retry logic into a larger workflow for continuous integration and deployment.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential.
baseUrl The base URL of the GitLab instance to which the API request is sent.
Method The HTTP method used for the API request, here it is POST for retrying a job.
Path Parameters The path parameters required for the API endpoint, including the project ID and job ID to identify the job to retry.

Output

JSON

  • id - The ID of the retried job.
  • status - The status of the retried job.
  • stage - The stage of the retried job.
  • name - The name of the retried job.
  • ref - The Git reference (branch or tag) for the job.
  • tag - Whether the job is tagged.
  • coverage - The coverage percentage reported by the job.
  • created_at - Timestamp when the job was created.
  • started_at - Timestamp when the job started.
  • finished_at - Timestamp when the job finished.
  • duration - Duration of the job execution.
  • queued_duration - Duration the job spent in the queue.
  • user - Information about the user who triggered the job.
  • commit - Information about the commit associated with the job.
  • pipeline - Information about the pipeline the job belongs to.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and job ID path parameters are correctly set and valid integers.
  • Verify that the API authentication token has sufficient permissions to retry jobs in the project.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error messages include 404 Not Found if the job or project does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion