Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add subnet mask IP support for maintenance mode #28934

Open
wants to merge 11 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

AntonEvers
Copy link
Contributor

@AntonEvers AntonEvers commented Jun 30, 2020

Description

Maintenance mode should accept IP ranges instead of separate IP's so that for instance you can add the whole range of your payment service provider or CDN etc...

Fixed Issues (if relevant)

  1. PR add subnet mask IP support for maintenance mode #10570

Manual testing scenarios

  1. run bin/magento maintenance:enable
  2. run bin/magento maintenance:allow-ips 192.168.33.0/16 (for instance)
  3. get access to the site

Mostly I am curious what you think about this kind of functionality and the use of darsyn/ip for this. I did take IPv6 into account.

Contribution checklist

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

Resolved issues:

  1. resolves [Issue] add subnet mask IP support for maintenance mode #29657: add subnet mask IP support for maintenance mode

@m2-assistant
Copy link

m2-assistant bot commented Jun 30, 2020

Hi @AntonEvers. 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

❗ 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

ℹ️ 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.

@AntonEvers
Copy link
Contributor Author

@magento run Unit Tests

@rogyar rogyar self-assigned this Jun 30, 2020
@rogyar rogyar added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: advanced labels Jun 30, 2020
@AntonEvers AntonEvers requested a review from rogyar June 30, 2020 13:43
@AntonEvers
Copy link
Contributor Author

@magento run all tests

@AntonEvers
Copy link
Contributor Author

@rogyar I think we're good, right? The first 2 static tests seem to fail on every PR so I don't think they have anything to do with this addition.

@rogyar
Copy link
Contributor

rogyar commented Jul 6, 2020

Hi @AntonEvers. The static code checks inform that we have introduced a new dependency Symfony\Component\HttpFoundation\IpUtils in the framework within the scope of current PR. So this dependency needs to be added to the root composer.json of the project.

@AntonEvers
Copy link
Contributor Author

@magento run Static Tests

@AntonEvers
Copy link
Contributor Author

@magento run Database Compare, Functional Tests CE, Functional Tests EE, Functional Tests B2B, Integration Tests, Magento Health Index, Sample Data Tests CE, Sample Data Tests EE, Sample Data Tests B2B, Unit Tests, WebAPI Tests

@AntonEvers
Copy link
Contributor Author

@magento run Semantic Version Checker

@AntonEvers
Copy link
Contributor Author

@magento run Static Tests

1 similar comment
@AntonEvers
Copy link
Contributor Author

@magento run Static Tests

@rogyar
Copy link
Contributor

rogyar commented Jul 12, 2020

Hi @AntonEvers we are good here. The failing static test for EE means that the newly introduced dependency should be also added to the root composer.json of the Commerce Edition repo. If you have access to this repo, feel free to make a small PR with adding the dependency to the root composer.json. If you don't have the access, let me know, I will help you.

Thank you.

@AntonEvers
Copy link
Contributor Author

process code review points

alter version constraint for symfony/http-foundation to match previous version
@engcom-Kilo
Copy link
Contributor

engcom-Kilo commented Aug 21, 2020

@AntonEvers
Added test cases with IPv6

Bellow added GIFs.

ip6-1
ip6-ip
ip6-allow-ips

* upstream/2.4-develop: (1179 commits)
  improve test
  Revert "Add validation phone field on checkout page"
  rename action group
  Minor refactoring to AccessChangeQuoteControl and it's Unit Tests
  Refactor Unit Tests too (remove "expects any()")
  Refactor Unit Tests too
  Minor Refactor
  MC-36748: strpos() expects parameter 1 to be string, bool given
  MC-36748: strpos() expects parameter 1 to be string, bool given
  Fix flaky behavior with mftf test
  add AdminOrderClickSubmitOrderActionGroup
  MC-36652: Restricted admin can view "Products in Carts" from all websites
  rever removed line by php-cs-fixer
  Improve comparsion remove exif data from other images
  PWA-805: Expose localization system / store config from GraphQL
  Improve metadata types && isExifSegment() verification for jpeg
  Fix ui-select options placeholders for url-filter-applier && Clean cached options for ui-select component after closing slide form
  Fix static tests
  Update docBlock
  Remove obsolete tests
  ...
@AntonEvers
Copy link
Contributor Author

@magento run all tests

@engcom-Kilo conflict resolved. The test failure should be resolved by combining this PR with Magento Commerce PR https://github.com/magento/magento2ee/pull/2465

@engcom-Hotel engcom-Hotel self-assigned this Aug 25, 2020
@engcom-Kilo engcom-Kilo removed their assignment Aug 25, 2020
@engcom-Hotel engcom-Hotel added the QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) label Aug 25, 2020
@@ -76,6 +76,7 @@
"ramsey/uuid": "~3.8.0",
"symfony/console": "~4.4.0",
"symfony/event-dispatcher": "~4.4.0",
"symfony/http-foundation": "^3.4|^4.0|^5.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New composer dependency must be approved.

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run all tests

1 similar comment
@gabrieldagama
Copy link
Contributor

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run Static Tests, Functional Tests

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run all tests

1 similar comment
@gabrieldagama
Copy link
Contributor

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run Functional Tests, B2B Static Tests

@engcom-Hotel
Copy link
Contributor

@magento run all tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: advanced Award: test coverage Component: App Component: Composer Component: HTTP Component: Setup Priority: P3 May be fixed according to the position in the backlog. Progress: review QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

[Issue] add subnet mask IP support for maintenance mode
8 participants