docs: Add documentation for failed ID token creation on reused project paths

What does this MR do and why?

Updates the instructions shown when Ci::RegisterJobService blocks CI/CD ID tokens for a reused project path.

The job page message and Gitlab::Ci::OidcBurnedPathError::MESSAGE tell users to set the internal ProjectCiCdSetting#id_token_sub_claim_components attribute. The Projects API accepts ci_id_token_sub_claim_components, so copying the internal name into an API request fails. The longer error also links to a documentation section that does not exist.

  • Replace id_token_sub_claim_components with the Projects API parameter ci_id_token_sub_claim_components in both messages.
  • Add troubleshooting steps with the exact API payload and cloud trust policy update, based on the existing project ID subject guidance.
  • Link both messages to the new troubleshooting section.

🛠️ with ❤️ at Siemens

References

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Start GDK and create a disposable project at root/id-token-error-message.

  2. Add and commit this .gitlab-ci.yml. The unmatched tag keeps the job pending:

    id-token-error-message:
      tags:
        - no-runner
      id_tokens:
        TEST_ID_TOKEN:
          aud: https://example.com
      script:
        - echo "This job should remain pending"
  3. Wait for pipeline creation to complete and confirm id-token-error-message is pending.

  4. From the GDK root, open the Rails console:

    gdk rails console
  5. Mark the pending job with the internal failure reason that renders this error:

    project = Project.find_by_full_path('root/id-token-error-message')
    job = project.builds.pending
      .where(name: 'id-token-error-message')
      .order(id: :desc)
      .first!
    job.drop!(:id_token_burned_project_path)
    Gitlab::Routing.url_helpers.project_job_url(project, job)
  6. Open the returned job URL.

  7. Confirm the error names ci_id_token_sub_claim_components, starts the value with project_id, and includes How do I fix it?.

  8. Select How do I fix it? and confirm the troubleshooting section shows the Projects API payload and cloud trust policy steps.

  9. Capture the failed job page with the complete error callout visible.

The Rails console step sets only the job failure reason needed to render the message. The existing Ci::RegisterJobService specs cover detection of a reused project path.

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.

Edited by Gerardo Navarro

Merge request reports

Loading
Loading