Validation to prevent default project, group visibility being restricted
What does this MR do and why?
Related to #415524 (closed), on SaaS, user registration go through the Create or import your first project
page, when either one of the default_group_visibility
and default_project_visibility
is restricted, user sees the following errors:
Can not create group | Can not create project |
---|---|
![]() |
![]() |
Screenshots or screen recordings
- Example setting that triggers the validation error
- Validation error message
How to set up and validate locally
- Simulate SaaS
- Turn on the feature flag by going to rails console and run
Feature.enable(:prevent_visibility_restriction)
- Log in as admin
- Go to
/admin/application_settings/general#js-visibility-settings
- Select
Internal
underDefault group visibility
- Check
Internal
underRestricted visibility levels
- Submit the form
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 %Backlog
added 1 commit
- 428af8a5 - Disable default group visibility level option in restricted visibility levels setting
1 Warning 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 Sylvester Chin (
@schin1
) (UTC+8)Matthias Käppler (
@mkaeppler
) (UTC+2)test for spec/features/*
Sylvester Chin (
@schin1
) (UTC+8)Maintainer review is optional for test for spec/features/*
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
- 5bddfebe - Disable default group visibility level option in restricted visibility levels setting
Bundle size analysis [beta]
This compares changes in bundle size for entry points between the commits 628f61a1 and 5bddfebe
Special assetsEntrypoint / Name Size before Size after Diff Diff in percent average 4.13 MB 4.13 MB - 0.0 % mainChunk 2.99 MB 2.99 MB - 0.0 %
Note: We do not have exact data for 628f61a1. So we have used data from: 0652bbbe.
The intended commit has no webpack pipeline, so we chose the last commit with one before it.Please look at the full report for more details
Read more about how this report works.
Generated by
Dangermentioned in issue #415524 (closed)
Allure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for aad73efaexpand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Verify | 8 | 0 | 0 | 8 | 8 | ❗ | | Data Stores | 20 | 0 | 0 | 15 | 20 | ❗ | | Govern | 19 | 0 | 0 | 18 | 19 | ❗ | | Create | 19 | 0 | 0 | 18 | 19 | ❗ | | Plan | 47 | 0 | 0 | 40 | 47 | ❗ | | Manage | 12 | 0 | 1 | 12 | 13 | ❗ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 125 | 0 | 1 | 111 | 126 | ❗ | +-------------+--------+--------+---------+-------+-------+--------+
e2e-review-qa:
test report for 5bddfebeexpand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | | Create | 8 | 0 | 1 | 1 | 9 | ❗ | | Plan | 3 | 0 | 1 | 0 | 4 | ✅ | | Manage | 1 | 0 | 0 | 0 | 1 | ✅ | | Monitor | 4 | 0 | 0 | 0 | 4 | ✅ | | Data Stores | 2 | 0 | 0 | 0 | 2 | ✅ | | Govern | 2 | 0 | 0 | 0 | 2 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 20 | 0 | 3 | 1 | 23 | ❗ | +------------------+--------+--------+---------+-------+-------+--------+
e2e-package-and-test:
test report for aad73efaexpand test summary
+-------------------------------------------------------------+ | suites summary | +--------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +--------+--------+--------+---------+-------+-------+--------+ | Growth | 0 | 0 | 4 | 0 | 4 | ➖ | +--------+--------+--------+---------+-------+-------+--------+ | Total | 0 | 0 | 4 | 0 | 4 | ➖ | +--------+--------+--------+---------+-------+-------+--------+
- Resolved by Doug Stull
added 1 commit
- 515ef29a - Disable default group visibility level option in restricted visibility levels setting
- Resolved by Doug Stull
- Resolved by Christina Lohr
- Resolved by Doug Stull
- Resolved by Doug Stull
added 1 commit
- 9e53b5d8 - Disable default group visibility level option in restricted visibility levels setting
- Resolved by Thong Kuah
@dstull suggestions applied! I guess after your review, I can ask folks from grouptenant scale for maintainer review?
requested review from @dstull
- Resolved by Doug Stull
removed review request for @dstull
added 1 commit
- 30aeef3d - Add validation for default_group_visility when on saas
requested review from @dstull
@dstull
, 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
removed review request for @tkuah
added 1404 commits
-
30aeef3d...a679324a - 1403 commits from branch
master
- 74c86e7b - Add validation for default_group_visility when on saas
-
30aeef3d...a679324a - 1403 commits from branch
- Resolved by Thong Kuah
@tkuah I think from the discussions here, we can agree on that a fix is needed to prevent the conflicting settings. And we should go for fixing it for both SM and SaaS. I can progress following your suggestions here:
- With that in mind I suggest we release this validation behind a
development
feature flag but in Core - I also think Doug's idea of only validating if values have changed is a good idea.
- Also potentially we can skip this validation when all levels have been restricted.
Just have couple questions:
- Could you explain a bit on why put it behind a FF?
- I assume your third point is to protect SM instances that have all levels restricted, but if we switch to validate only on change, should that be enough?
- With that in mind I suggest we release this validation behind a
added Technical Writing label
mentioned in issue #417192 (closed)
changed milestone to %16.2
added 584 commits
-
74c86e7b...c94d4c7c - 583 commits from branch
master
- b11b4edc - Add validation for default_group_visility when on saas
-
74c86e7b...c94d4c7c - 583 commits from branch
added 1354 commits
-
b11b4edc...6cee5b41 - 1353 commits from branch
master
- 4861fc36 - Add validation for default_group_visility when on saas
-
b11b4edc...6cee5b41 - 1353 commits from branch
added 1 commit
- 1d095acc - Add validation to prevent visibility restriction
- A deleted user
added feature flag label
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@7c69e667
added 1 commit
- ced17840 - Add validation to prevent visibility restriction
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@61856db6
added 1 commit
- 2871df23 - Add validation to prevent visibility restriction
added 1 commit
- db64fd38 - Add validation to prevent visibility restriction
changed milestone to %16.3
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@c1c586fd
@tkuah I updated this MR to add validations for default project visibility and default group visibility behind a feature flag. Would you mind giving this another review?
requested review from @tkuah
- Resolved by Roy Liu
- Resolved by Thong Kuah
Documentation
When we default enable, or remove the feature flag, let's make sure to update https://docs.gitlab.com/ee/administration/settings/visibility_and_access_controls.html#restrict-visibility-levels to note admins cannot restrict a default visibility level.
- Resolved by Thong Kuah
removed review request for @tkuah
- Resolved by Thong Kuah
Thanks @rliu-int ! Looks great to me. Just one suggestion for specs in !124649 (comment 1478234292).
The other two threads can be in follow-up issues.
added 1 commit
- 52bbd81a - Add validation to prevent visibility restriction
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@8a438227
mentioned in issue #419316 (closed)
requested review from @tkuah
- Resolved by Thong Kuah
- Resolved by Thong Kuah
One last suggestion @rliu-int :)
removed review request for @tkuah
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@798d52b0
requested review from @tkuah
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@2a9f974e
enabled an automatic merge when the pipeline for c846f94e succeeds
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@c846f94e
mentioned in commit 2d3cdde2
added workflowstaging-canary label and removed workflowin dev label
added workflowcanary label and removed workflowstaging-canary label
added workflowproduction label and removed workflowcanary label
added workflowstaging label and removed workflowproduction label
added workflowpost-deploy-db-staging label and removed workflowstaging label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
added releasedcandidate label
added releasedpublished label and removed releasedcandidate label
mentioned in merge request !131203 (merged)
mentioned in issue #433280 (closed)
mentioned in merge request !138370 (merged)