Validate presence of `PersonalAccessToken#expires_at`
What does this MR do and why?
- Previously, rather than adding a validation, we set it with a setter.
- This was an effective way of ensuring that no new PATs were created with a nil expires_at but is also opaque to the end user.
- We also added a background migration to ensure that all existing PATs had an expires_at value set: !120239 (merged)
- Now, we are adding an explicit validation.
- #387057 (closed)
- In theory we shouldn't have any new invalid PATs created after the above background migration ran but to be safe we will add this constraint without validation.
- In the next milestone, we can validate this constraint per https://docs.gitlab.com/ee/development/database/not_null_constraints.html#prevent-new-invalid-records-current-release
Changelog: changed
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
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.