Skip to content
Snippets Groups Projects

Protected containers: Add DELETE REST API for container protection rules

All threads resolved!
  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

Protected containers: Add DELETE REST API for container protection rules

This MR adds the DELETE route to the REST API for container protection rules to allow deleting existing container protection rules.

This is part of #457518 (closed) and still behind a feature flag.

It's the equivalent to the DELETE endpoint for package protection rules, but for the container registry.

:tools: with :heart: at Siemens

MR acceptance checklist

MR Checklist ( @nwittstruck)

How to set up and validate locally

  1. Enable feature flag via rails c:
Feature.enable(:container_registry_protected_containers)
  1. Create a new container protection rule:
curl -k --request POST \
  --url https://gdk.test:3443/api/v4/projects/7/registry/protection/rules \
  --header 'Authorization: Bearer ypCa3Dzb23o5nvsixwPA' \
  --header 'Content-Type: application/json' \
  --data '{
	"repository_path_pattern": "flightjs/flight-needs-to-be-a-unique-path",
	"minimum_access_level_for_push": "maintainer",
        "minimum_access_level_for_delete": "maintainer"
    }'
  1. Now you can delete this rule - just adjust the id to the id returned by the previous command:
curl -k --request DELETE \                                                                                                                                                                 
  --url https://gdk.test:3443/api/v4/projects/7/registry/protection/rules/1 \
  --header 'Authorization: Bearer ypCa3Dzb23o5nvsixwPA'

Related to #457518 (closed)

