Skip to content

[GraphQL] Fixed exposing special price #30623

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

Merged

Conversation

rogyar
Copy link
Contributor

@rogyar rogyar commented Oct 23, 2020

Description (*)

This PR contains a fix for the scenario when GraphQL API exposes product special price when the special price period set for the future.

Fixed Issues (if relevant)

  1. Magento 2.4.0 graphql leak data on special price #30210 : Magento 2.4.0 graphql leak data on special price
  2. [2.3.5-p2] GraphQl Special Price Ignore's special price from to dates. #29631 : GraphQl Special Price Ignore's special price from to dates

Manual testing scenarios (*)

  1. Create a product with a special price
  2. Set the special price From and To date for the far future
  3. Use the following query to retrieve the information about special price (change the filter parameters for your setup)
{
  products(filter: {name: {match: "Simple"}}) {
    items {
      name
      special_price
    }
  }
}

Expected result

{
  "data": {
    "products": {
      "items": [
        {
          "name": "Simple",
          "special_price": null
        }
      ]
    }
  }
}

The special_price should be null in case if the current date is not in the period set for the special price.

@m2-assistant
Copy link

m2-assistant bot commented Oct 23, 2020

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

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

🕙 You can find the schedule on the Magento Community Calendar page.

📞 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.

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

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

@rogyar
Copy link
Contributor Author

rogyar commented Oct 23, 2020

Working on the test coverage

@ghost ghost added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Oct 23, 2020
@sivaschenko sivaschenko removed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Severity: S1 Affects critical data or functionality and forces users to employ a workaround. labels Oct 23, 2020
@rogyar
Copy link
Contributor Author

rogyar commented Oct 23, 2020

@magento run all tests

@ghost ghost removed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Oct 23, 2020
@rogyar
Copy link
Contributor Author

rogyar commented Nov 12, 2020

I will get back to this PR tomorrow.

@rogyar
Copy link
Contributor Author

rogyar commented Nov 17, 2020

@magento run all tests

@rogyar rogyar added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Nov 18, 2020
@rogyar rogyar self-assigned this Nov 18, 2020
@rogyar rogyar added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Progress: pending review labels Nov 18, 2020
@rogyar
Copy link
Contributor Author

rogyar commented Nov 18, 2020

The failing tests don't seem to be related to the current change. We may proceed with the review.

Copy link
Contributor

@eduard13 eduard13 left a comment

Choose a reason for hiding this comment

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

Good job 👍

@magento-engcom-team
Copy link
Contributor

Hi @eduard13, thank you for the review.
ENGCOM-8477 has been created to process this Pull Request

@eduard13
Copy link
Contributor

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

@eduard13
Copy link
Contributor

@magento run Functional Tests EE

1 similar comment
@eduard13
Copy link
Contributor

eduard13 commented Mar 9, 2021

@magento run Functional Tests EE

@cpartica
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

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.

@cpartica
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

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.

@m2-assistant
Copy link

m2-assistant bot commented May 12, 2021

Hi @rogyar, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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: bug fix Award: test coverage Component: CatalogGraphQl Event: MageCONF CD 2020 Partner: Atwix Pull Request is created by partner Atwix 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: GraphQL Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants