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

[Jetpack AI] Store post ids #28487

Merged
merged 6 commits into from
Jan 25, 2023
Merged

[Jetpack AI] Store post ids #28487

merged 6 commits into from
Jan 25, 2023

Conversation

artpi
Copy link
Contributor

@artpi artpi commented Jan 20, 2023

Fixes #28444

Proposed changes:

  • Pass post_id to the API
  • Trigger appropriate tracks events
  • Store number of JetpackAI usages in post in post meta

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

Store post ids and the number of uses for Jetpack AI

Testing instructions:

  • jetpack build && jetpack rsync to a WPCOM Simple site as this introduces changes on the sandbox as well
  • Trigger GPT block on the frontend,
  • Inspect the network tab
  • See post_id now in the request params
  • Inspect t.gif calls for tracks events
  • Search for feature:openai in Kibana to see post_id now present in Logstash logs
  • Also, after some time you should see the events in tracks
  • You can verify the meta with wp post meta get 646 _jetpack_ai_calls --url=

Zrzut ekranu 2023-01-20 o 13 06 39

Zrzut ekranu 2023-01-20 o 12 31 07

@artpi artpi requested a review from a team January 20, 2023 11:47
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2023

Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run bin/jetpack-downloader test jetpack jetpack-ai-store-post-id to get started. More details: p9dueE-5Nn-p2

@github-actions github-actions bot added [Block] AI Image [Block] AI Paragraph [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Jan 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2023

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.
  • ✅ All commits were linted before commit.
  • ✅ 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.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: February 7, 2023.
  • Scheduled code freeze: January 31, 2023.

@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 Jan 20, 2023
@artpi artpi added [Status] Needs Team Review and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jan 20, 2023
@romarioraffington
Copy link
Contributor

You can verify the meta with wp post meta get 646 _jetpack_ai_calls --url=

I wasn't able to find this key in meta

wp> get_post_meta( 22, '_jetpack_ai_calls' )
=> array(0) {
}

Everything else works as expected

@romarioraffington romarioraffington self-requested a review January 24, 2023 17:05
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.

It tests well for me. 🚢

I wasn't able to find this key in meta

It worked on my dev environment, I think it should be okay.

$ jetpack docker wp post meta get 4262 _jetpack_ai_calls
2

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Team Review labels Jan 24, 2023
@artpi artpi merged commit 226a66f into trunk Jan 25, 2023
@artpi artpi deleted the jetpack-ai-store-post-id branch January 25, 2023 13:53
@github-actions github-actions bot added this to the jetpack/11.8 milestone Jan 25, 2023
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] AI Image [Block] AI Paragraph [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Jetpack AI] Store post ids
3 participants