Add description to requirements
What does this MR do?
Adds description field to the Requirement model and exposes this field in the GraphQL API.
Sample query:
mutation {
updateRequirement(input: {projectPath: "h5bp/html5-boilerplate", iid: "1", title: "some title", description:"foo with reference #1"}) {
errors
requirement {
title
description
descriptionHtml
}
}
}
Migration output:
# migrate:
== 20200923071622 AddDescriptionToRequirements: migrating =====================
-- add_column(:requirements, :description, :text)
-> 0.0008s
-- add_column(:requirements, :description_html, :text)
-> 0.0002s
== 20200923071622 AddDescriptionToRequirements: migrated (0.0010s) ============
== 20200923071644 AddTextLimitToRequirementsDescription: migrating ============
-- transaction_open?()
-> 0.0000s
-- execute("ALTER TABLE requirements\nADD CONSTRAINT check_785ae25b9d\nCHECK ( char_length(description) <= 10000 )\nNOT VALID;\n")
-> 0.0005s
-- execute("ALTER TABLE requirements VALIDATE CONSTRAINT check_785ae25b9d;")
-> 0.0013s
== 20200923071644 AddTextLimitToRequirementsDescription: migrated (0.0050s) ===
# rollback:
== 20200923071644 AddTextLimitToRequirementsDescription: reverting ============
-- execute("ALTER TABLE requirements\nDROP CONSTRAINT IF EXISTS check_785ae25b9d\n")
-> 0.0005s
== 20200923071644 AddTextLimitToRequirementsDescription: reverted (0.0059s) ===
== 20200923071622 AddDescriptionToRequirements: reverting =====================
-- remove_column(:requirements, :description_html, :text)
-> 0.0015s
-- remove_column(:requirements, :description, :text)
-> 0.0005s
== 20200923071622 AddDescriptionToRequirements: reverted (0.0076s) ============
Related to #224622 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
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
Edited by Jan Provaznik