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

feat: use github actions to confirm and upload plugin details to db #285

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mmackz
Copy link
Collaborator

@mmackz mmackz commented Mar 9, 2024

Details

  • Introduces a plugin-details.yml file in the template.
  • Builder will ask for app and icon url during the setup process for a new plugin. This is optional and these details can be filled in afterwards.
  • When the github actions are triggered, they check to see if a new package (plugin) is present, and verifies that it has a valid plugin-details.yml file. If a new package is detected and there is no config, or the config is not valid, the action will fail.
  • When the pr is merged to main, an action will run to send the details from the plugin-details.yml to the staging and production api. The details will already be validated at this point.

Backend Changes


Issues

  • In the scripts, there is some namespace conflicts wherever trying to use a variable that is declared in another script file. I got around this by prefixing any reused variable name with an underscore, but I feel this should not be happening.

CleanShot 2024-03-02 at 13 05 29@2x

  • When updating the config file with a new image url, it wont change the image on the S3 bucket unless you use a different name. Image updates do work, the old image is just cached for a while. 😀

Testing

I have done a lot of testing locally.

Passes

  • when all details are valid in new plugin config file
  • when all details are valid on updated config file
  • when all details are valid, adding a new config file to existing package
  • when making non-config related changes (passes with "no changes found")
  • when multiple valid tasks are provided

Fails

  • when mandatory details are missing
  • when image is too big
  • when image url is not an image
  • when icon or applink is not a url
  • when a new package is detected and no config file is found
  • when adding an invalid config file to an existing package
  • when updated an existing config file using invalid details

@mmackz mmackz requested a review from a team as a code owner March 9, 2024 01:45
Copy link

changeset-bot bot commented Mar 9, 2024

🦋 Changeset detected

Latest commit: cd9c0c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@rabbitholegg/create-plugin Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mmackz
Copy link
Collaborator Author

mmackz commented Mar 9, 2024

Closed the old one since it brought in a bunch of commits from my test branch.

#271

async function getUpdatedPluginDetailsPaths(): Promise<string[]> {
// compares the current HEAD with the previous commit to get the updated plugin details
const { stdout, stderr } = await execAsync(
"git diff --name-only HEAD^ HEAD -- 'packages/*plugin-details.yml'",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fully tested this using multiple scenarios. It is working as intended.

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

Successfully merging this pull request may close these issues.

1 participant