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

Process only required attributes in api/rest/products/ #4517

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

sreichel
Copy link
Contributor

Description (*)

Using REST api like https://magento-lts.ddev.site/api/rest/products/ace000 loads all product attributes, even if they are not selected in admin REST attributes configuration. Urls are genenated, prices are loaded, ...

@sreichel sreichel added performance Performance related improvement labels Jan 31, 2025
@github-actions github-actions bot added the Component: Catalog Relates to Mage_Catalog label Jan 31, 2025
@sreichel
Copy link
Contributor Author

4517-3

before (blue = useless calls when no prices or urls are required)
4517-1

after
4517-2

@github-actions github-actions bot added the Component: Api2 Relates to Mage_Api2 label Jan 31, 2025
@sreichel sreichel changed the title Load only required attributes in api/rest/products/ Process only required attributes in api/rest/products/ Jan 31, 2025
@sreichel sreichel added this to the 20.13.0 milestone Feb 2, 2025
@sreichel sreichel requested a review from theroch February 6, 2025 23:28
Copy link
Contributor

@theroch theroch left a comment

Choose a reason for hiding this comment

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

Please add some more php doc comments.
The actual code logic looks OK to me.

@sreichel sreichel closed this Feb 12, 2025
@Hanmac
Copy link
Contributor

Hanmac commented Feb 12, 2025

@sreichel why did this MR get closed?

@sreichel
Copy link
Contributor Author

Too lazy to add docblocks.

(i cant remember aany new method added, where someone requested docblock changes)

@Hanmac Hanmac reopened this Feb 12, 2025
Hanmac
Hanmac previously approved these changes Feb 12, 2025
kiatng
kiatng previously approved these changes Feb 14, 2025
@Hanmac Hanmac dismissed stale reviews from kiatng and themself via 37ed818 February 14, 2025 06:00
@sreichel
Copy link
Contributor Author

@Hanmac
Copy link
Contributor

Hanmac commented Feb 19, 2025

@theroch i dont know what to change for your request

@sreichel i talked with him, his concern was that addAttribute only has effect for specific attributes

but for each other, the attribute should already be in productData

or should we add a $productData[$attribute] = $product->getData($attribute) default for the switch/case?

@sreichel
Copy link
Contributor Author

or should we add a $productData[$attribute] = $product->getData($attribute) default for the switch/case?

Or return; (void) as default ... PR?

@sreichel sreichel closed this Feb 19, 2025
@Hanmac Hanmac reopened this Feb 19, 2025
@Hanmac
Copy link
Contributor

Hanmac commented Feb 19, 2025

this MR is ready to merge i think, why is it getting closed again?

@sreichel
Copy link
Contributor Author

Cant merge b/c of the change request ....

@Hanmac Hanmac requested a review from theroch February 19, 2025 08:39
@sreichel
Copy link
Contributor Author

@theroch 2 weeks w/o response ....

Thanks for blocking this.

@sreichel
Copy link
Contributor Author

Closed again.

https://github.com/sponsors/sreichel .... thanks in advance.

@sreichel sreichel closed this Feb 21, 2025
@Hanmac
Copy link
Contributor

Hanmac commented Feb 21, 2025

@sreichel
@theroch is currently on vacation til March

@Hanmac
Copy link
Contributor

Hanmac commented Feb 21, 2025

@theroch 2 weeks w/o response ....

Thanks for blocking this.

And if you want to be pedantic, there are some cases where it needed to wait a bit longer:
#4511 did also take 2 weeks until it got merged
#4008 took from May 2024 til Oct 2024 until it got merged

@sreichel
Copy link
Contributor Author

Its not about the time to get a PR merged, but if you block a PR (request changes) you should reply in time. imho

@sreichel
Copy link
Contributor Author

And if you want to be pedantic, there are some cases where it needed to wait a bit longer:
#4511 did also take 2 weeks until it got merged
#4008 took from May 2024 til Oct 2024 until it got merged

Difference ... you get paid for your PRs - regardless how long it takes to merge - ....

@kiatng
Copy link
Contributor

kiatng commented Feb 22, 2025

@Hanmac Thanks for communicating with @theroch and explain why he's not responding.

It's not right to block a PR when @sreichel has put in the effort without timely response. It can be frustrating.

I will reopen the PR and address any pending changes when @theroch returns in March. I hope @sreichel is OK with this.

@kiatng kiatng reopened this Feb 22, 2025
Copy link

@sreichel sreichel modified the milestones: 20.13.0, 20.14.0 Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Api2 Relates to Mage_Api2 Component: Catalog Relates to Mage_Catalog improvement performance Performance related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants