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

Include Constructor to be a part of CommandListInterface API, extend inline documentation #29762

Closed

Conversation

lbajsarowicz
Copy link
Contributor

@lbajsarowicz lbajsarowicz commented Aug 26, 2020

Description (*)

Based on above comment we have created new PR targeting to 2.4-develop.
Link for the new PR: #37901

In my personal opinion using CommandListInterface is invalid way of adding new Commands to interface.
It is because Constructor is not a part of Interface (Service Contract), thus it is not "guaranteed" part of Interface.

Using CommandList is against Magento rules, thus it's implementation is not guaranteed and can change in backwards-incompatible way.

I'm extending the CommandList with @api to ensure developers that this class won't change backwards-incompatible way and this way - they can either add new classes using:

  • Argument injection to CommandList class
  • Plugin on getCommands on CommandListInterface.

I'd love to get your feedback there.

After discussion with @kandy I decided to add the __construct() to the API.

Answering the main concerns: https://3v4l.org/8ug8i
image

As it affects you (community) I need your 👍🏻 or comments to pass the change:
image

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

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)

Thanks

Resolved issues:

  1. resolves [Issue] Include Constructor to be a part of CommandListInterface API, extend inline documentation #31102: Include Constructor to be a part of CommandListInterface API, extend inline documentation

@m2-assistant
Copy link

m2-assistant bot commented Aug 26, 2020

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

@ghost ghost added this to Pending Review in Pull Requests Dashboard Aug 26, 2020
@lbajsarowicz lbajsarowicz changed the title Turn CommandList into @api to ensure backwards compatibility, clarify Command registration Include Constructor to be a part of CommandListInterface API, extend inline documentation Aug 26, 2020
@lbajsarowicz
Copy link
Contributor Author

@magento run all tests

@BarnyShergold BarnyShergold self-assigned this Aug 26, 2020
@BarnyShergold
Copy link

@shiftedreality - Tests are failing on this but no errors are appearing in the reports - eg the Unit Tests - can you advise?

@BarnyShergold
Copy link

@magento run all tests

@sidolov
Copy link
Contributor

sidolov commented Sep 14, 2020

@lbajsarowicz I saw the discussion in the Slack channel regarding this pull request, as far as I remember, @maghamed proposed to deprecate the interface and add @api annotation to the class itself, is that right? (I cannot add a screenshot of the original conversation since it was removed from the history)

@jissereitsma
Copy link
Contributor

@lbajsarowicz @sidolov My reaction would be that marking the class as API is maybe actually the best approach of all.

@sidolov sidolov added Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. labels Sep 21, 2020
@sidolov sidolov moved this from Pending Review to Review in Progress in Pull Requests Dashboard Oct 2, 2020
@BarnyShergold
Copy link

@magento run all tests

@lbajsarowicz
Copy link
Contributor Author

@magento run all tests
@jissereitsma / @BarnyShergold / @sidolov I changed approach to turn the class into @api

@sidolov sidolov added this to the 2.5 milestone Nov 30, 2020
@sidolov sidolov added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. and removed Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. labels Nov 30, 2020
@m2-community-project m2-community-project bot removed this from Review in Progress in Pull Requests Dashboard Nov 30, 2020
@sidolov
Copy link
Contributor

sidolov commented Nov 30, 2020

@magento create issue

@engcom-Lima
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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.

@ihor-sviziev
Copy link
Contributor

@sinhaparul, can this PR be moved to 2.4-develop release line?

@engcom-Charlie
Copy link
Contributor

As the PR's milestone is 2.5, we will confirm this with @sinhaparul and proceed as per that. Till that time moving it to On Hold.

Thank you!

@engcom-Charlie
Copy link
Contributor

Hi @lbajsarowicz,

Thank you for your contribution!

Its a value added PR and we really want to take it further.

Can you please update it towards 2.4-develop branch instead of 2.5-develop so that we can proceed further.

Thank you!

@lbajsarowicz
Copy link
Contributor Author

I'll handle it by August 1st

@engcom-Charlie
Copy link
Contributor

I'll handle it by August 1st

Hi @lbajsarowicz, did you get chance to do the needful.

@engcom-Echo
Copy link
Contributor

Based on above comment we have created new PR targeting to 2.4-develop.
Link for the new PR: #37901

Hence closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Component: Console Partner: Blue Acorn iCi 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. Project: Community Picked PRs upvoted by the community Release Line: 2.5 Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Include Constructor to be a part of CommandListInterface API, extend inline documentation