-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Categories permissions for "categories" and "categoryList" #29883
Categories permissions for "categories" and "categoryList" #29883
Conversation
…tegory Permissions configuration Introduce collection processors, pass the context so to obtain customer group
Hi @pmarjan. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
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. 🕙 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 |
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be quite a lot of new code files here and some substantial changes to core methods - is there a reason why there is no test coverage?
/** @var SearchCriteriaCollectionProcessor */ | ||
private $collectionProcessor; | ||
|
||
public function __construct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No DocBlock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
SearchCriteriaInterface $searchCriteria, | ||
ContextInterface $context = null | ||
): Collection | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This { should be on previous line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @BarnyShergold
the changes to core methods are with the purpose to expose modular collection processing, so other layers in the application can have a say what the collection consists of.
Check maybe implementation of "products" query for an example - it is the same idea.
On a closer look, please notice, there is no bug to be solved, or new requirement to be satisfied, just a refactor, thus, should be sufficient that already present api-functinal tests do not break (and they don't :) ), no need for new ones.
In more details, I would bring your attention to GraphQl/Catalog tests, and there all the Category*.Test.php and all tests from CategoriesQuery folder are the top relevant to verify the refactor.
Anyway, bigger picture is here: #28550, if it helps to gain depth on the idea that is running in this PR. If any questions, just contact me... I can give you even more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmarjan - Your reasoning is sound - just wanted to check!
You just need to fix the minor format issues and the failing tests and all will be good.
…tegory Permissions configuration Address static tests
@magento run all tests |
1 similar comment
@magento run all tests |
@magento run all tests |
public function process( | ||
Collection $collection, | ||
SearchCriteriaInterface $searchCriteria, | ||
ContextInterface $context = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a minor observation in comparison to the product processor
Noticed that there we passed attributes as well. I guess here we did not need it here. Not sure because this is meant as an extension point if we need to add it and just not use it ourselves..maybe other extensions will..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Now, I have edited to pass attributesNames as well. Currently are not used, but someday maybe someone extends this.
…tegory Permissions configuration PR review points
Hi @pmarjan, thank you for your contribution! |
Description (*)
Fixes #29880
Collection Processors (via Composite processor) are added. Context is passed as optional parameter.
Related Pull Requests
https://github.com/magento/partners-magento2ee/pull/319
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)