Skip to content

Improve PAT expiration validation error messages

Jessie Young requested to merge jy-pat-followup into master

What does this MR do and why?

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 a PAT with an expiration date more than 365 days in the future
       PersonalAccessToken.create!(expires_at: 2.years.from_now, user:User.last, scopes: ['api'])
  2. See a beautiful error message
    ActiveRecord::RecordInvalid: Validation failed: Expiration date must be before 2024-06-15 05:12:08 UTC

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 Jessie Young

Merge request reports

Loading