meshery / meshery.io

Website for Meshery
https://meshery.io
Apache License 2.0
459 stars 539 forks source link

[Catalog] Enhancing “add catalog” workflow to auto-generate “artifacthub-pkg” #1770

Closed dusdjhyeon closed 2 days ago

dusdjhyeon commented 1 week ago

Description

This PR fixes #1764

Notes for Reviewers There are some ambiguities.

  1. The endpoint is suspicious. I have no problem accessing https://meshery.layer5.io//api/identity/users/profile/$userID, but /api/catalog/content/pattern still returns unable to get meshery catalog patterns(which used in fetchCatalogPatterns()).
  2. Only the invokeGitHubActions function is not tested (I've put it on hold for now, as it's a real action driven. and gh_token is used,,)
  3. Regarding the version mentioned, it's still hardcoded as "1.0.0". artifactHubPkg := catalog.BuildArtifactHubPkg(pattern.Name, filepath.Join(dir, "deploy.yml"), pattern.UserID, "1.0.0", currentDateTime.Format(time.RFC3339), convertedCatalogData) Since I didn't understand how to provide version with the UI and where it is taken over from, (Is that information available via the '/api/catalog/content/pattern' Get?)

Signed commits

welcome[bot] commented 1 week ago

Yay, your first pull request! :thumbsup: A contributor will be by to give feedback soon. In the meantime, please review the Newcomers' Guide and sure to join the community Slack. Be sure to double-check that you have signed your commits. Here are instructions for making signing an implicit activity while peforming a commit.

netlify[bot] commented 1 week ago

Deploy Preview for mesheryio-preview ready!

Name Link
Latest commit de62cc036737484576338d39ea087de188401ded
Latest deploy log https://app.netlify.com/sites/mesheryio-preview/deploys/667a0b5de2b7da0008eb1f29
Deploy Preview https://deploy-preview-1770--mesheryio-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

MUzairS15 commented 1 week ago

@dusdjhyeon The API is returning responses will you recheck?

dusdjhyeon commented 1 week ago

@dusdjhyeon The API is returning responses will you recheck?

Now we can get it! I modified func main a bit to fit that in. And, I also resolved something

dusdjhyeon commented 5 days ago

Please handle the error using meshkit errors.

Have you tried running the workflow at your forked repo to verify if files are generated correctly? If possible, try running this workflow on your forked repo and share a link to the generated files.

An example of the artifacthub-pkg.yml obtained by running this Github Action can be found at the following link.

It has been modified to utilize Meshkit err as much as possible, and in some places it uses

if err != nil {
    return err
} 

in the log in main to pass in the meshkit err returned by the invoked function.

leecalcote commented 4 days ago

@dusdjhyeon Design versioning is now supported. Please ensure that we are not hardcoding design version here, but using the value provided by the Cloud catalog (in the same way that you are for other design properties).

leecalcote commented 4 days ago

I wonder if this conversion program shouldn't be under a folder named "artifact-hub-pkg" or something similar, something more descriptive than "actions". What do you think, @dusdjhyeon?

leecalcote commented 4 days ago

@dusdjhyeon will you confirm that if this script fails, that 1) we continue to publish designs, and @Jougan-0 will you ensure that 2) an email is sent to developers@meshery.io to ensure that the failure gets attention?

dusdjhyeon commented 4 days ago

I wonder if this conversion program shouldn't be under a folder named "artifact-hub-pkg" or something similar, something more descriptive than "actions". What do you think, @dusdjhyeon?

I think artifact-hub-pkg is clear.

welcome[bot] commented 2 days ago

Thanks for your contribution to the Layer5 and Meshery community! :tada:

Meshery Logo

        :star: Please leave a star on the project. :smile: