Skip to content

Add “Added from log” icon in job token allowlist UI

What does this MR do and why?

This MR adds an icon to the job token allowlist UI to indicate when an entry has been added from the authentication log. The design is described in #509883[1_Add.png].

The screenshot below shows the icon being displayed on the correct entries as well as the tooltip.

Screenshot_2025-01-13_at_12.05.43_PM

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Create Allowlist entries for a project in the rails console:

    project = Project.first
    project2 = Project.second
    project3 = Project.third
    group1 = Group.first
    group2 = Group.second
    
    Ci::JobToken::ProjectScopeLink.create(source_project: project, target_project: project2, autopopulated: true, direction: :inbound)
    
    Ci::JobToken::ProjectScopeLink.create(source_project: project, target_project: project3, autopopulated: false, direction: :inbound)
    
    Ci::JobToken::GroupScopeLink.create(source_project: project, target_group: group1, autopopulated: true)
    
    Ci::JobToken::GroupScopeLink.create(source_project: project, target_group: group2, autopopulated: false)
  2. Visit the Job token permissions section of the CI/CD settings in the GDK for project. Get the path by running:

    project.full_path

    Then load the following URL in your browser:

    GDK_HOST/PROJECT_FULL_PATH/-/settings/ci_cd#js-token-access

    In the CI/CD job token allowlist, ensure that project2 and group1 are showing the Added from log icon and tooltip as shown in this MR's description.

  3. Ensure the icons are still displayed when the add_policies_to_ci_job_token feature flag is enabled.

    In the rails console, enable the add_policies_to_ci_job_token feature flag.

    Feature.enable(:add_policies_to_ci_job_token)

    Then, visit the settings page again and ensure the icons are still displayed like before. You'll know the feature flag is enabled when there is another column visible in the table called Job token permissions.

Edited by Darby Frey

Merge request reports

Loading