Skip to content

Update Store.php #38717

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

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

Update Store.php #38717

wants to merge 8 commits into from

Conversation

thomas-kl1
Copy link
Member

@thomas-kl1 thomas-kl1 commented May 13, 2024

Description (*)

Performance improvment by skipping current store resolution.
Also it makes sense by design that the configuration is resolved from the internal state of the object instead of global context.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Update Store.php #39949: Update Store.php

@m2-github-services m2-github-services added Partner: Dn’D partners-contribution Pull Request is created by Magento Partner labels May 13, 2024
Copy link

m2-assistant bot commented May 13, 2024

Hi @thomas-kl1. Thank you for your contribution!
Here are some useful tips on 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
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@thomas-kl1
Copy link
Member Author

@magento run Unit Tests

@thomas-kl1
Copy link
Member Author

@magento run all tests

@thomas-kl1 thomas-kl1 marked this pull request as ready for review May 14, 2024 20:17
@thomas-kl1
Copy link
Member Author

@magento run all tests

@thomas-kl1
Copy link
Member Author

thomas-kl1 commented May 14, 2024

Failures are not related to PR's changes.

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label May 15, 2024
@engcom-Charlie engcom-Charlie added the Project: Community Picked PRs upvoted by the community label May 13, 2025
@engcom-Charlie engcom-Charlie moved this to Pending Review in Community Dashboard May 13, 2025
@engcom-Bravo engcom-Bravo added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label May 14, 2025
@engcom-Hotel
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

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

Hello @thomas-kl1,

Thanks for the collaboration!

Please fix the failed static test, other failures seems flaky to me. Also update or add unit tests to cover scenarios where isCurrentlySecure() is called for different store scopes.

Thanks

@engcom-Hotel engcom-Hotel moved this from Pending Review to Changes Requested in Community Dashboard May 15, 2025
@thomas-kl1
Copy link
Member Author

@engcom-Hotel it says that copyright must be updated, could you tell me which one should I use?

@engcom-Hotel
Copy link
Contributor

Hello @thomas-kl1,

Currently the copyright is showing something like below:

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

We need to update it something as below:

/**
* Copyright [Year file created] Adobe
* All Rights Reserved.
*/

@thomas-kl1
Copy link
Member Author

@magento run all tests

@engcom-Hotel
Copy link
Contributor

Hello @thomas-kl1,

As per this #38717 (review), please update/add the Unit test as well.

Thanks

@engcom-Dash
Copy link
Contributor

Hello @thomas-kl1

I wanted to check if you are working on the automated unit test coverage. If not, Can I take care of them? Just let me know what works best for you.

Thanks!

@thomas-kl1
Copy link
Member Author

Hello @engcom-Dash
Feel free to contribute the unit test as I've didn't started!
Thanks for proposing!

Regards,

@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

Hello @engcom-Hotel As per review comment, I have updated the Unit tests for the changes done in this PR. Please review the changes.

Thanks!

@engcom-Dash engcom-Dash moved this from Changes Requested to Pending Review in Community Dashboard May 27, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Pending Review to Review in Progress in Community Dashboard May 27, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Review in Progress to Ready for Testing in Community Dashboard May 28, 2025
@engcom-Dash engcom-Dash moved this from Ready for Testing to Testing in Progress in Community Dashboard May 28, 2025
@engcom-Dash engcom-Dash self-assigned this May 28, 2025
@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

@magento create issue

@m2-assistant m2-assistant bot mentioned this pull request May 28, 2025
5 tasks
@engcom-Dash
Copy link
Contributor

@thomas-kl1 Thank you for the contribution & collaboration!

✔️ QA Passed

Before:

$secureBaseUrl = $this->_config->getValue(self::XML_PATH_SECURE_BASE_URL, ScopeInterface::SCOPE_STORE);
$secureFrontend = $this->_config->getValue(self::XML_PATH_SECURE_IN_FRONTEND, ScopeInterface::SCOPE_STORE);

After:

$secureBaseUrl = $this->_config->getValue(self::XML_PATH_SECURE_BASE_URL, ScopeInterface::SCOPE_STORE, $this->getId());
$secureFrontend = $this->_config->getValue(self::XML_PATH_SECURE_IN_FRONTEND, ScopeInterface::SCOPE_STORE, $this->getId());

By looking at the code changes, it make sense that Instead of relying on Magento's global context to determine the current store, it explicitly passes the store ID ($this->getId()) to the getValue() method to avoid global context resolution. By passing the store ID directly, Magento skips the logic to resolve the current store leads to performance improvement.

Some of the builds are failing hence moving this PR in Extended Testing.

@engcom-Dash engcom-Dash moved this from Testing in Progress to Extended testing (optional) in Community Dashboard May 28, 2025
@engcom-Dash
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

@engcom-Dash
Copy link
Contributor

The consistent test failures for Functional B2B are known Issues and JIRA is raised for them.

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38717/5e68b04fbb3659bc7ef7cf69169d53ee/Functional/allure-report-b2b/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38717/25576e9260329ebaaccd3de4746bcc47/Functional/allure-report-b2b/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Known Issues:
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007
StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest : ACQE-7971
OrderWithMultipleConfigurableProductsAdditionalStockTest : ACQE-8060

The consistent test failures for Functional CE is known Issues and JIRA is raised for the same. Other failures are inconsistent and seems to be flaky. They neither part of PR nor failing because of the PR changes.

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38717/c5c3d6de76be2d1ddb6ea5ea07a179c4/Functional/allure-report-ce/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38717/1a55e2d062de177195a446db652b185d/Functional/allure-report-ce/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Known Issues:
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007

The consistent test failure for Functional EE is known Issues and JIRA is raised for the same. Other failures are inconsistent and seems to be flaky. They neither part of PR nor failing because of the PR changes.

Build 1:https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38717/3e0678658d81029dec691947a3884348/Functional/allure-report-ee/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38717/f8e698cc42082ecd836fb8c863c29bb6/Functional/allure-report-ee/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Known Issues:
EnablePaypalExpressCheckoutAndSubmitAnOrderUsingPaypalExpressCheckoutTest : ACQE-8007

Hence moving this PR in Merge In Progress.

@engcom-Dash engcom-Dash moved this from Extended testing (optional) to Merge in Progress in Community Dashboard May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Dn’D partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Project: Community Picked PRs upvoted by the community Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Merge in Progress
Development

Successfully merging this pull request may close these issues.

[Issue] Update Store.php
6 participants