Skip to content

Fix Public Deploy Keys form to allow expiration dates

Ben King requested to merge benjaminking-fix-pub-deploy-keys into master

What does this MR do and why?

Closes #427842 (closed)

The Public Deploy Keys form has HAML syntax which incorrectly showed a new deploy key form with the expiration date field as read only. This MR fixes the behaviour by:

  • Showing an editable version of the input when a new deploy key is being created
  • Moving the original read only version of the field to an if? statement. This ensures no expiration date field is presented if an expiration is not set.

Screenshots or screen recordings

Before After Description
image image Creating a new Deploy Key. The expiration date field is a selectable date, which matches the project deploy keys style.
image image Editing an existing Deploy Key
image image Expiration date is hidden if no expiry is set

GIF Example

deploy-keys-date

How to set up and validate locally

  1. Go to Admin Area > Deploy Keys
  2. Create a new Deploy Key. Use a date value like 2024-01-01 for the expiration date. Save the form.
  3. Edit the Deploy Key. Confirm the key's expiration date has been saved.

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 Ben King

Merge request reports