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

Writing prompts: move block to production and use for answering prompts #29433

Merged
merged 9 commits into from Mar 20, 2023

Conversation

creativecoder
Copy link
Contributor

@creativecoder creativecoder commented Mar 12, 2023

Proposed changes:

  • Moves writing prompt block to production
  • Uses block when starting a new post using and ?answer_prompt={prompt_id} query param

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

PT: pe7F0s-uo-p2

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

No.

Testing instructions:

  • Ensure your test site is connected to WP.com
  • Enable experimental blocks (define( 'JETPACK_EXPERIMENTAL_BLOCKS', true );)
  • Sandbox public-api and apply these changes to your wpcom sandbox with bin/jetpack-downloader test jetpack update/answer-prompt-w-block (if not, the block header and footer will be empy, but is works, otherwise)
  • Start a new post answering a specific prompt id, like /wp-admin/post-new.php?answer_prompt=1810
  • You should see a prompt inserted into the post content
  • The tags dailyprompt and dailyprompt-{prompt_id} should be added to the post
  • The post meta _jetpack_blogging_prompt_key should be added to the post, with the prompt id

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2023

Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run

bin/jetpack-downloader test jetpack update/answer-prompt-w-block

to get started. More details: p9dueE-5Nn-p2

@github-actions github-actions bot added [Block] Blogging Prompts [Block] Blogging Prompt [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Mar 12, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 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: April 4, 2023.
  • Scheduled code freeze: March 28, 2023.

"blogging-prompts",
"premium-content"
],
"experimental": [ "ai-image", "ai-paragraph", "anchor-fm", "blogging-prompt", "premium-content" ],
Copy link
Member

Choose a reason for hiding this comment

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

Would we consider making it a production block, so self-hosted sites can use it too? It seems like a useful block!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm open to that--I don't see why it can't be a production block assuming we can get the appropriate jetpack.com doc pages set up.

Copy link
Member

Choose a reason for hiding this comment

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

I think that's something Quill can help us with. I created 1200427382410585-as-1204188078771387/f to open a request with the team.

@jeherve jeherve added this to the jetpack/12.0 milestone Mar 15, 2023
@creativecoder
Copy link
Contributor Author

I believe this PR is ready to go, but I want to get the remaining Writing Prompt block PRs merged before this one:

projects/plugins/jetpack/_inc/blogging-prompts.php Outdated Show resolved Hide resolved
@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] In Progress labels Mar 17, 2023
@creativecoder creativecoder added [Status] Needs Review To request a review from Crew. Label will be renamed soon. 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 Mar 17, 2023
@samiff samiff self-requested a review March 17, 2023 17:59
@samiff samiff changed the title Writing prompts: move block to experimental and use for answering prompts Writing prompts: move block to production and use for answering prompts Mar 17, 2023
@samiff samiff added the [Status] Needs Testing We need to add this change to the testing call for this month's release label Mar 17, 2023
@samiff
Copy link
Contributor

samiff commented Mar 17, 2023

Sandbox public-api and apply these changes to your wpcom sandbox with bin/jetpack-downloader test jetpack update/answer-prompt-w-block (if not, the block header and footer will be empy, but is works, otherwise)

Could just be config on my end, but I wasn't able to get the the header/footer to display correctly on my local dev site. Looked good on my test wpcom site though.

Screenshot 2023-03-17 at 12 17 25 PM

When no explicit promptId is supplied, does it just grab an ID specified server side?

@creativecoder
Copy link
Contributor Author

Could just be config on my end, but I wasn't able to get the the header/footer to display correctly on my local dev site.

That's probably caused by the changes from https://github.com/Automattic/jetpack/pull/29450/files not being available for whatever reason (not applied to sandbox, API not using sandbox, etc).

When no explicit promptId is supplied, does it just grab an ID specified server side?

Correct, it gets the prompt specified for the day (we currently have a unique prompt for every day of the year).

samiff
samiff previously approved these changes Mar 17, 2023
@samiff samiff added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Mar 17, 2023
@creativecoder
Copy link
Contributor Author

I rebased this to get the TeamCity build to pass--will need another approval.

@creativecoder creativecoder merged commit d059696 into trunk Mar 20, 2023
@creativecoder creativecoder deleted the update/answer-prompt-w-block branch March 20, 2023 16:16
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Mar 20, 2023
@anomiex anomiex removed the [Status] Needs Testing We need to add this change to the testing call for this month's release label May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Blogging Prompt [Block] Blogging Prompts [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Needs Test Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Writing prompts: fetch prompt from API by id
4 participants