Skip to content

Update the token expiration banner

What does this MR do and why?

On the first commit: reviews in 16.0-17.0 backports have introduced a few changes and we would like to bring those to master. As follows:

  • hide banner depending on GITLAB_DISABLE_TOKEN_EXPIRATION_BANNER env variable
  • hide banner on tests
  • updated banner message and use a namespace
  • adjusted GitLab version check

On a second commit, we add a new requirement: show the banner only if the database token migration job CleanupPersonalAccessTokensWithNilExpiresAt run. That job added specific expires_at values for tokens that didn't expired (nil values).

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

No changes.

How to set up and validate locally

Test pass.

If one wants to see the banner, the following two conditions has to be met:

  • GitLab version between 16.0-17.0, both included
  • CleanupPersonalAccessTokensWithNilExpiresAt database migration job has to have run
Edited by Eduardo Sanz García

Merge request reports