Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Operations Status Search API Endpoint #12

Merged
merged 10 commits into from
Jun 27, 2018

Conversation

anvasiliev
Copy link

Allow to receive all bulk operations by search criteria.

Description

https://github.com/magento-engcom/bulk-api/wiki/Operations-Status-Search-API-Endpoint

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 on Travis CI are green)

@nuzil nuzil requested a review from vrann April 27, 2018 08:09
@vrann
Copy link
Contributor

vrann commented May 9, 2018

  • documentation needed: somewhere in API use case section describe why this API is needed. @apaliarush will provide the proper place

@nuzil
Copy link

nuzil commented May 17, 2018

PR is ready

@keharper
Copy link

@nuzil @vrann Place documentation files under here:

https://github.com/magento/devdocs/tree/develop/guides/v2.3/rest

If you have multiple .md files, create a subdirectory named bulk-api and place the files in there.

/**
* @api
*/
interface OperationSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface

Choose a reason for hiding this comment

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

Please add description to all new classes/interfaces

interface OperationSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
{
/**
* Get attributes list.

Choose a reason for hiding this comment

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

attributes list => operations list ?

$this->searchResultFactory = $searchResultFactory;
$this->joinProcessor = $joinProcessor;
$this->operationExtensionFactory = $operationExtension;
$this->collectionProcessor = $collectionProcessor ? : ObjectManager::getInstance()

Choose a reason for hiding this comment

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

This is a new class, what is the reason to use object manager (it is normally used for backward compatibility)?

SearchResultFactory $searchResultFactory,
JoinProcessorInterface $joinProcessor,
OperationExtensionInterfaceFactory $operationExtension,
CollectionProcessorInterface $collectionProcessor = null,

Choose a reason for hiding this comment

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

This argument should not be optional.

if ($extensionAttributes == null) {
$extensionAttributes = $this->operationExtensionFactory->create();
}
$extensionAttributes->setStartTime('dsadsa');

Choose a reason for hiding this comment

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

What does 'dsadsa' mean?

@@ -10,7 +10,7 @@
* @api
* @since 100.2.0
*/
interface OperationInterface
interface OperationInterface extends \Magento\Framework\Api\ExtensibleDataInterface

Choose a reason for hiding this comment

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

In theory, OperationInterface must have getExtensionAttributes and setExtensionAttributes declared.

What is the need to move inheritance from ExtensibleDataInterface up to this interface?

Copy link
Author

@anvasiliev anvasiliev Jun 27, 2018

Choose a reason for hiding this comment

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

In other case when I call
$this->joinProcessor->process($collection, \Magento\AsynchronousOperations\Api\Data\OperationInterface::class);
in Magento\AsynchronousOperations\Model\OperationRepository::getList()
I get logic exception from Magento\Framework\Api\ExtensionAttributesFactory::getExtensibleInterfaceName($extensibleClassName) because Magento\AsynchronousOperations\Api\Data\OperationInterface and parent interfaces doesn't extend \Magento\Framework\Api\ExtensibleDataInterface

@magento-cicd2
Copy link

magento-cicd2 commented Jun 27, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team magento-engcom-team merged commit 5d7b3ca into magento:2.3-develop Jun 27, 2018
magento-engcom-team pushed a commit that referenced this pull request Aug 9, 2018
magento-engcom-team pushed a commit that referenced this pull request Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants