JWT token payload reflects incorrect branch protection status for merge request pipelines
Problem to solve
When viewing a JWT token payload in a merge request pipeline, the ref_protected value will be false even if the branch is protected.
Steps to reproduce:
-
Create a new project (main branch should be automatically protected)
-
Add a branch protection rule e.g.
feature/* -
create a new branch
feature/foothat is supposed to run merge request pipelines -
confirm from the API that
feature/foois protected. -
Output the JWT token payload and notice that
ref_protectedis alwaysfalsefor the merge request event pipeline source.
Solution
Ensure that the JWT payload accurately reflects the protection status of a branch in a MR pipeline.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.