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

[WIP] GIF Block: Replace source with Tumblr GIF Search #39896

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

Conversation

justinshreve
Copy link
Contributor

@justinshreve justinshreve commented Oct 24, 2024

Proposed changes:

  • Updated the GIF block to use Tumblr's GIF search API, replacing the current Giphy-powered block.
  • Added WP.com proxy endpoints for /v2/gif/search/{query} and /v2/gif/popular to retrieve Tumblr GIFs.
  • Adds backwards compatibility so if a giphyUrl attribute is still detected, we honor those embeds.
  • Updated tests.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

  • pg1lMq-7O-p2
  • pg1lMq-80-p2

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

Testing an existing GIPHY GIF

  • Before switching to this branch, create a new post or edit an existing post when running trunk
  • Add the GIF block and insert it into the post.
  • Enter a search term in the "Search" field.
  • Select a GIF from GIPHY.
  • Save or update the post.
  • Switch Jetpack to use this branch.
  • View the post on the frontend site.
  • Check that the GIPHY GIF still displays correctly.

Creating a new GIF

  • Run bin/jetpack-downloader test jetpack tumblr-gif-block to apply the endpoints to your sandbox.
  • Set JETPACK__SANDBOX_DOMAIN to point at your sandbox.
  • Create a new post or edit an existing post.
  • Add the GIF block and insert it into the post.
  • Enter a search term in the "Search" field.
  • Select a GIF from Tumblr.
  • Add a caption to the GIF (optional).
  • Save or update the post.
  • View the post on the frontend site.
  • Check that the GIF displays correctly with the caption and attribution.

Demo:

gif_demo.mov

@justinshreve justinshreve self-assigned this Oct 24, 2024
@github-actions github-actions bot added [Block] GIF [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests Docs labels Oct 24, 2024
Copy link
Contributor

github-actions bot commented Oct 24, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for none scheduled (scheduled code freeze on undefined).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Oct 24, 2024
Copy link
Contributor

github-actions bot commented Oct 24, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the tumblr-gif-block branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack tumblr-gif-block
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@justinshreve justinshreve removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Oct 24, 2024
@justinshreve justinshreve changed the title [WIP] GIF Block: Replace source with Tumblr GIF Search GIF Block: Replace source with Tumblr GIF Search Oct 24, 2024
@justinshreve justinshreve requested a review from a team October 29, 2024 13:11
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

I gave it a quick try, and left a few notes below.

@justinshreve
Copy link
Contributor Author

Thank you for the review @jeherve! I've pushed a few changes to address the feedback, especially around the auth/proxying part. I also updated the testing instructions since the WP.com portion of this (the key) is now deployed.

Copy link
Member

@jeherve jeherve 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 working on those changes!

Things are working well on WordPress.com Simple, but not on WoA or self-hosted yet since there no endpoint to respond to https://public-api.wordpress.com/wpcom/v2/sites/%blog_id%/tumblr-gifs/search/%keyword% yet, as far as I can tell. Is there a Phab diff with that endpoint, that I could use to test this on Atomic and self-hosted?

projects/plugins/jetpack/extensions/blocks/gif/block.json Outdated Show resolved Hide resolved
@justinshreve
Copy link
Contributor Author

justinshreve commented Nov 5, 2024

Things are working well on WordPress.com Simple, but not on WoA or self-hosted yet since there no endpoint to respond to https://public-api.wordpress.com/wpcom/v2/sites/%blog_id%/tumblr-gifs/search/%keyword% yet, as far as I can tell. Is there a Phab diff with that endpoint, that I could use to test this on Atomic and self-hosted?

Not at the moment, as that would require adding the endpoints in Moon/Sun myself. The way I've been testing this is by running bin/jetpack-downloader test jetpack tumblr-gif-block on my sandbox, and then pointing the Jetpack install to it with JETPACK__SANDBOX_DOMAIN.

I did already deploy code that will load the endpoints from Jetpack; it just needs the files to exist. I can build a Phab diff, but I think it might just be easier to use the jetpack-downloader script.

--

Also, we might be changing the way the GIF is embedded, so I'll follow up on that shortly!

@justinshreve
Copy link
Contributor Author

@jeherve I'm sorry for the delay in getting back to this. Getting the Tumblr Embeds working correctly took a little work.

I've updated the PR here now using the new embeds, so I think this is ready for another look.

As noted in the PR description, to get the endpoints on WordPress.com:

  • Run bin/jetpack-downloader test jetpack tumblr-gif-block to apply the endpoints to your sandbox
  • Set JETPACK__SANDBOX_DOMAIN to point your Jetpack install at your sandbox.

I'm guessing I also missed the window for 14.1, is that correct? Does that mean this would be slated for 14.2, next month?

@justinshreve justinshreve requested a review from jeherve November 26, 2024 23:22
@justinshreve justinshreve changed the title GIF Block: Replace source with Tumblr GIF Search [WIP] GIF Block: Replace source with Tumblr GIF Search Nov 27, 2024
@justinshreve justinshreve removed request for a team and jeherve November 27, 2024 00:08
@justinshreve
Copy link
Contributor Author

Honestly the embed needs some more design work on the Tumblr side.. putting this back to WIP for now.

@jeherve
Copy link
Member

jeherve commented Nov 28, 2024

I'm guessing I also missed the window for 14.1, is that correct? Does that mean this would be slated for 14.2, next month?

You're still good for 14.1, but if you want our beta testers to test it, you'd be better off waiting until 14.2 indeed.

Of note, in the past few days we merged #40245, which will allow you to simplify some of the endpoint logic quite a bit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants