Show "Last used: unavailable" for SSH keys when tracking is disabled
What does this MR do and why?
The feature flag :disable_ssh_key_used_tracking disables updating
usage data for SSH keys. However the UI still attempts to use the
last_used_at value even though it is incorrect, showing "Last used:
never". This is misleading, with potential security impacts if relied
upon for auditing or investigatory purposes.
This feature flag is enabled - i.e. tracking is disabled and the UI is currently incorrect - on GitLab.com.
There is an issue to begin tracking last_used_at again: Relax the updating of last_used_at of ssh keys ... (#324764 - closed)
This MR uses the feature flag to conditionally show
"Last used: Unavailable" with a link to new documentation as an interim solution.
When the feature flag is removed, the UI will automatically revert to
showing last_used_at again.
Note that due to using the status of the feature flag there could be a small time period where the UX is incorrect again. Between disabling the feature flag and the next-time-of-use, the SSH key will show "Last used: Never" even if it was used 1 minute prior to the feature flag change.
Screenshots or screen recordings
Old
Via SSH key list shows "Last used: Never", even whe... (#350211 - closed)
New
How to set up and validate locally
- Fire up GDK and sign in
- Go to the SSH keys page.
- Add an SSH key if you don't have one already.
- Optionally use that SSH key (or update
last_used_atvia the rails console)
- See that the "Last used" value is displayed
- In the rails console, enable the
disable_ssh_key_used_trackingfeature flag - Refresh the page and see "Last used: Unavailable"
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.

