Validate null constraint for token name
What does this MR do?
We recently added a name
field to Clusters::AgentTokens and validated the field.
See related issue: #322745 (closed)
See previous MRs
This is the final MR which will validate_not_null_constraint
on the new name
field.
Migration
== 20210317155207 ValidateNotNullConstraintOnClusterTokenName: migrating ======
-- current_schema()
-> 0.0002s
-- execute("SET statement_timeout TO 0")
-> 0.0005s
-- execute("ALTER TABLE cluster_agent_tokens VALIDATE CONSTRAINT check_0fb634d04d;")
-> 0.0040s
-- execute("RESET ALL")
-> 0.0006s
== 20210317155207 ValidateNotNullConstraintOnClusterTokenName: migrated (0.0083s)
SELECT * FROM cluster_agent_tokens WHERE name IS NULL
https://console.postgres.ai/gitlab/gitlab-production-tunnel/sessions/2863/commands/9017
Seq Scan on public.cluster_agent_tokens (cost=0.00..4.22 rows=1 width=184) (actual time=1.936..1.937 rows=0 loops=1)
Filter: (cluster_agent_tokens.name IS NULL)
Rows Removed by Filter: 22
Buffers: shared read=1
I/O Timings: read=1.910
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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 #322745 (closed)
Edited by Emily Ring