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

Static content is deploying for disabled modules #24666

Closed
shkodasv opened this issue Sep 20, 2019 · 18 comments · Fixed by #32922
Closed

Static content is deploying for disabled modules #24666

shkodasv opened this issue Sep 20, 2019 · 18 comments · Fixed by #32922
Assignees
Labels
Area: UI Framework Component: Css Component: Deploy Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Done Has been reviewed and prioritized during Triage with Product Managers
Milestone

Comments

@shkodasv
Copy link

shkodasv commented Sep 20, 2019

Summary (*)

  • Original summary from the reporter :

I disable module output for several modules (e.g Checkout, GiftRegestry) and would like to know how to exclude CSS related to these modules from styles-l/styles-m files? As I don't need to load extra CSS

Preconditions (*)

  • reproduced on 2.3-develop

Steps to reproduce (*)

  1. Setup vanilla 2.3-develop installation
  2. Take a look at the file app/design/frontend/Magento/blank/Magento_Braintree/web/css/source/_module.less, notice the selector .payment-method-braintree is in there and also notice this selector is in no other file in the Magento source code except for this file in the Magento_Braintree module in the
    Magento/Blank theme.
  3. Now disable that module (and its dependency): bin/magento module:disable Magento_Braintree Magento_BraintreeGraphQl
  4. Remove potential left over files: rm -R var/view_preprocessed/* pub/static/*
  5. Run static content deploy: bin/magento setup:static-content:deploy -f --theme Magento/blank en_US
  6. Look at the generated file pub/static/frontend/Magento/blank/en_US/css/styles-m.css

Expected result (*)

  • Not finding a reference to the selector .payment-method-braintree

Actual result (*)

  • Finding references to the selector .payment-method-braintree

Update: In hindsight, @shkodasv is talking about the deprecated "disabling module output" feature of Magento which was removed in Magento 2.2 I believe. But the issue is still valid for disabled modules as well, or should we open a new issue then?

@m2-assistant
Copy link

m2-assistant bot commented Sep 20, 2019

Hi @shkodasv. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

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

@shkodasv do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 20, 2019
@engcom-Bravo engcom-Bravo self-assigned this Sep 20, 2019
@m2-assistant
Copy link

m2-assistant bot commented Sep 20, 2019

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo
Copy link
Contributor

Hello @shkodasv. Thanks for applying, but the GitHub issue tracker is intended for Magento Core technical issues only. Please refer to the Community Forums or the Magento Stack Exchange site for advice or general discussion about this issue.

@engcom-Bravo engcom-Bravo removed their assignment Sep 20, 2019
@hostep
Copy link
Contributor

hostep commented Sep 20, 2019

@shkodasv: I think you have a very valid point here.

@engcom-Bravo: in my opinion this is a bug and I'll re-open this ticket for now, feel free to discuss if you don't agree.

Steps to reproduce:

  • Setup vanilla 2.3-develop installation
  • Take a look at the file app/design/frontend/Magento/blank/Magento_Braintree/web/css/source/_module.less, notice the selector .payment-method-braintree is in there and also notice this selector is in no other file in the Magento source code except for this file in the Magento_Braintree module in the
    Magento/Blank theme.
  • Now disable that module (and its dependency): bin/magento module:disable Magento_Braintree Magento_BraintreeGraphQl
  • Remove potential left over files: rm -R var/view_preprocessed/* pub/static/*
  • Run static content deploy: bin/magento setup:static-content:deploy -f --theme Magento/blank en_US
  • Look at the generated file pub/static/frontend/Magento/blank/en_US/css/styles-m.css

Expected result:

  • Not finding a reference to the selector .payment-method-braintree

Actual result:

  • Finding references to the selector .payment-method-braintree

Update: In hindsight, @shkodasv is talking about the deprecated "disabling module output" feature of Magento which was removed in Magento 2.2 I believe. But the issue is still valid for disabled modules as well, or should we open a new issue then?

@hostep hostep reopened this Sep 20, 2019
@engcom-Bravo
Copy link
Contributor

engcom-Bravo commented Sep 20, 2019

Ok @hostep, I'll check it.

@shkodasv
Copy link
Author

@hostep Thanks for your reply. You are right "Disable module output" is deprecated. I didn't know it. But in case of disabling the module the same logic should work IMHO - no css should be included.

@engcom-Charlie engcom-Charlie self-assigned this Sep 23, 2019
@m2-assistant
Copy link

m2-assistant bot commented Sep 23, 2019

Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo
Copy link
Contributor

@hostep I reproduced the behavior following the steps You have provided. But I still better question my Lead on it before confirming the issue. Hopefully tomorrow I'll be back with the result.

@ghost ghost unassigned engcom-Charlie Sep 23, 2019
@sdzhepa
Copy link
Contributor

sdzhepa commented Sep 26, 2019

Hello @shkodasv @hostep @engcom-Bravo

Finally, I have received a response from the internal team and confirmation that it is a bug. Previously were several concerns probably it was by design or so.

I will update Issue title and content based on test steps from #24666 (comment)

@sdzhepa sdzhepa changed the title Exclude CSS from styles-l.css if module output is disabled. Static content is deploying for disabled modules Sep 26, 2019
@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 26, 2019
@sdzhepa sdzhepa added Component: Css Component: Deploy Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 26, 2019
@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 26, 2019
@sdzhepa sdzhepa added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 26, 2019
@vasilii-b
Copy link

Hey guys,
Until the PR in the core gets merged, feel free to use the approach described here.

cc @shkodasv

@m2-community-project m2-community-project bot added Progress: PR in progress Priority: P2 A defect with this priority could have functionality issues which are not to expectations. and removed Progress: ready for dev labels May 19, 2021
@engcom-Alfa engcom-Alfa added Area: UI Framework Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Priority: P3 May be fixed according to the position in the backlog. Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Sep 21, 2021
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-1306 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Sep 21, 2021

✅ Confirmed by @engcom-Alfa. Thank you for verifying the issue.
Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: UI Framework Component: Css Component: Deploy Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Done Has been reviewed and prioritized during Triage with Product Managers
Projects