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

Ensure that invoice comments are returned when requested by GraphQL queries #31606

Conversation

aligent-lturner
Copy link
Contributor

@aligent-lturner aligent-lturner commented Jan 11, 2021

Description (*)

As part of the GraphQL schema for customer orders, invoices can be requested, along with their comments. However, the current implementation does not return any comments for invoices, resulting in a null value always.
This pull request ensures that invoice comments (that are visible in the front-end) are returned when requested in the query.

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Create a customer order and an associated invoice.
  2. Add a number of comments to an order invoice, including both visible and not visible in the front-end.
  3. Call the customer GraphQL query, requesting orders, invoices and their associated comments - e.g:
query {
    customer {
        orders(filter: { number: { eq: "000000154" } }) {
            items {
                invoices {
                    comments {
                        message
                        timestamp
                    }
                    items {
                        product_name
                    }
                }
            }
        }
    }
}

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)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Ensure that invoice comments are returned when requested by GraphQL queries #31643: Ensure that invoice comments are returned when requested by GraphQL queries

Resolved issues:

  1. resolves [Issue] Ensure that invoice comments are returned when requested by GraphQL queries #31866: Ensure that invoice comments are returned when requested by GraphQL queries

@m2-assistant
Copy link

m2-assistant bot commented Jan 11, 2021

Hi @aligent-lturner. 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
  13. Semantic Version Checker

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

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.

Hi @aligent-lturner thank you for the fix. Could you please cover your changes by an appropriate API Functional test? You can use the following fixture that already provides invoices with comments.
https://github.com/magento/magento2/blob/2.4-develop/dev/tests/integration/testsuite/Magento/Sales/_files/invoice_comments_for_search.php

Please let me know whether you have any questions.
Thank you.

@eduard13
Copy link
Contributor

@magento run WebAPI Tests, Static Tests

@eduard13 eduard13 added Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Jan 13, 2021
@aligent-lturner
Copy link
Contributor Author

@eduard13 the fixture mentioned adds comments to a guest order, which isn't suitable for this, as the graphql query is for a logged-in customer. I've added a new fixture to add comments to a customer order instead, and have added a functional test that uses the fixture.

@eduard13
Copy link
Contributor

@magento run all tests

@eduard13 eduard13 added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Jan 14, 2021
@eduard13
Copy link
Contributor

@magento create issue

@eduard13
Copy link
Contributor

@aligent-lturner could you please review and fix the WebAPI Tests?
Thank you.

@aligent-lturner
Copy link
Contributor Author

@magento run all tests

2 similar comments
@aligent-lturner
Copy link
Contributor Author

@magento run all tests

@aligent-lturner
Copy link
Contributor Author

@magento run all tests

@aligent-lturner
Copy link
Contributor Author

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

@engcom-Lima
Copy link
Contributor

Looking like bot moved it from Extended to Ready for testing. Hence, moving back again to Extended testing.

@engcom-Lima engcom-Lima moved this from Ready for Testing to Extended Testing (optional) in High Priority Pull Requests Dashboard Nov 3, 2022
@engcom-Echo
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.

@engcom-Echo
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.

@engcom-Echo
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.

@engcom-Echo
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.

@engcom-Echo
Copy link
Contributor

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

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

@engcom-Echo
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE, Integration Tests, Unit 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.

@engcom-Echo
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE, Integration Tests, Unit 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.

@engcom-Echo
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE, Unit 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.

@engcom-Echo
Copy link
Contributor

Failed Tests are not related to changes of PR or affected by PR.
Cause of Failure of Currency Converter API configuration is rates can not be retrieve from API.
Moving it to Merge In Progress

@engcom-Echo engcom-Echo moved this from Extended Testing (optional) to Merge in Progress in High Priority Pull Requests Dashboard Nov 10, 2022
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit f04a94a into magento:2.4-develop Nov 24, 2022
@ishakhsuvarov ishakhsuvarov moved this from Merge in Progress to Recently Merged in High Priority Pull Requests Dashboard Nov 30, 2022
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 Component: SalesGraphQl Partner: Aligent Consulting 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 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
10 participants