Skip to content
Snippets Groups Projects

Add models and initial ability for admin related custom roles

Merged Jarka Košanová requested to merge 501547-admin-cr-models into master
All threads resolved!

What does this MR do and why?

We want to introduce custom permissions that allow users to visit certain admin areas. This is the preparation for this.

Right now, we have MemberRole table associated with Member table, while Member can (but don't have to) have member_role assigned. The Member is always related to a group or project.

For admin-related permissions, there is no relevant membership. So we need to store the association elsewhere. I am introducing a new model Users::UserMemberRole where we'll store that association.

The first custom ability for admin role is added in this MR to illustrate the intended usage but is not working yet, there are no visible changes.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #501547 (closed)

Edited by Jarka Košanová

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ghost User
  • 2 Warnings
    :warning: This MR changes code in ee/, but its Changelog commit is missing the EE: true trailer. Consider adding it to your Changelog commits.
    :warning: 27dbddc3: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines.
    1 Message
    :book: This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge.

    Documentation review

    The following files require a review from a technical writer:

    The review does not need to block merging this merge request. See the:

    Reviewer roulette

    Category Reviewer Maintainer
    backend @jhyson profile link current availability (UTC+13, 12 hours ahead of author) @vij profile link current availability (UTC+0, 1 hour behind author)
    database @bmarjanovic profile link current availability (UTC+1, same timezone as author) @Quintasan profile link current availability (UTC+1, same timezone as author)
    groupauthorization Reviewer review is optional for groupauthorization @alexbuijs profile link current availability (UTC+1, same timezone as author)

    Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.

    If needed, you can retry the :repeat: danger-review job that generated this comment.

    Generated by :no_entry_sign: Danger

  • Jarka Košanová added 498 commits

    added 498 commits

    Compare with previous version

  • A deleted user added feature flag label

    added feature flag label

  • Ghost User
  • Ghost User
  • Jarka Košanová added 202 commits

    added 202 commits

    Compare with previous version

  • added 1 commit

    • 438f7cad - Add models and initial ability for admin related custom roles

    Compare with previous version

  • Jarka Košanová added 163 commits

    added 163 commits

    Compare with previous version

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 27dbddc3

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Plan        | 116    | 0      | 0       | 0     | 116   | ✅     |
    | Create      | 210    | 0      | 4       | 0     | 214   | ✅     |
    | Govern      | 114    | 0      | 6       | 0     | 120   | ✅     |
    | Verify      | 78     | 0      | 2       | 0     | 80    | ✅     |
    | Package     | 48     | 0      | 0       | 0     | 48    | ✅     |
    | Secure      | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Fulfillment | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Data Stores | 52     | 0      | 0       | 0     | 52    | ✅     |
    | Monitor     | 12     | 0      | 0       | 0     | 12    | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Release     | 6      | 0      | 0       | 0     | 6     | ✅     |
    | Manage      | 2      | 0      | 0       | 0     | 2     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 650    | 0      | 12      | 0     | 662   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-cng: :white_check_mark: test report for 27dbddc3

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 140    | 0      | 20      | 0     | 160   | ✅     |
    | Plan        | 86     | 0      | 8       | 0     | 94    | ✅     |
    | Secure      | 2      | 0      | 5       | 0     | 7     | ✅     |
    | Manage      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Monitor     | 8      | 0      | 12      | 0     | 20    | ✅     |
    | Govern      | 84     | 0      | 9       | 1     | 93    | ✅     |
    | Package     | 24     | 0      | 14      | 0     | 38    | ✅     |
    | Verify      | 49     | 0      | 16      | 0     | 65    | ✅     |
    | Data Stores | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Configure   | 0      | 0      | 3       | 0     | 3     | ➖     |
    | Release     | 5      | 0      | 1       | 0     | 6     | ✅     |
    | Fulfillment | 2      | 0      | 7       | 0     | 9     | ✅     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Growth      | 0      | 0      | 2       | 0     | 2     | ➖     |
    | ModelOps    | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 436    | 0      | 119     | 1     | 555   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
  • Database migrations (on the main database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20241104171411 - RemoveNotNullFromMemberRoleBaseAccessLevel Regular 4.7 s :white_check_mark: +0.00 B
    20241104171544 - CreateUserMemberRole Regular 4.7 s :white_check_mark: +32.00 KiB
    20241104171619 - AddUserMemberRolesMemberRoleFk Regular 5.4 s :white_check_mark: +0.00 B
    20241112210718 - AddUserMemberRolesUserFk Regular 5.3 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 8
    0.1 seconds - 1 second 14
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241104171411 - RemoveNotNullFromMemberRoleBaseAccessLevel

    • Type: Regular
    • Duration: 4.7 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 3.6 ms 3.6 ms 3.6 ms 0
    ALTER TABLE "member_roles" ALTER COLUMN "base_access_level" DROP NOT NULL
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for RemoveNotNullFromMemberRoleBaseAccessLevel
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 1
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241104171544 - CreateUserMemberRole

    • Type: Regular
    • Duration: 4.7 s
    • Database size change: +32.00 KiB
    Calls Total Time Max Time Mean Time Rows Query
    1 8.4 ms 8.4 ms 8.4 ms 0
    CREATE TABLE "user_member_roles" ("id" bigserial primary key, "user_id" bigint NOT NULL, "member_role_id" bigint NOT NULL, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL)
    1 1.4 ms 1.4 ms 1.4 ms 0
    CREATE INDEX "idx_user_member_roles_on_user_id" ON "user_member_roles" ("user_id")
    1 1.3 ms 1.3 ms 1.3 ms 0
    CREATE INDEX "idx_user_member_roles_on_member_role_id" ON "user_member_roles" ("member_role_id")
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for CreateUserMemberRole
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 3
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241104171619 - AddUserMemberRolesMemberRoleFk

    • Type: Regular
    • Duration: 5.4 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 5.3 ms 5.3 ms 5.3 ms 0
    ALTER TABLE user_member_roles VALIDATE CONSTRAINT fk_cb5a805cd4
    1 1.7 ms 1.7 ms 1.7 ms 0
    ALTER TABLE user_member_roles ADD CONSTRAINT fk_cb5a805cd4 FOREIGN KEY (member_role_id) REFERENCES member_roles (id) ON DELETE CASCADE NOT VALID
    1 0.5 ms 0.5 ms 0.5 ms 0
    SELECT $1 AS one
    FROM "postgres_foreign_keys" WHERE "postgres_foreign_keys"."constrained_table_name" = $2 AND "postgres_foreign_keys"."referenced_table_name" = $3 AND "postgres_foreign_keys"."name" = $4 AND "postgres_foreign_keys"."constrained_columns" = $5 AND "postgres_foreign_keys"."referenced_columns" = $6 AND "postgres_foreign_keys"."on_delete_action" = $7
    LIMIT $8
    2 0.4 ms 0.2 ms 0.2 ms 0
    SELECT "postgres_partitioned_tables".*
    FROM "postgres_partitioned_tables" WHERE (identifier = concat(current_schema(), $1, $2))
    LIMIT $3
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddUserMemberRolesMemberRoleFk
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 5
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241112210718 - AddUserMemberRolesUserFk

    • Type: Regular
    • Duration: 5.3 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 8.3 ms 8.3 ms 8.3 ms 0
    ALTER TABLE user_member_roles VALIDATE CONSTRAINT fk_76b9a6bfac
    1 4.4 ms 4.4 ms 4.4 ms 0
    ALTER TABLE user_member_roles ADD CONSTRAINT fk_76b9a6bfac FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT VALID
    1 0.7 ms 0.7 ms 0.7 ms 0
    SELECT $1 AS one
    FROM "postgres_foreign_keys" WHERE "postgres_foreign_keys"."constrained_table_name" = $2 AND "postgres_foreign_keys"."referenced_table_name" = $3 AND "postgres_foreign_keys"."name" = $4 AND "postgres_foreign_keys"."constrained_columns" = $5 AND "postgres_foreign_keys"."referenced_columns" = $6 AND "postgres_foreign_keys"."on_delete_action" = $7
    LIMIT $8
    2 0.4 ms 0.2 ms 0.2 ms 0
    SELECT "postgres_partitioned_tables".*
    FROM "postgres_partitioned_tables" WHERE (identifier = concat(current_schema(), $1, $2))
    LIMIT $3
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddUserMemberRolesUserFk
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 5
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Other information

    Other migrations pending on GitLab.com
    Migration Type Total runtime Result DB size change
    20241104090601 - AddIsKnownExploitToPmCveEnrichment Regular 6.7 s :white_check_mark: +0.00 B
    20241105150912 - AddProjectEventsToWebHooks Regular 4.5 s :white_check_mark: +0.00 B
    20241107131541 - AddUserSeatManagementToApplicationSettings Regular 4.5 s :white_check_mark: +0.00 B
    20241107180528 - AddCursorsToBatchedBackgroundMigrationJobs Regular 4.5 s :white_check_mark: +0.00 B
    20241107180531 - AddCursorsToBatchedBackgroundMigrations Regular 4.5 s :white_check_mark: +0.00 B
    20241107180533 - AddIdsOrCursorsConstraintToBatchedBackgroundMigrationJobs Regular 5.6 s :warning: +0.00 B
    20241107180537 - AddIdsOrCursorsConstraintToBatchedBackgroundMigrations Regular 5.1 s :white_check_mark: +0.00 B
    20241107180541 - RemoveValuesNotNullConstraintsFromBatchedBackgroundMigrationJobs Regular 4.3 s :white_check_mark: +0.00 B
    20241107180543 - RemoveValuesNotNullConstraintsFromBatchedBackgroundMigrations Regular 4.2 s :white_check_mark: +0.00 B
    20241108192945 - AddWorkItemTypesOldIdColumn Regular 4.4 s :white_check_mark: +0.00 B
    20241028135334 - UpdatePostgresSequencesView2 Post deploy 4.4 s :white_check_mark: +0.00 B
    20241103164158 - MigrateSoftwareLicenseWithoutSpdxIdentifierToCustomLicensesTable Post deploy 1292.7 s :warning: +3.82 MiB
    20241104212609 - AddIndexOnMembersSourceAccessLevelMemberRole Post deploy 81.7 s :white_check_mark: +1.20 GiB
    20241105213841 - CreateTmpIndexOnIssuesByProjectCorrectTypeWhereClosed Post deploy 8.8 s :white_check_mark: +0.00 B
    20241105215409 - CreateTmpIndexOnIssuesProjectHealthIdDescStateCorrectType Post deploy 8.7 s :white_check_mark: +0.00 B
    20241105215907 - CreateTmpIndexOnIssuesProjectHealthIdAscStateCorrectType Post deploy 8.6 s :white_check_mark: +0.00 B
    20241105220155 - CreateTmpIndexOnIssuesCorrectTypeProjectCreatedAtState Post deploy 8.5 s :white_check_mark: +0.00 B
    20241105232559 - FinalizeBackfillDesignManagementVersionsNamespaceId Post deploy 5.8 s :white_check_mark: +0.00 B
    20241106092213 - SyncForeignKeyValidationForPipelinesUpstreamPipelineId Post deploy 7.7 s :white_check_mark: +0.00 B
    20241106163530 - AllowNullForPlanLimitsRepositorySize Post deploy 4.9 s :white_check_mark: +0.00 B
    20241106163630 - UpdateDefaultPlanLimitsRepositorySize Post deploy 4.9 s :white_check_mark: +0.00 B
    20241106163900 - SetExistingPlanLimitsRepositorySizeToNull Post deploy 4.1 s :white_check_mark: +0.00 B
    20241107180535 - AddJsonbArrayConstraintsToBatchedBackgroundMigrationJobs Post deploy 5.6 s :warning: +0.00 B
    20241107180539 - AddJsonbArrayConstraintsToBatchedBackgroundMigrations Post deploy 5.1 s :white_check_mark: +0.00 B
    20241107180545 - IndexBackgroundMigrationJobsOnMigrationIdAndMaxCursor Post deploy 5.7 s :white_check_mark: +8.00 KiB [note]
    20241107200045 - DropRequiresCreditCardVerificationInUserDetail Post deploy 4.4 s :white_check_mark: +0.00 B
    20241107232543 - FinalizeBackfillIssueLinksNamespaceId Post deploy 4.9 s :white_check_mark: +0.00 B
    20241107232848 - FinalizeBackfillOperationsFeatureFlagsIssuesProjectId Post deploy 4.8 s :white_check_mark: +0.00 B
    20241108105453 - EnsureIdUniquenessForPCiPipelines Post deploy 5.0 s :white_check_mark: +0.00 B
    20241108205025 - SetWorkItemTypesOldId Post deploy 4.5 s :white_check_mark: +0.00 B
    20241109084629 - AddDependencyListExportsProjectIdGroupIdOrganizationIdNotNull Post deploy 5.2 s :white_check_mark: +0.00 B
    20241110232543 - FinalizeBackfillMergeRequestBlocksProjectId Post deploy 4.8 s :white_check_mark: +0.00 B
    20241111204547 - AddIssuesCorrectWorkItemTypeIdFk Post deploy 103.8 s :warning: +0.00 B
    20241112114810 - FinalizeBackfillVulnerabilityStateTransitionsProjectId Post deploy 4.1 s :boom: +0.00 B
    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-3883368-16016712-main 2024-11-13T08:15:43Z 2024-11-10T11:43:58Z 2024-11-13 20:56:36 +0000
    database-testing-3883368-16016712-ci 2024-11-13T08:15:43Z 2024-11-12T18:10:58Z 2024-11-13 20:56:36 +0000

    Job artifacts

    Database migrations (on the ci database)

    Migrations included in this change have been executed on gitlab.com data for testing purposes. For details, please see the migration testing pipeline (limited access).

    Migration Type Total runtime Result DB size change
    20241104171411 - RemoveNotNullFromMemberRoleBaseAccessLevel Regular 7.5 s :white_check_mark: +0.00 B
    20241104171544 - CreateUserMemberRole Regular 7.4 s :white_check_mark: +48.00 KiB
    20241104171619 - AddUserMemberRolesMemberRoleFk Regular 7.5 s :white_check_mark: +0.00 B
    20241112210718 - AddUserMemberRolesUserFk Regular 7.4 s :white_check_mark: +0.00 B
    Runtime Histogram for all migrations
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 15
    0.1 seconds - 1 second 10
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241104171411 - RemoveNotNullFromMemberRoleBaseAccessLevel

    • Type: Regular
    • Duration: 7.5 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 4.1 ms 4.1 ms 4.1 ms 0
    ALTER TABLE "member_roles" ALTER COLUMN "base_access_level" DROP NOT NULL
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for RemoveNotNullFromMemberRoleBaseAccessLevel
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 2
    0.1 seconds - 1 second 1
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241104171544 - CreateUserMemberRole

    • Type: Regular
    • Duration: 7.4 s
    • Database size change: +48.00 KiB
    Calls Total Time Max Time Mean Time Rows Query
    1 17.7 ms 17.7 ms 17.7 ms 0
    CREATE TABLE "user_member_roles" ("id" bigserial primary key, "user_id" bigint NOT NULL, "member_role_id" bigint NOT NULL, "created_at" timestamptz NOT NULL, "updated_at" timestamptz NOT NULL)
    1 1.4 ms 1.4 ms 1.4 ms 0
    CREATE INDEX "idx_user_member_roles_on_user_id" ON "user_member_roles" ("user_id")
    1 1.4 ms 1.4 ms 1.4 ms 0
    CREATE INDEX "idx_user_member_roles_on_member_role_id" ON "user_member_roles" ("member_role_id")
    1 0.4 ms 0.4 ms 0.4 ms 0
    CREATE TRIGGER gitlab_schema_write_trigger_for_user_member_roles BEFORE INSERT OR
    UPDATE OR DELETE OR TRUNCATE ON user_member_roles FOR EACH STATEMENT EXECUTE FUNCTION gitlab_schema_prevent_write()
    1 0.1 ms 0.1 ms 0.1 ms 1
    SELECT COUNT(*) from information_schema.triggers
    WHERE event_object_table = $1 AND trigger_name = $2
    1 0.0 ms 0.0 ms 0.0 ms 1
    SELECT table_name
    FROM information_schema.tables
    WHERE table_name = $1 AND table_schema = current_schema()
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for CreateUserMemberRole
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 6
    0.1 seconds - 1 second 2
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241104171619 - AddUserMemberRolesMemberRoleFk

    • Type: Regular
    • Duration: 7.5 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 2.2 ms 2.2 ms 2.2 ms 0
    ALTER TABLE user_member_roles VALIDATE CONSTRAINT fk_cb5a805cd4
    1 1.5 ms 1.5 ms 1.5 ms 0
    ALTER TABLE user_member_roles ADD CONSTRAINT fk_cb5a805cd4 FOREIGN KEY (member_role_id) REFERENCES member_roles (id) ON DELETE CASCADE NOT VALID
    1 0.5 ms 0.5 ms 0.5 ms 0
    SELECT $1 AS one
    FROM "postgres_foreign_keys" WHERE "postgres_foreign_keys"."constrained_table_name" = $2 AND "postgres_foreign_keys"."referenced_table_name" = $3 AND "postgres_foreign_keys"."name" = $4 AND "postgres_foreign_keys"."constrained_columns" = $5 AND "postgres_foreign_keys"."referenced_columns" = $6 AND "postgres_foreign_keys"."on_delete_action" = $7
    LIMIT $8
    2 0.4 ms 0.2 ms 0.2 ms 0
    SELECT "postgres_partitioned_tables".*
    FROM "postgres_partitioned_tables" WHERE (identifier = concat(current_schema(), $1, $2))
    LIMIT $3
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddUserMemberRolesMemberRoleFk
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 4
    0.1 seconds - 1 second 3
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Migration: 20241112210718 - AddUserMemberRolesUserFk

    • Type: Regular
    • Duration: 7.4 s
    • Database size change: +0.00 B
    Calls Total Time Max Time Mean Time Rows Query
    1 8.8 ms 8.8 ms 8.8 ms 0
    ALTER TABLE user_member_roles ADD CONSTRAINT fk_76b9a6bfac FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT VALID
    1 5.5 ms 5.5 ms 5.5 ms 0
    ALTER TABLE user_member_roles VALIDATE CONSTRAINT fk_76b9a6bfac
    1 0.6 ms 0.6 ms 0.6 ms 0
    SELECT $1 AS one
    FROM "postgres_foreign_keys" WHERE "postgres_foreign_keys"."constrained_table_name" = $2 AND "postgres_foreign_keys"."referenced_table_name" = $3 AND "postgres_foreign_keys"."name" = $4 AND "postgres_foreign_keys"."constrained_columns" = $5 AND "postgres_foreign_keys"."referenced_columns" = $6 AND "postgres_foreign_keys"."on_delete_action" = $7
    LIMIT $8
    2 0.4 ms 0.2 ms 0.2 ms 0
    SELECT "postgres_partitioned_tables".*
    FROM "postgres_partitioned_tables" WHERE (identifier = concat(current_schema(), $1, $2))
    LIMIT $3
    2 0.0 ms 0.0 ms 0.0 ms 2
    SELECT pg_backend_pid()
    Histogram for AddUserMemberRolesUserFk
    Query Runtime Count
    0 seconds - 0.01 seconds 0
    0.01 seconds - 0.1 seconds 3
    0.1 seconds - 1 second 4
    1 second - 5 seconds 0
    5 seconds - 15 seconds 0
    15 seconds - 5 minutes 0
    5 minutes + 0

    Other information

    Other migrations pending on GitLab.com
    Migration Type Total runtime Result DB size change
    20241105213841 - CreateTmpIndexOnIssuesByProjectCorrectTypeWhereClosed Post deploy 10.7 s :white_check_mark: +0.00 B
    20241105215409 - CreateTmpIndexOnIssuesProjectHealthIdDescStateCorrectType Post deploy 10.6 s :white_check_mark: +0.00 B
    20241105215907 - CreateTmpIndexOnIssuesProjectHealthIdAscStateCorrectType Post deploy 10.7 s :white_check_mark: +0.00 B
    20241105220155 - CreateTmpIndexOnIssuesCorrectTypeProjectCreatedAtState Post deploy 10.7 s :white_check_mark: +0.00 B
    20241106163530 - AllowNullForPlanLimitsRepositorySize Post deploy 6.6 s :white_check_mark: +0.00 B
    20241106163630 - UpdateDefaultPlanLimitsRepositorySize Post deploy 6.8 s :white_check_mark: +0.00 B
    20241106163900 - SetExistingPlanLimitsRepositorySizeToNull Post deploy 6.3 s :white_check_mark: +0.00 B
    20241107200045 - DropRequiresCreditCardVerificationInUserDetail Post deploy 6.7 s :white_check_mark: +0.00 B
    20241109084629 - AddDependencyListExportsProjectIdGroupIdOrganizationIdNotNull Post deploy 7.5 s :white_check_mark: +0.00 B
    20241110232543 - FinalizeBackfillMergeRequestBlocksProjectId Post deploy 6.2 s :white_check_mark: +0.00 B
    20241111204547 - AddIssuesCorrectWorkItemTypeIdFk Post deploy 7.4 s :white_check_mark: +0.00 B
    20241112114810 - FinalizeBackfillVulnerabilityStateTransitionsProjectId Post deploy 6.3 s :white_check_mark: +0.00 B
    Clone details
    Clone ID Clone Created At Clone Data Timestamp Expected Removal Time
    database-testing-3883368-16016712-main 2024-11-13T08:15:43Z 2024-11-10T11:43:58Z 2024-11-13 20:56:36 +0000
    database-testing-3883368-16016712-ci 2024-11-13T08:15:43Z 2024-11-12T18:10:58Z 2024-11-13 20:56:36 +0000

    Job artifacts


    Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic

    Edited by ****
  • Jarka Košanová changed the description

    changed the description

  • Jarka Košanová
  • Jarka Košanová
  • added 1 commit

    • 76d3d5e0 - Add models and initial ability for admin related custom roles

    Compare with previous version

  • Jarka Košanová requested review from @knejad

    requested review from @knejad

  • Keeyan Nejad approved this merge request

    approved this merge request

  • :tools: Generated by gitlab_quality-test_tooling.


    :snail: Slow tests detected in this merge request. These slow tests might be related to this merge request's changes.

    Click to expand
    Job File Name Duration Expected duration
    #8324507550 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.78 s < 50.13 s
    #8324507407 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.85 s < 50.13 s
    #8324506838 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 74.94 s < 27.12 s
    #8324507261 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.85 s < 50.13 s
    #8324507712 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.55 s < 50.13 s
    #8324506649 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 78.3 s < 27.12 s
    #8324506389 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 77.51 s < 27.12 s
    #8327595104 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 86.05 s < 27.12 s
    #8327595259 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 79.02 s < 27.12 s
    #8327596066 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.84 s < 50.13 s
    #8327594799 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 90.45 s < 27.12 s
    #8327595751 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.18 s < 50.13 s
    #8327595892 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.45 s < 50.13 s
    #8327595599 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 67.78 s < 50.13 s
    #8327594993 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 101.64 s < 27.12 s
    #8332556675 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 75.15 s < 27.12 s
    #8332555912 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 77.56 s < 27.12 s
    #8332557950 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 85.81 s < 27.12 s
    #8332562041 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.25 s < 50.13 s
    #8332560919 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.42 s < 50.13 s
    #8332557501 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 86.54 s < 27.12 s
    #8332562690 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.76 s < 50.13 s
    #8332560325 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.99 s < 50.13 s
    #8340419618 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.01 s < 50.13 s
    #8340420845 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.61 s < 50.13 s
    #8340417843 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 79.95 s < 27.12 s
    #8340420031 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.53 s < 50.13 s
    #8340415900 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 78.12 s < 27.12 s
    #8340420389 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 67.51 s < 50.13 s
    #8340415394 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 82.32 s < 27.12 s
    #8340417310 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 97.71 s < 27.12 s
    #8362116216 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 74.24 s < 27.12 s
    #8362115478 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 73.03 s < 27.12 s
    #8362115742 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 74.63 s < 27.12 s
    #8362116091 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 79.03 s < 27.12 s
    #8362117354 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.94 s < 50.13 s
    #8362116192 spec/lib/gitlab/database/decomposition/migrate_spec.rb#L103 Gitlab::Database::Decomposition::Migrate#process! when the checks pass copies main database to ci database 33.7 s < 27.12 s
    #8362116986 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.12 s < 50.13 s
    #8362116718 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.28 s < 50.13 s
    #8362117145 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 67.21 s < 50.13 s
    #8364627795 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 73.06 s < 27.12 s
    #8364628080 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 75.97 s < 27.12 s
    #8364629386 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.75 s < 50.13 s
    #8364629047 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.27 s < 50.13 s
    #8364627472 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 77.7 s < 27.12 s
    #8364627231 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 84.4 s < 27.12 s
    #8364629230 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.98 s < 50.13 s
    #8364628802 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 67.18 s < 50.13 s
    #8378437728 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 75.8 s < 27.12 s
    #8378437566 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 83.08 s < 27.12 s
    #8378437363 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 80.85 s < 27.12 s
    #8378438102 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.08 s < 50.13 s
    #8378438401 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 69.05 s < 50.13 s
    #8378437480 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 85.77 s < 27.12 s
    #8378438205 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.51 s < 50.13 s
    #8379684370 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 71.64 s < 27.12 s
    #8379685289 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 75.32 s < 27.12 s
    #8379685289 spec/lib/gitlab/database/decomposition/migrate_spec.rb#L103 Gitlab::Database::Decomposition::Migrate#process! when the checks pass copies main database to ci database 27.85 s < 27.12 s
    #8379684865 spec/lib/release_highlights/validator_spec.rb#L82 ReleaseHighlights::Validator when validating all files they should have no errors 80.74 s < 27.12 s
    #8379684865 spec/lib/gitlab/database/decomposition/migrate_spec.rb#L103 Gitlab::Database::Decomposition::Migrate#process! when the checks pass copies main database to ci database 27.98 s < 27.12 s
    #8379686513 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.44 s < 50.13 s
    #8379686700 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.57 s < 50.13 s
    #8379686883 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.9 s < 50.13 s
    #8379687114 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.14 s < 50.13 s
  • A deleted user added rspec:slow test detected label
  • Jarka Košanová added 638 commits

    added 638 commits

    Compare with previous version

  • added 1 commit

    • 69d5fea2 - Add models and initial ability for admin related custom roles

    Compare with previous version

  • Jarka Košanová requested review from @knejad and removed approval

    requested review from @knejad and removed approval

  • Jarka Košanová requested review from @terrichu

    requested review from @terrichu

  • Keeyan Nejad approved this merge request

    approved this merge request

  • Keeyan Nejad requested review from @vij

    requested review from @vij

  • Vijay Hawoldar
  • Vijay Hawoldar
  • Vijay Hawoldar
  • Vijay Hawoldar approved this merge request

    approved this merge request

  • Vijay Hawoldar removed review request for @vij

    removed review request for @vij

  • Terri Chu approved this merge request

    approved this merge request

  • added databasereviewed label and removed databasereview pending label

  • Terri Chu requested review from @Quintasan and removed review request for @terrichu

    requested review from @Quintasan and removed review request for @terrichu

  • Terri Chu
  • Jarka Košanová added 309 commits

    added 309 commits

    • 69d5fea2...0e370b5c - 307 commits from branch master
    • 5ee0fbfc - Add models and initial ability for admin related custom roles
    • 27dbddc3 - Small improvements from review, migration improvements

    Compare with previous version

  • Jarka Košanová reset approvals from @vij and @terrichu by pushing to the branch

    reset approvals from @vij and @terrichu by pushing to the branch

  • Author Maintainer

    Thanks @terrichu, I replied and also changed the code. I will wait for the maintainer review :angel:

  • Michał Zając approved this merge request

    approved this merge request

  • added databaseapproved label and removed databasereviewed label

  • Michał Zając requested review from @vij

    requested review from @vij

  • Vijay Hawoldar approved this merge request

    approved this merge request

  • Vijay Hawoldar requested review from @alexbuijs

    requested review from @alexbuijs

  • Alex Buijs approved this merge request

    approved this merge request

  • Jarka Košanová resolved all threads

    resolved all threads

  • Jarka Košanová enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • mentioned in commit 3f11af62

  • Hello @jarka :wave:

    The database team is looking for ways to improve the database review process and we would love your help!

    If you'd be open to someone on the database team reaching out to you for a chat, or if you'd like to leave some feedback asynchronously, just post a reply to this comment mentioning:

    @gitlab-org/database-team

    And someone will be by shortly!

    Thanks for your help! :heart:

    This message was generated automatically. Improve it or delete it.

  • added workflowstaging label and removed workflowcanary label

  • Please register or sign in to reply
    Loading