Edited by Kamil Trzciński

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
  • Nicholas Wittstruck resolved all threads

    resolved all threads

  • requested review from @mkhalifa3 and @marcel.amirault

  • Hi @marcel.amirault! Please review this documentation merge request. This message was generated automatically. You're welcome to improve it.

  • @marcel.amirault @mkhalifa3, this Community contribution is ready for review.

    • Do you have capacity and domain expertise to review this? If not, find one or more reviewers and assign to them.
    • If you've reviewed it, add the workflowin dev label if these changes need more work before the next review.

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

  • Marcel Amirault approved this merge request

    approved this merge request

  • Marcel Amirault removed review request for @marcel.amirault

    removed review request for @marcel.amirault

  • added pipelinetier-3 label and removed pipelinetier-1 label

    • Resolved by Kamil Trzciński

      Before you set this MR to auto-merge

      This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3.

      Before you resolve this discussion, please check the following:

      • You are the last maintainer of this merge request
      • The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
      • This pipeline is recent enough (created in the last 8 hours)

      If all the criteria above apply, please resolve this discussion and the set auto-merge for this merge request.

      See pipeline tiers and merging a merge request for more details.

  • Hi @marcel.amirault :wave:,

    GitLab Bot has added the Technical Writing label because a Technical Writer has approved or merged this MR.

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

  • Moaz Khalifa removed review request for @mkhalifa3

    removed review request for @mkhalifa3

  • added 1 commit

    • 491bcbc4 - Protected containers: Add DELETE REST API for container protection rules

    Compare with previous version

  • Nicholas Wittstruck reset approvals from @marcel.amirault by pushing to the branch

    reset approvals from @marcel.amirault by pushing to the branch

  • Nicholas Wittstruck added 1112 commits

    added 1112 commits

    • 491bcbc4...0adb1a5f - 1109 commits from branch gitlab-org:master
    • cf008789 - Protected containers: Add DELETE REST API for container protection rules
    • aec71ebb - Protected containers: Add DELETE REST API for container protection rules
    • 21ca76e2 - Protected containers: Add DELETE REST API for container protection rules

    Compare with previous version

  • requested review from @mkhalifa3

  • @mkhalifa3, this Community contribution is ready for review.

    • Do you have capacity and domain expertise to review this? If not, find one or more reviewers and assign to them.
    • If you've reviewed it, add the workflowin dev label if these changes need more work before the next review.

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

  • Moaz Khalifa
  • Moaz Khalifa approved this merge request

    approved this merge request

  • added pipelinetier-2 label and removed pipelinetier-1 label

  • Moaz Khalifa requested review from @ayufan and removed review request for @mkhalifa3

    requested review from @ayufan and removed review request for @mkhalifa3

  • Kamil Trzciński approved this merge request

    approved this merge request

  • added pipelinetier-3 label and removed pipelinetier-2 label

  • requested review from @mkhalifa3

  • Kamil Trzciński removed review request for @ayufan

    removed review request for @ayufan

  • Nicholas Wittstruck added 1831 commits

    added 1831 commits

    • 21ca76e2...928a6691 - 1827 commits from branch gitlab-org:master
    • 358d09f9 - Protected containers: Add DELETE REST API for container protection rules
    • 9524ddcf - Protected containers: Add DELETE REST API for container protection rules
    • b7587b43 - Protected containers: Add DELETE REST API for container protection rules
    • 44167e51 - Protected containers: Add DELETE REST API for container protection rules

    Compare with previous version

  • Nicholas Wittstruck reset approvals from @ayufan by pushing to the branch

    reset approvals from @ayufan by pushing to the branch

  • Moaz Khalifa requested review from @ayufan

    requested review from @ayufan

  • Moaz Khalifa removed review request for @mkhalifa3

    removed review request for @mkhalifa3

  • Kamil Trzciński approved this merge request

    approved this merge request

  • Kamil Trzciński marked the checklist item Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA as completed

    marked the checklist item Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA as completed

  • Nicholas Wittstruck added 1328 commits

    added 1328 commits

    • 44167e51...8678b11a - 1324 commits from branch gitlab-org:master
    • d19e4b47 - Protected containers: Add DELETE REST API for container protection rules
    • 4147ef8a - Protected containers: Add DELETE REST API for container protection rules
    • 43719143 - Protected containers: Add DELETE REST API for container protection rules
    • a20ade29 - Protected containers: Add DELETE REST API for container protection rules

    Compare with previous version

  • Nicholas Wittstruck marked the checklist item Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA as incomplete

    marked the checklist item Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA as incomplete

  • Kamil Trzciński resolved all threads

    resolved all threads

  • Kamil Trzciński marked the checklist item Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA as completed

    marked the checklist item Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA as completed

  • Kamil Trzciński enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • Ghost User
  • 2 Warnings
    :warning: 850b6fed: Use full URLs instead of short references (gitlab-org/gitlab#123 or !123), as short references are displayed as plain text outside of GitLab. For more information, take a look at our Commit message guidelines.
    :warning: This merge request does not refer to an existing milestone.
    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 @missy-gitlab profile link current availability (UTC-4) @ayufan profile link current availability (UTC+2)

    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

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 04229c95

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Data Stores | 31     | 0      | 1       | 0     | 32    | ✅     |
    | Create      | 127    | 0      | 12      | 0     | 139   | ✅     |
    | Verify      | 44     | 0      | 2       | 0     | 46    | ✅     |
    | Govern      | 71     | 0      | 0       | 0     | 71    | ✅     |
    | Package     | 16     | 0      | 15      | 0     | 31    | ✅     |
    | Plan        | 70     | 0      | 0       | 0     | 70    | ✅     |
    | Monitor     | 8      | 0      | 0       | 0     | 8     | ✅     |
    | Analytics   | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Manage      | 1      | 0      | 1       | 0     | 2     | ✅     |
    | Release     | 5      | 0      | 0       | 0     | 5     | ✅     |
    | Fulfillment | 2      | 0      | 0       | 0     | 2     | ✅     |
    | Secure      | 2      | 0      | 0       | 0     | 2     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 379    | 0      | 31      | 0     | 410   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-package-and-test: :white_check_mark: test report for a20ade29

    expand test summary
    +--------------------------------------------------------------+
    |                        suites summary                        |
    +---------+--------+--------+---------+-------+-------+--------+
    |         | passed | failed | skipped | flaky | total | result |
    +---------+--------+--------+---------+-------+-------+--------+
    | Package | 28     | 0      | 17      | 1     | 45    | ✅     |
    | Create  | 270    | 0      | 34      | 0     | 304   | ✅     |
    +---------+--------+--------+---------+-------+-------+--------+
    | Total   | 298    | 0      | 51      | 1     | 349   | ✅     |
    +---------+--------+--------+---------+-------+-------+--------+
  • Security policy violations have been resolved.

    Edited by GitLab Security Bot
  • added 422 commits

    • a20ade29...e9b70ffa - 418 commits from branch gitlab-org:master
    • 56290aad - Protected containers: Add DELETE REST API for container protection rules
    • 850b6fed - Protected containers: Add DELETE REST API for container protection rules
    • 098d5042 - Protected containers: Add DELETE REST API for container protection rules
    • 04229c95 - Protected containers: Add DELETE REST API for container protection rules

    Compare with previous version

  • Kamil Trzciński resolved all threads

    resolved all threads

  • Kamil Trzciński enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • @nwittstruck, 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.

  • mentioned in commit e6264b1d

  • mentioned in merge request !162561 (merged)

  • added workflowstaging label and removed workflowcanary label

  • changed milestone to %17.4

  • Please register or sign in to reply
    Loading