Skip to content
Snippets Groups Projects

Protected containers: Create protection rules in project settings

All threads resolved!

What does this MR do and why?

feat: Protected containers: Protection rules in project settings ui

:tools: with :heart: at Siemens

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.

MR Checklist (@gerardo-navarro)

Screenshots or screen recordings

Screencast: https://www.loom.com/share/8f1db270e25346b584fd0057ce1a554a

image

How to set up and validate locally

  1. Enable Registry by editting config/gitlab.yml with the following setting
registry:
  enabled: true
  1. Restart GDK, see also https://docs.gitlab.com/ee/administration/packages/container_registry.html#configure-container-registry-under-an-existing-gitlab-domain
gdk restart
  1. In rails console enable the experiment fully
Feature.enable(:container_registry_protected_containers)
  1. Go to http://gdk.test:3000/flightjs/Flight/-/settings/packages_and_registries
  2. Start adding new container protection rules in the second half of the page and play around with the form

Related to #441345 (closed)

Edited by Gerardo Navarro

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
  • Marcel Amirault removed review request for @marcel.amirault

    removed review request for @marcel.amirault

  • Ezekiel Kigbo changed milestone to %16.11

    changed milestone to %16.11

  • Ezekiel Kigbo
  • Ezekiel Kigbo
    • Resolved by Ezekiel Kigbo

      Thanks for the great work @gerardo-navarro, I had a few suggestions and nitpicks otherwise back over to you.

      Additionally, I couldn't see any tests for the feature flag state, I would expect to at least see a test that shows the form is not available when the feature flag is disabled :thinking:, I might have missed this from a previous MR though.

      Back over to you :ping_pong:

  • Gerardo Navarro changed the description

    changed the description

  • added 1 commit

    Compare with previous version

  • Gerardo Navarro added 510 commits

    added 510 commits

    Compare with previous version

  • Sascha Eggenberger changed the description

    changed the description

  • added 1 commit

    Compare with previous version

  • Gerardo Navarro mentioned in merge request !148699

    mentioned in merge request !148699

  • Gerardo Navarro mentioned in merge request !148704 (merged)

    mentioned in merge request !148704 (merged)

  • Annabel Dunstone Gray approved this merge request

    approved this merge request

  • removed review request for @annabeldunstone

  • Gerardo Navarro requested review from @ekigbo

    requested review from @ekigbo

  • requested review from @marcel.amirault

  • Marcel Amirault removed review request for @marcel.amirault

    removed review request for @marcel.amirault

  • Gerardo Navarro changed the description

    changed the description

  • Gerardo Navarro added 286 commits

    added 286 commits

    Compare with previous version

  • Gerardo Navarro mentioned in merge request !148838 (merged)

    mentioned in merge request !148838 (merged)

  • added 1 commit

    Compare with previous version

    • Resolved by Gerardo Navarro

      @gerardo-navarro It looks like we have some related ~frontend test failures. As far as I can tell:

      • the submit button was renamed from Protect to Add rule
      • we do not disable the form inputs

      This should fix those:

      diff --git a/spec/frontend/packages_and_registries/settings/project/settings/components/container_protection_rule_form_spec.js b/spec/frontend/packages_and_registries/settings/project/settings/components/container_protection_rule_form_spec.js
      index 40a56c85dd7b..1da15193b06f 100644
      --- a/spec/frontend/packages_and_registries/settings/project/settings/components/container_protection_rule_form_spec.js
      +++ b/spec/frontend/packages_and_registries/settings/project/settings/components/container_protection_rule_form_spec.js
      @@ -29,7 +29,7 @@ describe('container Protection Rule Form', () => {
           wrapper.findByRole('combobox', { name: /push protected up to access level/i });
         const findDeleteProtectedUpToAccessLevelSelect = () =>
           wrapper.findByRole('combobox', { name: /delete protected up to access level/i });
      -  const findSubmitButton = () => wrapper.findByRole('button', { name: /protect/i });
      +  const findSubmitButton = () => wrapper.findByRole('button', { name: /add rule/i });
       
         const mountComponent = ({ config, provide = defaultProvidedValues } = {}) => {
           wrapper = mountExtended(ContainerProtectionRuleForm, {
      @@ -77,7 +77,6 @@ describe('container Protection Rule Form', () => {
       
             it('disables all form fields', () => {
               expect(findSubmitButton().props('disabled')).toBe(true);
      -        expect(findRepositoryPathPatternInput().attributes('disabled')).toBe('disabled');
               expect(findPushProtectedUpToAccessLevelSelect().attributes('disabled')).toBe('disabled');
               expect(findDeleteProtectedUpToAccessLevelSelect().attributes('disabled')).toBe('disabled');
             });
      
  • Gerardo Navarro added 266 commits

    added 266 commits

    Compare with previous version

  • Gerardo Navarro added 220 commits

    added 220 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 2 commits

    Compare with previous version

  • Ezekiel Kigbo resolved all threads

    resolved all threads

  • Ezekiel Kigbo approved this merge request

    approved this merge request

  • Thanks for all the great work @gerardo-navarro LGTM!

  • Ezekiel Kigbo enabled an automatic merge when the pipeline for f9738343 succeeds

    enabled an automatic merge when the pipeline for f9738343 succeeds

  • 2 Warnings
    :warning: This merge request is quite big (535 lines changed), please consider splitting it into multiple merge requests.
    :warning:

    featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.

    For more information, see:

    Reviewer roulette

    Category Reviewer Maintainer
    frontend @lorenzvanherwaarden profile link current availability (UTC+2) @slashmanov profile link current availability (UTC+4)
    UX @pedroms profile link current availability (UTC+1) Maintainer review is optional for UX

    Please check reviewer's status!

    • available Reviewer is available!
    • unavailable Reviewer is unavailable!

    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

  • Bundle size analysis [beta]

    This compares changes in bundle size for entry points between the commits ef57c6e7 and 45effae4

    :sparkles: Special assets

    Entrypoint / Name Size before Size after Diff Diff in percent
    average 4.25 MB 4.25 MB - 0.0 %
    mainChunk 3.23 MB 3.23 MB - 0.0 %

    :fearful: Significant Growth: 1

    Expand
    Entrypoint / Name Size before Size after Diff Diff in percent
    pages.projects.settings.packages_and_registries.show 471.43 KB 485.84 KB +14.4 KB 3.1 %

    Your MR has at least one entrypoint growing significantly (more > 1 KB or 2%). If you write new or extend existing features, this is expected and there is nothing to worry about.

    Please consider pinging someone from the FE Foundations (@leipert, @markrian, @pgascouvaillancourt, @sdejonge or @thutterer) for review, if you are unsure about the size increase.

    Note: We do not have exact data for ef57c6e7. So we have used data from: a3aabce1.
    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 :no_entry_sign: Danger

  • mentioned in commit b7cb3e61

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 45effae4

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 77     | 0      | 9       | 0     | 86    | ✅     |
    | Data Stores | 31     | 0      | 0       | 0     | 31    | ✅     |
    | Govern      | 66     | 0      | 0       | 0     | 66    | ✅     |
    | Package     | 24     | 0      | 6       | 0     | 30    | ✅     |
    | Plan        | 51     | 0      | 2       | 0     | 53    | ✅     |
    | Monitor     | 7      | 0      | 0       | 0     | 7     | ✅     |
    | Verify      | 35     | 0      | 1       | 0     | 36    | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Manage      | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Release     | 5      | 0      | 0       | 0     | 5     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 298    | 0      | 19      | 0     | 317   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-package-and-test: :white_check_mark: test report for 45effae4

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Package     | 206    | 0      | 38      | 0     | 244   | ✅     |
    | Create      | 152    | 0      | 21      | 2     | 173   | ✅     |
    | Plan        | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Monitor     | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Govern      | 6      | 0      | 0       | 0     | 6     | ✅     |
    | Data Stores | 4      | 0      | 0       | 0     | 4     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 384    | 0      | 59      | 2     | 443   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
  • mentioned in commit f5af232f

  • Gerardo Navarro added 76 commits

    added 76 commits

    Compare with previous version

  • Ezekiel Kigbo enabled an automatic merge when the pipeline for 02098182 succeeds

    enabled an automatic merge when the pipeline for 02098182 succeeds

  • @gerardo-navarro, how was your code review experience with this merge request? Please tell us how we can continue to iterate and improve:

    1. React with a :thumbsup: or a :thumbsdown: on this comment to describe your experience.
    2. Create a new comment starting with @gitlab-bot feedback below, and leave any additional feedback you have for us in the comment.

    Subscribe to the GitLab Community Newsletter for contributor-focused content and opportunities to level up.

    Thanks for your help! :heart:

    This message was generated automatically. You're welcome to improve it.

  • Ezekiel Kigbo mentioned in commit 01edc95c

    mentioned in commit 01edc95c

  • Gerardo Navarro changed the description

    changed the description

  • added workflowstaging label and removed workflowcanary label

  • Gerardo Navarro mentioned in merge request !146622 (merged)

    mentioned in merge request !146622 (merged)

  • mentioned in merge request omnibus-gitlab!7682 (merged)

  • mentioned in issue #480012

  • Please register or sign in to reply
    Loading