Add ability to add read_code to custom roles
What does this MR do and why?
- download_code and read_code are now separate via #376180 (closed)
- for the first iteration of a customer-facing MVC, we want to provide
the ability to customize
read_code
for a Guest user. - We previously added the ability to customize
download_code
but we will be removing that for the customer MVC. - This is all behind the
customizable_roles
feature flag - #20277 (closed)
Database
UserMemberRolesInProjectsPreloader
query before this change: https://explain.depesz.com/s/shQU
UserMemberRolesInProjectsPreloader
query after this change: https://explain.depesz.com/s/yP4E
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
changed milestone to %15.7
added CAB Takeaway Community contribution Deliverable Enterprise Edition GitLab Ultimate [deprecated] Accepting merge requests auto updated customer devopsmanage frontend groupauthentication and authorization [DEPRECATED] permissions popular proposal potential proposal release post itemin review sectiondev typefeature workflowin dev + 1 deleted label
assigned to @jessieay
@s_awezec @kniechajewicz @doniquesmit @csouthard this merge request touches files that could potentially affect user growth or subscription cost management.
This message was generated automatically. You're welcome to improve it.
- A deleted user
added backend database databasereview pending labels
2 Warnings d1b55119: The commit subject must contain at least 3 words. For more information, take a look at our Commit message guidelines. Please add a merge request subtype to this merge request. Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Avielle Wolfe (
@avielle
) (UTC+0, 8 hours ahead of@jessieay
)Ethan Urie (
@eurie
) (UTC-5, 3 hours ahead of@jessieay
)database Jon Jenkins (
@jon_jenkins
) (UTC-6, 2 hours ahead of@jessieay
)Mayra Cabrera (
@mayra-cabrera
) (UTC-6, 2 hours ahead of@jessieay
)~"migration" No reviewer available No maintainer available To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangeradded 1 commit
- 52644de8 - Add ability to add read_code to custom roles
- Resolved by Jessie Young
- Resolved by Jessie Young
added 337 commits
-
52644de8...65cfcab5 - 335 commits from branch
master
- 0a0cc927 - Add ability to add read_code to custom roles
- 0dc2a800 - Spec hygiene
-
52644de8...65cfcab5 - 335 commits from branch
removed [deprecated] Accepting merge requests label
removed workflowin dev label
- Resolved by Jessie Young
Hi @sgarg_gitlab - this needs a database review and I need to prepare a few things for DB review before I tag those folks but can you review this for ~"group::authentication and authorization" in the meantime?
The pipeline/spec failures are all for a single N+1 spec.
be rspec spec/requests/projects/ml/experiments_controller_spec.rb:55
also fails on an updated local master so I don't think that it is related to my MR but I have asked about this in Slack.
requested review from @sgarg_gitlab
@ifarkas just an FYI on this MR. I spoke with @adil.farrukh today about the custom roles plan for %15.7 and even though we hope to move forward with Draft: POC: use flag_shih_tzu gem for storing p... (!106151 - closed) or similar for custom roles in the future, that is still in flux so in the meantime we are going to add a boolean field for
read_code
removed review request for @sgarg_gitlab
added 1 commit
- 414b947d - Add ability to add read_code to custom roles
mentioned in merge request !102450 (merged)
marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
- Resolved by Matt Kasa
- Resolved by Matt Kasa
- Resolved by Matt Kasa
- Resolved by Matt Kasa
- Resolved by Matt Kasa
- Resolved by Matt Kasa
@terrichu - can you review this for database please? @sgarg_gitlab this is ready for ~"group::authentication and authorization" review nowrequested review from @terrichu and @sgarg_gitlab
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 20221206222032 - AddReadCodeToMemberRoles Regular 2.1 s +0.00 B Runtime Histogram for all migrations
Query Runtime Count 0 seconds - 0.01 seconds 0 0.01 seconds - 0.1 seconds 3 0.1 seconds - 1 second 0 1 second - 5 seconds 0 5 seconds - 15 seconds 0 15 seconds - 5 minutes 0 5 minutes + 0 Migration: 20221206222032 - AddReadCodeToMemberRoles
- Type: Regular
- Duration: 2.1 s
- Database size change: +0.00 B
Query Calls Total Time Max Time Mean Time Rows ALTER TABLE "member_roles" ADD "read_code" boolean DEFAULT FALSE /*application:test,db_config_name:main,line:/db/migrate/20221206222032_add_read_code_to_member_roles.rb:5:in `change'*/
1 7.8 ms 7.8 ms 7.8 ms 0 SELECT "feature_gates".*
FROM "feature_gates" WHERE "feature_gates"."feature_key" = $1 /*application:test,db_config_name:main,line:/lib/feature.rb:249:in `block in current_feature_value'*/1 0.0 ms 0.0 ms 0.0 ms 0 SELECT $1::regtype::oid
1 0.0 ms 0.0 ms 0.0 ms 1 Histogram for AddReadCodeToMemberRoles
Query Runtime Count 0 seconds - 0.01 seconds 0 0.01 seconds - 0.1 seconds 3 0.1 seconds - 1 second 0 1 second - 5 seconds 0 5 seconds - 15 seconds 0 15 seconds - 5 minutes 0 5 minutes + 0
Background migrations
Other migrations pending on GitLab.com
Migration Type Total runtime Result DB size change Clone Details
Clone ID Clone Created At Clone Data Timestamp Expected Removal Time database-testing-1591497-8697949-main
2022-12-07T21:47:47Z 2022-12-07T20:10:07Z 2022-12-08 09:51:12 +0000 database-testing-1591497-8697949-ci
2022-12-07T21:47:48Z 2022-12-07T20:46:07Z 2022-12-08 09:51:12 +0000 Artifacts
Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic
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 20221206222032 - AddReadCodeToMemberRoles Regular 2.2 s +0.00 B Runtime Histogram for all migrations
Query Runtime Count 0 seconds - 0.01 seconds 0 0.01 seconds - 0.1 seconds 3 0.1 seconds - 1 second 0 1 second - 5 seconds 0 5 seconds - 15 seconds 0 15 seconds - 5 minutes 0 5 minutes + 0 Migration: 20221206222032 - AddReadCodeToMemberRoles
- Type: Regular
- Duration: 2.2 s
- Database size change: +0.00 B
Query Calls Total Time Max Time Mean Time Rows ALTER TABLE "member_roles" ADD "read_code" boolean DEFAULT FALSE /*application:test,db_config_name:ci,line:/db/migrate/20221206222032_add_read_code_to_member_roles.rb:5:in `change'*/
1 15.1 ms 15.1 ms 15.1 ms 0 SELECT $1::regtype::oid
1 0.0 ms 0.0 ms 0.0 ms 1 Histogram for AddReadCodeToMemberRoles
Query Runtime Count 0 seconds - 0.01 seconds 0 0.01 seconds - 0.1 seconds 3 0.1 seconds - 1 second 0 1 second - 5 seconds 0 5 seconds - 15 seconds 0 15 seconds - 5 minutes 0 5 minutes + 0
Background migrations
Other migrations pending on GitLab.com
Migration Type Total runtime Result DB size change Clone Details
Clone ID Clone Created At Clone Data Timestamp Expected Removal Time database-testing-1591497-8697949-main
2022-12-07T21:47:47Z 2022-12-07T20:10:07Z 2022-12-08 09:51:12 +0000 database-testing-1591497-8697949-ci
2022-12-07T21:47:48Z 2022-12-07T20:46:07Z 2022-12-08 09:51:12 +0000 Artifacts
Brought to you by gitlab-org/database-team/gitlab-com-database-testing. Epic
- A deleted user
added database-testing-automation label
mentioned in merge request !106241 (merged)
- Resolved by Bob Van Landuyt
removed review request for @sgarg_gitlab
mentioned in issue #385205
requested review from @reprazent
- Resolved by Bob Van Landuyt
- Resolved by Matt Kasa
- Resolved by Bob Van Landuyt
@jessieay Looks good! I left a question for you
removed review request for @terrichu
requested review from @terrichu
added databasereviewed label and removed databasereview pending label
@terrichu
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
added pipeline:mr-approved label
mentioned in issue #385221 (closed)
- Resolved by Bob Van Landuyt
- Resolved by Matt Kasa
- Resolved by Bob Van Landuyt
removed review request for @reprazent
added databaseapproved label and removed databasereviewed label
enabled an automatic merge when the pipeline for 973d2157 succeeds
@jessieay, how was your code review experience with this merge request? Please tell us how we can continue to iterate and improve:
- React with a
or a on this comment to describe your experience. - Create a new comment starting with
@gitlab-bot feedback
below, and leave any additional feedback you have for us in the comment.
Interested in learning more tips and tricks to solve your next challenge faster? Subscribe to the GitLab Community Newsletter for contributor-focused content and opportunities to level up.
Thanks for your help!
This message was generated automatically. You're welcome to improve it.
- React with a
mentioned in commit c09f2c2d
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
mentioned in issue #20277 (closed)
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!1748 (merged)
mentioned in issue #388156 (closed)
mentioned in merge request !115707 (merged)
mentioned in merge request !114734 (merged)
added linked-issue label
mentioned in merge request !122635 (merged)
mentioned in merge request gitlab-com/www-gitlab-com!126154 (merged)
mentioned in issue #437947 (closed)
added appsec-kpivulnerability-introduced label