Add epic boards lists and expose it in GraphQL API
What does this MR do?
Adds a new epic board lists model and exposes it in GraphQL API
query {
group(fullPath: "h5bp") {
epicBoards {
nodes {
id
name
epicLists {
nodes {
id
listType
label {
id
}
}
}
}
}
}
}
DB migration
$ bundle exec rake db:migrate
== 20201214184020 AddEpicBoardList: migrating =================================
-- create_table(:boards_epic_lists)
-> 0.0281s
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0001s
-- execute("ALTER TABLE boards_epic_lists\nADD CONSTRAINT boards_epic_lists_position_constraint\nCHECK ( (list_type <> 1) OR (\"position\" IS NOT NULL AND \"position\" >= 0) )\nNOT VALID;\n")
-> 0.0003s
-- current_schema()
-> 0.0001s
-- execute("ALTER TABLE boards_epic_lists VALIDATE CONSTRAINT boards_epic_lists_position_constraint;")
-> 0.0011s
== 20201214184020 AddEpicBoardList: migrated (0.0353s) ========================
12:50:49 honza@pc:~/gitlab-development-kit/gitlab (git:epic_boards_graphql_lists-+*:6bced56ed2d) ruby-2.7.2
$ bundle exec rake db:rollback
== 20201214184020 AddEpicBoardList: reverting =================================
-- drop_table(:boards_epic_lists)
-> 0.0011s
== 20201214184020 AddEpicBoardList: reverted (0.0069s) ========================
DB queries
Query plan is from local deployment because this is a new table which is not used in production yet.
- getting epic board's lists: https://explain.depesz.com/s/nKgj
SELECT "boards_epic_lists".* FROM "boards_epic_lists" WHERE "boards_epic_lists"."epic_board_id" = 1 ORDER BY "boards_epic_lists"."list_type" ASC, "boards_epic_lists"."position" ASC LIMIT 100;
There are no indexes on order by
columns - the reason is that we always work with single board lists and number of lists per board is pretty low.
Related to #233436 (closed)
Screenshots (strongly suggested)
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