Skip to content

Add pipeline_config_url and pipeline_config_sha claims to Ci::JwtV2

Alishan Ladhani requested to merge ali/add-pipeline-ref-and-sha-to-jwt into master

What does this MR do and why?

Add pipeline_config_url and pipeline_config_sha claims to Ci::JwtV2.

This change was previously introduced in !117923 (merged) and reverted due to a high volume of errors: 2023-05-19: ActionController::UrlGenerationError (gitlab-com/gl-infra/production#14474 - closed). This MR fixes the cause of the errors and adds a feature flag so we can roll out the changes incrementally.

Related to #404722 (closed)

Screenshots or screen recordings

"pipeline_config_url": "https://gitlab.example.com/my-group/my-project/-/blob/714a629c0b401fdce83e847fc9589983fc6f46bc/.gitlab-ci.yml",
"pipeline_config_sha": "714a629c0b401fdce83e847fc9589983fc6f46bc",

How to set up and validate locally

build = Ci::Build.last
Gitlab::Ci::Jwt.new(build, ttl: 1.hour).payload
Gitlab::Ci::JwtV2.new(build, aud: 'my-aud', ttl: 1.hour).payload

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alishan Ladhani

Merge request reports