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

Template revisions API: move back to experimental #51774

Merged
merged 1 commit into from
Jun 25, 2023

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Jun 22, 2023

What?

This PR moves the PHP changes from:

from compat/6.3 into /experimental

Why?

Template revisions feature won't make it to 6.3 without a Core change

See discussion: #45215 (comment)

How?

Copy pasta

Testing Instructions

Check that the feature still works on Gutenberg, and that you can see the template revisions button after you change a template or template part (more than twice).

Screenshot 2023-06-22 at 12 39 25 pm

More detailed test steps in #45215

@ramonjd ramonjd added [Type] Task Issues or PRs that have been broken down into an individual action to take [Feature] Templates API Related to API powering block template functionality in the Site Editor labels Jun 22, 2023
@ramonjd ramonjd requested a review from TimothyBJacobs as a code owner June 22, 2023 02:42
@ramonjd ramonjd self-assigned this Jun 22, 2023
@ramonjd ramonjd requested a review from spacedmonkey as a code owner June 22, 2023 02:42
@ramonjd ramonjd requested a review from draganescu June 22, 2023 02:42
* When merging into core, prepare_revision_links() should be merged with
* WP_REST_Templates_Controller::prepare_links().
*/
class Gutenberg_REST_Template_Revision_Count extends Gutenberg_REST_Templates_Controller_6_3 {
Copy link
Member Author

Choose a reason for hiding this comment

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

I kept the naming convention from #45215

Was considering Gutenberg_REST_Templates_Controller, but there are no other features here. Not sure.

@ramonjd ramonjd force-pushed the move/template-revisions-backend-to-experimental branch from 68ae5fb to 14cb1dd Compare June 22, 2023 03:01
@github-actions
Copy link

Flaky tests detected in 14cb1ddb4e1d618c2889318ee74c46e0d53c41cb.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5341138456
📝 Reported issues:

@ramonjd
Copy link
Member Author

ramonjd commented Jun 22, 2023

e2e fails are unrelated I think

https://core.trac.wordpress.org/ticket/58592#comment:6

Copy link
Contributor

@draganescu draganescu 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 this @ramonjd 🙇🏻 This tests well, I wonder why do we still need the code in the 6.3 folder and not only in experimental?

@ramonjd
Copy link
Member Author

ramonjd commented Jun 22, 2023

I wonder why do we still need the code in the 6.3 folder and not only in experimental?

Good question! Do you mean the lookup functionality and endpoint? Here's the PR that introduced it:

I just assumed it was separate to the revisions stuff and was indeed going into 6.3?

I could be wrong here, so please correct me 😄

@draganescu
Copy link
Contributor

  1. It seems Add: Modal to choose a start pattern on new templates. #46248 introduced features for 6.2.
  2. It seems according to Chore: Move Gutenberg_REST_Templates_Controller from 6.2 to 6.3 compatibility. #48077 that whatever else other than revisions is in the 6.3 rest controller should land.
  3. The revisions patch was moved from experimental to 6.3 by Fix: Multiple overwrites on rest_controller_class for wp_template/wp_template_part. #48078.
  4. So we're moving them back to experimental.
  5. So that means this PR is correct.

@ramonjd
Copy link
Member Author

ramonjd commented Jun 25, 2023

Thanks @draganescu

I appears that the changes to get_template_fallback are not yet in Core:

https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php#L157

The /lookup endpoint exists in Core.

So I guess get_template_fallback from the following PR never made it into 6.2?

Was it deliberately left out of 6.2? I can't find any records.

Should it be backported to 6.3?

@ramonjd ramonjd force-pushed the move/template-revisions-backend-to-experimental branch from 14cb1dd to dca9275 Compare June 25, 2023 04:27
@ramonjd ramonjd enabled auto-merge (squash) June 25, 2023 04:34
@ramonjd ramonjd merged commit 9e4bd22 into trunk Jun 25, 2023
@ramonjd ramonjd deleted the move/template-revisions-backend-to-experimental branch June 25, 2023 05:05
@github-actions github-actions bot added this to the Gutenberg 16.2 milestone Jun 25, 2023
sethrubenstein pushed a commit to pewresearch/gutenberg that referenced this pull request Jul 13, 2023
@priethor priethor added the [Type] Code Quality Issues or PRs that relate to code quality label Jul 14, 2023
@SiobhyB SiobhyB added the Needs PHP backport Needs PHP backport to Core label Sep 5, 2023
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Warning: Type of PR label error

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Accessibility (a11y), [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: [Type] Task, [Feature] Templates API, [Type] Code Quality.

Read more about Type labels in Gutenberg.

@mikachan mikachan removed the Needs PHP backport Needs PHP backport to Core label Sep 7, 2023
ramonjd added a commit that referenced this pull request Feb 12, 2024
Reverting #51774 by moving the experimental code into compat/6.4

The changes to the templates controller were made in WordPress 6.4. See: WordPress/wordpress-develop@1f51e1f
draganescu pushed a commit that referenced this pull request Feb 12, 2024
* Initial commit:

Reverting #51774 by moving the experimental code into compat/6.4

The changes to the templates controller were made in WordPress 6.4. See: WordPress/wordpress-develop@1f51e1f

* Linty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Templates API Related to API powering block template functionality in the Site Editor [Type] Code Quality Issues or PRs that relate to code quality [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants