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:app launchpad && template supports api calls #4322

Merged
merged 5 commits into from
Nov 21, 2023

Conversation

zjy365
Copy link
Contributor

@zjy365 zjy365 commented Nov 20, 2023

πŸ€–[deprecated] Generated by Copilot at f9a5bab

Summary

πŸš€πŸ› οΈπŸ“„

This pull request adds several new API handler functions for the template and applaunchpad providers, to enable creating, applying, and exporting templates and apps from the frontend. It also refactors some existing code to extract and reuse common functions, and adds or modifies some labels and console logs for debugging or identification purposes. It also improves the code formatting and readability of some files, and comments out some code that may cause issues in the dbprovider.

We're sailing on the SEALOS ship, with YAML files galore
We're creating and applying apps, with API handlers and more
We're fetching and exporting templates, with GetTemplateByName
We're heaving on the ropes, me hearties, on the count of three

Walkthrough

  • Add new API handlers for creating an app, creating an instance, applying a list of YAML files, exporting a template, and getting a template by name (link, link, link, link, link)
  • Extract the logic for getting the template by name into a separate function GetTemplateByName in frontend/providers/template/src/pages/api/getTemplateSource.ts and export it for reuse (link, link)
  • Move the formData2Yamls function from frontend/providers/applaunchpad/src/pages/app/edit/index.tsx to frontend/providers/applaunchpad/src/pages/api/v1alpha/createApp.ts and export it for reuse (link, link)
  • Add labels to the network service metadata in frontend/providers/dbprovider/src/utils/json2Yaml.ts (link)
  • Add a console log statement to the json2Ingress function in frontend/providers/applaunchpad/src/utils/deployYaml2Json.ts for debugging purposes (link)
  • Comment out some lines of code in frontend/providers/dbprovider/src/pages/db/detail/components/DumpImport/index.tsx for testing or debugging purposes (link)
  • Add a function serverLoadInitData to frontend/providers/applaunchpad/src/store/static.ts to load the environment variables for the SEALOS domain, port, secret, and event analyze feature (link)
  • Remove some line breaks in frontend/providers/template/src/pages/deploy/index.tsx for formatting or style purposes (link, link, link, link, link, link, link)
  • Add some empty lines to frontend/providers/applaunchpad/src/store/static.ts for formatting purposes (link, link)

@sealos-ci-robot
Copy link
Member

sealos-ci-robot commented Nov 20, 2023

πŸ€– Generated by lychee action

Summary

Status Count
πŸ” Total 1032
βœ… Successful 363
⏳ Timeouts 0
πŸ”€ Redirected 0
πŸ‘» Excluded 668
❓ Unknown 0
🚫 Errors 0

Full action output

Full Github Actions output

Copy link

sweep-ai bot commented Nov 20, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests βœ…

Comparison is base (9095a2e) 65.45% compared to head (1b5d161) 65.45%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4322   +/-   ##
=======================================
  Coverage   65.45%   65.45%           
=======================================
  Files           8        8           
  Lines         660      660           
=======================================
  Hits          432      432           
  Misses        180      180           
  Partials       48       48           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Signed-off-by: jingyang <3161362058@qq.com>
Signed-off-by: jingyang <3161362058@qq.com>
Signed-off-by: jingyang <3161362058@qq.com>
Signed-off-by: jingyang <3161362058@qq.com>
Signed-off-by: jingyang <3161362058@qq.com>
@c121914yu c121914yu merged commit 5c59030 into labring:main Nov 21, 2023
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants