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

Font Library: Add post types and low level APIs #6027

Closed
wants to merge 13 commits into from

Conversation

youknowriad
Copy link
Contributor

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

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

Copy link

github-actions bot commented Feb 5, 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 SVN

If you're a Core Committer, use this list when committing to wordpress-develop in SVN:

Props: youknowriad, get_dave, grantmkin, swissspidy, hellofromtonya, mukesh27, mcsf.

GitHub Merge commits

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: creativecoder <grantmkin@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: hellofromtonya <hellofromtonya@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: mcsf <mcsf@git.wordpress.org>

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

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.

This seems to reintroduce or ignore things that were previously already flagged in #5285.

Can we make sure that the feedback from there is respected?

src/wp-includes/fonts/class-wp-font-library.php Outdated Show resolved Hide resolved
src/wp-includes/fonts/class-wp-font-library.php Outdated Show resolved Hide resolved
src/wp-includes/fonts/class-wp-font-library.php Outdated Show resolved Hide resolved
@getdave
Copy link

getdave commented Feb 5, 2024

e2e tests are failing on await requestUtils.activatePlugin( 'gutenberg' );.

Copy link

github-actions bot commented Feb 5, 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.

@youknowriad
Copy link
Contributor Author

@getdave Yes, that means this PR conflicts with the latest Gutenberg, it means we probably need to bring these changes to the latest Gutenberg version and do a patch release of Gutenberg before committing this PR to Core. But it doesn't prevent this PR from being reviewed properly.

@youknowriad
Copy link
Contributor Author

With the latest Gutenberg release, this PR passes all the tests now 🎉

src/wp-settings.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.

Lest some quick feedbacks.

src/wp-includes/fonts.php Outdated Show resolved Hide resolved
src/wp-includes/fonts/class-wp-font-collection.php Outdated Show resolved Hide resolved
src/wp-includes/fonts/class-wp-font-library.php Outdated Show resolved Hide resolved
src/wp-includes/fonts/class-wp-font-library.php Outdated Show resolved Hide resolved
*/
class Tests_Fonts_FontLibraryHooks extends WP_UnitTestCase {

public function test_deleting_font_family_deletes_child_font_faces() {
Copy link
Member

Choose a reason for hiding this comment

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

Add @ticket annotation in all tests that are added for ticket.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @mukeshpanchal27 👋

Per the handbook, the @ticket annotation is only for bugfixes:

@ticket – A custom WordPress annotation. Use @ticket 12345 to indicate that a test addresses the bug described in ticket #12345. Internally, @ticket annotations are translated to @group, so that you can limit test runs to those associated with a specific ticket: $ phpunit --group 12345.

The tests have already have @group annotations for allowing its test to be run separately.

Are you okay with not including the @ticket?

@getdave
Copy link

getdave commented Feb 5, 2024

Note also some fixes will be coming in here as soon as WordPress/gutenberg#58675 is in Gutenberg.

Copy link

@mcsf mcsf left a comment

Choose a reason for hiding this comment

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

My review consisted of minor things, and I don't want them to get in the way of what feels like a good PR. I don't love the WP_Font_Utils class, but we can refine that later.

@getdave
Copy link

getdave commented Feb 5, 2024

I've applied the fixes from WordPress/gutenberg#58675.

Ideally should aim to do one final PR upstream in Gutenberg repo to resolve all outstanding review comments here.

@getdave
Copy link

getdave commented Feb 5, 2024

More feedback being addressed in Gutenberg at WordPress/gutenberg#58691.

@creativecoder
Copy link

creativecoder commented Feb 5, 2024

The updates from WordPress/gutenberg#58691, addressing changes requested in review comments here, have now been applied to this PR.

Copy link
Contributor

@hellofromtonya hellofromtonya left a comment

Choose a reason for hiding this comment

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

  • After @swissspidy flagged some feedback that was missed from the original Core PR, it was re-audited today. The missed feedback was addressed and needed changes resolved in 507f1d9

  • All feedback in this PR is addressed and, if required, code changes made. ✅

LGTM 👍

IMO it's ready for commit.

@youknowriad
Copy link
Contributor Author

Commit here https://core.trac.wordpress.org/changeset/57539
I'll be opening a follow-up PR with the REST controllers shortly.

@youknowriad youknowriad closed this Feb 6, 2024
@youknowriad youknowriad deleted the add/font-library-apis branch February 6, 2024 08:51
@youknowriad
Copy link
Contributor Author

Follow-up PR here #6034

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.

7 participants