Skip to content

Added missing save operation for bulk #31213

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
1 of 5 tasks
ityetti opened this issue Dec 8, 2020 · 12 comments · May be fixed by #31214
Open
1 of 5 tasks

Added missing save operation for bulk #31213

ityetti opened this issue Dec 8, 2020 · 12 comments · May be fixed by #31214
Assignees
Labels
Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@ityetti
Copy link

ityetti commented Dec 8, 2020

Preconditions (*)

  1. When you create own bulk and make it via
    $this->bulkManagement->scheduleBulk($bulkUuid, $operations, $bulkDescription, $userId);
    Operation doesn't save. (This tread it is reference to this issue - New bulk schedule doesn't create operations automatically #23958)

Steps to reproduce (*)

  1. Read this tread - New bulk schedule doesn't create operations automatically #23958

Expected result (*)

Actual result (*)

Operation doesn't save

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Dec 8, 2020

Hi @ityetti. 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.4-develop instance - upcoming 2.4.x release

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

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues 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 issues 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

@hostep
Copy link
Contributor

hostep commented Dec 10, 2020

@ityetti: out of curiosity: did you try this solution: #23958 (comment) ? That was the solution for #23958 and why the author closed the issue.

@engcom-Hotel engcom-Hotel self-assigned this Dec 10, 2020
@m2-assistant
Copy link

m2-assistant bot commented Dec 10, 2020

Hi @engcom-Hotel. 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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.

@ityetti
Copy link
Author

ityetti commented Dec 10, 2020

@hostep
As a temporary fix I used solution from #23958 (comment)
But when you use class MassSchedule, you work with inplementation.
Instead of MassSchedule you can use interface BulkManagementInterface and your code will more compatibility with future changes in the core. Read about Dependency Inversion Principle

I don't know why the previous problem was closed, maybe the person solved his problem. But from an architectural point of view, it is more correct to use an interface. And at the moment the interface does not fulfill its function. It creates bulk, but does not save the operation inside bulk.

@engcom-Hotel
Copy link
Contributor

Hello @ityetti .
I have checked the issue and not able to reproduce it.
M2.4
PHP 7.3
ES 7
Steps:

  1. Create a few products;
  2. Select created products at the admin product grid (select all);
  3. Choose from actions "update attributes";
  4. Update 'Price' field;
  5. Save;
  6. bin/magento cron:run (if not started);

Issued method used in \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute\Save::$bulkManagement
and works as expected.
Could you please provide additional information to reproduce the issue?
Thank you.

@engcom-Hotel engcom-Hotel added Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: ready for confirmation and removed Issue: ready for confirmation Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch labels Dec 11, 2020
@engcom-Hotel
Copy link
Contributor

Hello @ityetti.
I have checked the issue with the custom code sample and confirm that it is reproducible.
Steps to reproduce:

  1. Create custom bulk, the example has been attached
    31213_-simple_example_to_reproduce.zip
  2. bin/magento see:up
  3. Log in to admin panel and open "*/admin/check" route
  4. Check if the bulk has been created at system->Bulk actions or at magento_bulk table
  5. Check if operations for created bulk have been created at magento_operations table

Issue: Bulk operations should be created.

A possible fix has been mentioned in the related issue:
Change of the following function of class Magento\AsynchronousOperations\Model\BulkManagement

/**
     * Publish list of operations to the corresponding message queues.
     *
     * @param array $operations
     * @return void
     */
    private function publishOperations(array $operations)
    {
        $operationsByTopics = [];
        foreach ($operations as $operation) {
+            $this->entityManager->save($operation);
            $operationsByTopics[$operation->getTopicName()][] = $operation;
        }
        foreach ($operationsByTopics as $topicName => $operations) {
            $this->publisher->publish($topicName, $operations);
        }
    }

@hostep
Copy link
Contributor

hostep commented Dec 17, 2020

Hi @nuzil: since you helped out on #23958 (comment), could you verify the claim from @ityetti above if you find some time? Thanks! 🙂

@engcom-Hotel engcom-Hotel added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Dec 17, 2020
@ityetti
Copy link
Author

ityetti commented Dec 17, 2020

@engcom-Hotel
I created PR for adding this fix - #31214

@sdzhepa sdzhepa added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Mar 2, 2021
@nuzil
Copy link
Contributor

nuzil commented Mar 23, 2021

Hey @hostep
Dropped some comments in PR

@nuzil nuzil self-assigned this Mar 23, 2021
@m2-assistant
Copy link

m2-assistant bot commented Mar 23, 2021

Hi @nuzil. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

    1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

@hostep
Copy link
Contributor

hostep commented Mar 23, 2021

Thanks @nuzil

What are your thoughts on this comment from @ityetti: #31213 (comment) ?

@nuzil
Copy link
Contributor

nuzil commented Apr 12, 2021

Hey @hostep @itaymesh
this comment: #31213 (comment)

definitely in general architecture make sense to use interfaces. Cannot currently tell it was done like that, there could me some historical reasons for that. but if you have some ideas and willing to change this, feel free

@m2-community-project m2-community-project bot added Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev labels May 6, 2021
@engcom-Hotel engcom-Hotel moved this to Ready for Development in Low Priority Backlog Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants