Skip to content

Add description field to cluster agent token

Emily Ring requested to merge 300417-agent-token-description into master

What does this MR do?

We're building a new token display, which includes a description field. See issue: #298748 (closed)

The MR will

  • Add description field to Clusters::AgentToken
  • Update GraphQL and Clusters::AgentTokens::CreateService to allow users to enter a description field
  • Update associated tests and translations

Screenshots (strongly suggested)

description

Mutations

up

== 20210216193620 AddDescriptionToClusterToken: migrating =====================
-- column_exists?(:cluster_agent_tokens, :description)
   -> 0.0016s
-- add_column(:cluster_agent_tokens, :description, :text)
   -> 0.0032s
-- transaction_open?()
   -> 0.0000s
-- current_schema()
   -> 0.0001s

-- execute("ALTER TABLE cluster_agent_tokens\nADD CONSTRAINT check_4e4ec5070a\nCHECK ( char_length(description) <= 1024 )\nNOT VALID;\n")
   -> 0.0035s
-- current_schema()
   -> 0.0003s
-- execute("SET statement_timeout TO 0")
   -> 0.0004s
-- execute("ALTER TABLE cluster_agent_tokens VALIDATE CONSTRAINT check_4e4ec5070a;")
   -> 0.0012s
-- execute("RESET ALL")
   -> 0.0006s
== 20210216193620 AddDescriptionToClusterToken: migrated (0.0224s) ============

down

== 20210216193620 AddDescriptionToClusterToken: reverting =====================
-- remove_column(:cluster_agent_tokens, :description)
   -> 0.0108s
== 20210216193620 AddDescriptionToClusterToken: reverted (0.0109s) ============

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #300417 (closed)

Edited by Emily Ring

Merge request reports