magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Allow use of CIDR ranges in maintenance allow list

Open fredden opened this issue 5 years ago • 70 comments

Description

The current maintenance mode allow IP list only permits individual addresses to be allowed to bypass maintenance mode. This pull request expands this to allow ranges in CIDR format.

Related Pull Requests

Fixed Issues

  1. Fixes https://github.com/magento/community-features/issues/233

Manual testing scenarios

  1. Enable maintenance mode with php bin/magento maintenance:enable
  2. Allow individual IP address, eg php bin/magento maintenance:allow-ips --add 192.168.10.180
  3. Allow multiple individual IP addresses, eg php bin/magento maintenance:allow-ips --add 192.168.10.170 192.168.10.190
  4. Allow range of IP addresses, eg php bin/magento maintenance:allow-ips --add 192.168.10.160/27
  5. Allow IPv4 & IPv6 addresses, eg php bin/magento maintenance:allow-ips --add 192.168.46.0/24 fd12:3456:789a:1::1/64

Questions or comments

None

Contribution checklist (*)

  • [x] Pull request has a meaningful description of its purpose
  • [x] All commits are accompanied by meaningful commit messages
  • [x] All new or changed code is covered with unit/integration tests (if applicable)
  • [x] All automated tests passed successfully (all builds are green)

Resolved issues:

  1. [x] resolves magento/magento2#37943: Allow use of CIDR ranges in maintenance allow list

fredden avatar Oct 29 '20 00:10 fredden

Hi @fredden. Thank you for your contribution Here is some useful tips how you can test your changes using Magento test environment. Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

:exclamation: Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s) For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

:information_source: Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

:warning: According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Oct 29 '20 00:10 m2-assistant[bot]

@magento import pull request to https://github.com/magento-tsg/magento2ce

okorshenko avatar Oct 29 '20 15:10 okorshenko

@okorshenko the pull request successfully imported.

magento-engcom-team avatar Oct 29 '20 15:10 magento-engcom-team

  • Integration Tests are marked here as failed, but all the detail pages show green with no amber nor red.
  • Static Tests & Unit Tests are failing due to a problems with the testing framework. How do I get the testing framework to read composer.json?

fredden avatar Oct 31 '20 18:10 fredden

In general - looks good. @engcom-Charlie could you help with failing unit & static tests? Seems like there some additional changes might be required for the b2b/ee versions.

ihor-sviziev avatar Nov 02 '20 10:11 ihor-sviziev

@magento run Database Compare, Functional Tests B2B, Functional Tests EE

ihor-sviziev avatar Nov 07 '20 06:11 ihor-sviziev

I've opened a pull request for Commerce and mentioned this in the "Related Pull Requests" section of both descriptions. This has worked on another pull request where changes to both were required, but isn't working here.

fredden avatar Nov 07 '20 09:11 fredden

@magento run all tests

ihor-sviziev avatar Nov 07 '20 10:11 ihor-sviziev

@fredden thx, usually we should rerun all tests after adding related pull request

ihor-sviziev avatar Nov 07 '20 10:11 ihor-sviziev

@fredden seems like you created PR to wrong repo, you can find all used repos on the following page https://github.com/magento/magento2/runs/1367438381

ihor-sviziev avatar Nov 07 '20 10:11 ihor-sviziev

I did run all tests. Please see this pull request where pull requests from exactly these same two repositories are linked correctly: https://github.com/magento/magento2/pull/28216/checks?check_run_id=1197882558 What's different / wrong here?

fredden avatar Nov 07 '20 10:11 fredden

@fredden unfortunately I don't know. @sidolov @gabrieldagama could you help with linking related pull request?

ihor-sviziev avatar Nov 07 '20 10:11 ihor-sviziev

@magento run all tests

sidolov avatar Nov 09 '20 16:11 sidolov

Hi @ihor-sviziev, thank you for the review. ENGCOM-8444 has been created to process this Pull Request

magento-engcom-team avatar Nov 09 '20 20:11 magento-engcom-team

@magento run all tests

ihor-sviziev avatar Nov 25 '20 04:11 ihor-sviziev

@magento run all tests

ihor-sviziev avatar Nov 25 '20 07:11 ihor-sviziev

@sidolov @sivaschenko @gabrieldagama could you provide info why tests are failing without build reports?

ihor-sviziev avatar Nov 25 '20 09:11 ihor-sviziev

Hi @ihor-sviziev, @fredden

There are conflicts on the related PR magento/partners-magento2ee#407, the conflicts have to be resolved before running the tests.

gabrieldagama avatar Nov 25 '20 10:11 gabrieldagama

Hi @fredden, Could you resolve conflicts on related EE repo?

ihor-sviziev avatar Nov 25 '20 10:11 ihor-sviziev

@magento run Functional Tests B2B, Functional Tests EE

ihor-sviziev avatar Nov 25 '20 14:11 ihor-sviziev

@magento run all tests

ihor-sviziev avatar Nov 26 '20 19:11 ihor-sviziev

Hi @ihor-sviziev, thank you for the review. ENGCOM-8444 has been created to process this Pull Request

magento-engcom-team avatar Nov 30 '20 08:11 magento-engcom-team

@ihor-sviziev this looks good. Can you update it for the latest development version so there is no merge conflict?

PascalBrouwers avatar Jun 23 '21 07:06 PascalBrouwers

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Pull Requests are not mergeable to the mainline. Please merge the latest mainlines to your Pull Requests and restart the builds.

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@fredden any updates on this? It would be very useful to have this feature.

MartynasKasp avatar Jan 17 '23 11:01 MartynasKasp

@MartynasKasp what would you like from me? I keep resolving the merge conflicts, but am otherwise waiting for Adobe to process this pull request.

fredden avatar Jan 17 '23 19:01 fredden