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

Auto generation POC #1962

Draft
wants to merge 50 commits into
base: master
Choose a base branch
from
Draft

Auto generation POC #1962

wants to merge 50 commits into from

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented May 24, 2023

⚠️ DO NOT MERGE ⚠️

Jiras: CLOUDP-179039, CLOUDP-181608

This is a POC of auto-generating commands using openapi-generator-cli

Demo

Untitled.mov

Design

  • Some design choices were made considering scripted usage only and non-interactive commands.
  • All commands that pass a request body to the API have to pass a json via --file or standard input
  • Unlike our CLI today there is no --output instead all commands write json and have a --format that you can use to filter data (similar to docker inspect)
  • Watchers are possible to implement but require manual intervention (ref)
  • Docs are taken straight from the API, but can be customized (example)
  • commands are grouped following how our APIs are grouped, so there is no deep nesting for commands anymore
  • all generated commands are under atlas api

Considerations

  • I've used https://openapi-generator.tech/ to generate commands straight from open API spec, currently I'm downloading the transformed openapi spec that SDK is using, which is a requirement given we need our data types matching across given we use SDK in the generated code.
  • I'm using go.mod to fetch which version of SDK is currently used so regenerating commands would be dependent on SDK upgrades, as in a PR is opened to update SDK and we run make gen-openapi on the same PR

@fmenezes fmenezes added the WIP Work in progress label May 26, 2023
@fmenezes fmenezes changed the title Auto generation POC CLOUDP-179039 Auto generation POC May 30, 2023
@wtrocki
Copy link
Member

wtrocki commented Jun 2, 2023

Truly astonishing how close this looks compared to user written code.

@fmenezes fmenezes changed the title CLOUDP-179039 Auto generation POC Auto generation POC Jun 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

This PR has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

@github-actions github-actions bot added the stale A stale issue or PR label Jul 7, 2023
@wtrocki wtrocki removed the stale A stale issue or PR label Jul 7, 2023
Copy link
Contributor

github-actions bot commented Dec 1, 2023

This PR has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

@github-actions github-actions bot added the stale A stale issue or PR label Dec 1, 2023
@github-actions github-actions bot closed this Dec 31, 2023
@tibulca tibulca reopened this Jan 2, 2024
@github-actions github-actions bot removed the stale A stale issue or PR label Jan 3, 2024
Copy link
Contributor

github-actions bot commented Feb 3, 2024

This PR has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

@github-actions github-actions bot added the stale A stale issue or PR label Feb 3, 2024
@tibulca
Copy link
Collaborator

tibulca commented Feb 4, 2024

bump

@github-actions github-actions bot removed the stale A stale issue or PR label Feb 5, 2024
Copy link
Contributor

github-actions bot commented Mar 7, 2024

This PR has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

@github-actions github-actions bot added the stale A stale issue or PR label Mar 7, 2024
@github-actions github-actions bot closed this Apr 6, 2024
@tibulca tibulca reopened this Apr 24, 2024
@github-actions github-actions bot removed the stale A stale issue or PR label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants