Suggest plugin categories with Jev and allow more than one per plugin - #536
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugins can now be in more than one marketplace category, and Jev suggests which ones they belong in. Admins apply the suggestions with one button on the plugin's edit page.
Until now each plugin had a single
category, filled in by the keyword backfill command. This adds acategoriesJSON column. The migration copies each plugin's current category into it, and the directory filter and the backfill command now use it.How the suggestions work:
SuggestPluginCategoriesgives Jev the plugin's title, description and the first 5,000 characters of its README as plain text. The rest of a README is mostly install steps and API reference.category_suggestions. Nothing is applied automatically.In the admin, the plugin edit page has a new Categories section with a checkbox per category, Jev's picks with percentages, an "Ask Jev" button and an "Apply suggestions" button. Applying sets the plugin's categories to exactly Jev's picks. The button only shows when that would change something.
For the plugins we already have,
php artisan plugins:auto-categoriseasks Jev about each one and applies its picks. Plugins Jev isn't sure about keep the category they have and are listed at the end. It skips plugins Jev has already been asked about, so a run that fails part way can simply be run again, and a real run after--dry-rundoesn't ask Jev twice.Things to watch:
categorycolumn is still there. Nothing reads it any more, but dropping it in the same migration would break any checkout sharing a local database that hasn't pulled this yet. It can go in a follow-up.tests/TestCase.phpnow fakes Jev for every test. Creating or submitting a plugin queues a Jev request, tests run the queue synchronously, and aTYPESAFE_API_KEYin.envwould otherwise make paid calls from the suite.refreshFormData()does nothing for array fields, because it dot-flattens the record first. The Apply action sets the checkboxes with$setinstead, and a test saves the form after applying to catch a regression.TYPESAFE_API_KEY. Without it, Ask Jev shows an error and the queued requests fail.plugins:backfill-categories(the keyword version) still works, but it isn't needed once the new command has run.After deploying: run the migration, then
php artisan plugins:auto-categorise --dry-run, check the table, then run it without--dry-run.Testing: new tests cover the job, the admin section, the command, the migration, the directory filter and plugin creation. This also fixes two tests in
CustomerPluginReviewChecksTestthat have failed on main since #534 made a demo video required. They create their plugin without one, so submitting stopped early. They now add an attested demo video first. Those were the only failures in the full suite. I haven't tried the admin page in a browser or run the command against real data.🤖 Generated with Claude Code