Skip to content

Conversation

@quterorta
Copy link
Contributor

@quterorta quterorta commented Jul 12, 2024

  • fixed issue by providing needed area code as a function argument

Description (*)

This issue is caused because, during deployment of the static content, the plugin Magento\Csp\Plugin\GenerateAssetIntegrity from the Magento_Csp module generates integrity for the RequireJs config by loading the file content and hashing them. The main reason for this issue is that static content deployment is executing via CLI so the area wasn't set. But the changed class has in the constructor _code param with the needed area code, so all my fix is providing the needed area code as an argument (instead of a null value).

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes "Area code not set" after update to 2.4.5-p8 #38845

Manual testing scenarios (*)

Steps to reproduce:

  1. Set deployment mode as production (bin/magento deploy:mode:set production)
  2. Enable the Magento_Csp module (bin/magento module:enable Magento_Csp, if module status changes, run bin/magento setup:upgrade)
  3. Set "dev/js/translate_strategy" config to "embedded" (bin/magento config:set dev/js/translate_strategy embedded)
  4. Flish caches (bin/magento cache:flush)
  5. Run bin/magento setup:static-content:deploy

Expected result:
Successful finish
image

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)

- fixed issue by providing needed area code as a function argue
@m2-assistant
Copy link

m2-assistant bot commented Jul 12, 2024

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

@m2-github-services m2-github-services added Partner: Perspective Team partners-contribution Pull Request is created by Magento Partner labels Jul 12, 2024
@m2-community-project m2-community-project bot added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: pending review labels Jul 12, 2024
@quterorta
Copy link
Contributor Author

@magento run all tests

@sinhaparul sinhaparul added the Project: Community Picked PRs upvoted by the community label Jul 17, 2024
@quterorta
Copy link
Contributor Author

@magento run all tests

@engcom-Hotel
Copy link
Contributor

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

@engcom-Hotel
Copy link
Contributor

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

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.

Failed builds seem flaky to me. Hence approving this PR.

@engcom-Bravo
Copy link
Contributor

@magento run all tests

@engcom-Bravo
Copy link
Contributor

Hi @quterorta,

Thanks for the collaboration & contribution!

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Steps to reproduce

  • Set deployment mode as production (bin/magento deploy:mode:set production)
  • Enable the Magento_Csp module (bin/magento module:enable Magento_Csp, if module status changes, run bin/magento setup:upgrade)
  • Set "dev/js/translate_strategy" config to "embedded" (bin/magento config:set dev/js/translate_strategy embedded)
  • Flish caches (bin/magento cache:flush)
  • Run bin/magento setup:static-content:deploy

Before: ✖️ 

Screenshot 2024-07-22 at 11 16 43

After: ✔️

Screenshot 2024-07-22 at 11 33 52

Builds are failed. Hence, moving this PR to Extended Testing.

Thanks.

@engcom-Charlie
Copy link
Contributor

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

@engcom-Charlie
Copy link
Contributor

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

@engcom-Charlie
Copy link
Contributor

Few test failures in recent 2 builds for functional B2B, CE and EE are not consistent and remaining are known issues. Hence moving it to Merge in Progress.

Functional B2B: Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38922/f650d14f2d58c8d31a246153acd95e45/Functional/allure-report-b2b/index.html
image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38922/649ed7430a2cacff2acd6407f610f203/Functional/allure-report-b2b/index.html#categories/a644910ae0cb11e839a98baa21929b76/59a1de34ab4fa393/
image

Functional CE: Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38922/84611a16475bb144ef443b0cc46aed7a/Functional/allure-report-ce/index.html
image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38922/2cd6911ab7e420c9ccff104f4f4c59ce/Functional/allure-report-ce/index.html#categories/a62c3d6db6631ba28c4130df03eca285/dad6ed895aaca664/
image

Functional EE: Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38922/167e929e6a24b779007beef46bb130d2/Functional/allure-report-ee/index.html#categories
image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/38922/f13306c4b7769c2f988d2241c5896358/Functional/allure-report-ee/index.html#categories/8f0831c1d06562890f5ec21062dae309/81cc980a7baa9646/
image

Known issues in CE, EE, B2B:

  1. StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest: #ACQE-6786
  2. StorefrontCashOnDeliveryPaymentForSpecificCountryTest: #ACQE-6774
  3. StorefrontCreateOrderAllQuantityGroupedProductOptionDefaultStockTest: #ACQE-6331
  4. StorefrontLoginFormCheckDuplicateValidateMessageTest: #ACQE-6799
  5. TierPricingWhenPriceScopeIsWebsiteWorkingProperlyWithMultipleCurrenciesConfiguredTest: #ACQE-6695

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 58a435b into magento:2.4-develop Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Partner: Perspective Team 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. Progress: accept Project: Community Picked PRs upvoted by the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Area code not set" after update to 2.4.5-p8

7 participants