GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retries a specific job within 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 CI/CD jobs in GitLab projects. For example, if a job in a pipeline 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 jobs in a GitLab CI/CD pipeline.
  2. Integrate job retry functionality 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 in the pipeline.
  • name - The name of the retried job.
  • ref - The Git reference (branch or tag) for the job.
  • created_at - Timestamp when the job was created.
  • started_at - Timestamp when the job started.
  • finished_at - Timestamp when the job finished.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and job ID path parameters are correctly set and correspond to existing resources in GitLab.
  • Verify that the API authentication token has sufficient permissions to retry jobs in the specified project.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 404 Not Found if the job or project does not exist, and 401 Unauthorized if authentication fails. Resolving these involves verifying IDs and authentication credentials.

Links

Discussion