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

Used WP_Query in wp_get_post_autosave instead of raw query #7962

Closed
wants to merge 22 commits into from

Conversation

narenin
Copy link

@narenin narenin commented Dec 6, 2024

Trac ticket: https://core.trac.wordpress.org/ticket/62658


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copy link

github-actions bot commented Dec 6, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props narenin, swissspidy, mukesh27, spacedmonkey, im3dabasia1.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

github-actions bot commented Dec 6, 2024

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Copy link
Member

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

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

Thanks for your patch!

It looks good at first glance. Just two things:

  1. While there is some test coverage for this function already via other tests, it would be good to add dedicated tests for this function. Of course they should all pass :)
  2. Let's remove all those inline comments. They don't provide any additional value.

@swissspidy
Copy link
Member

Additional props to @im3dabasia who opened #7965

@swissspidy swissspidy added the props-bot Adding this label triggers the Props Bot workflow for a PR. label Dec 6, 2024
@github-actions github-actions bot removed the props-bot Adding this label triggers the Props Bot workflow for a PR. label Dec 6, 2024
Copy link
Member

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

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

Requests some review that will fix tests.

src/wp-includes/revision.php Outdated Show resolved Hide resolved
src/wp-includes/revision.php Outdated Show resolved Hide resolved
src/wp-includes/revision.php Show resolved Hide resolved
src/wp-includes/revision.php Outdated Show resolved Hide resolved
Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Overall looks solid to me. Left some nit-pick feedbacks.

tests/phpunit/tests/post/wpGetAutoSave.php Outdated Show resolved Hide resolved
tests/phpunit/tests/post/wpGetAutoSave.php Outdated Show resolved Hide resolved
tests/phpunit/tests/post/wpGetAutoSave.php Outdated Show resolved Hide resolved
tests/phpunit/tests/post/wpGetAutoSave.php Outdated Show resolved Hide resolved
tests/phpunit/tests/post/wpGetAutoSave.php Outdated Show resolved Hide resolved
tests/phpunit/tests/post/wpGetAutoSave.php Outdated Show resolved Hide resolved
tests/phpunit/tests/post/wpGetAutoSave.php Outdated Show resolved Hide resolved
tests/phpunit/tests/post/wpGetAutoSave.php Show resolved Hide resolved
@mukeshpanchal27
Copy link
Member

@narenin take a look pending feedback #7962 (comment) from @spacedmonkey

@narenin
Copy link
Author

narenin commented Jan 24, 2025

@spacedmonkey I have implemented suggestions, could you please take a look.

Copy link
Member

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

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

Sorry, final final things and I will commit.

tests/phpunit/tests/post/wpGetAutoSave.php Outdated Show resolved Hide resolved
tests/phpunit/tests/post/wpGetAutoSave.php Show resolved Hide resolved
@im3dabasia
Copy link

Hi @spacedmonkey,

Would we be eligible to receive the Testing badge once this PR is merged? I initially contributed to the tests in the PR, which was later merged into this PR. I was wondering if I might still be eligible for the badge.

Nice work @narenin 💯

@narenin
Copy link
Author

narenin commented Jan 27, 2025

@spacedmonkey thanks for the feedbacks, I have implemented the suggestions could you please take the look.

Copy link
Member

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

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

Marked as approved, I am happy to commit. Do you mind taking a look @swissspidy @mukeshpanchal27 before I commit.

@swissspidy
Copy link
Member

@im3dabasia See https://make.wordpress.org/test/handbook/test-team-profile-badges/ for that badge and its requirements and how to request it if you meet them.

@spacedmonkey LGTM

Copy link

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 59715
GitHub commit: 7091fcd

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions bot closed this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants