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

Modifying cli to be compatible with api. #9

Merged
merged 7 commits into from
Oct 3, 2024

Conversation

SirEntropy
Copy link
Contributor

@SirEntropy SirEntropy commented Oct 2, 2024

This changes login, logout, projects, branches, targets and deployments

cased deploy is split into another PR to make it more readable.

Complete example:
CleanShot 2024-10-02 at 12 17 49

Copy link

linear bot commented Oct 2, 2024

CAS-1945 CLI to match web functionality.

Bringing the CLI up to date with current functionality. The APIs have slightly changed because of projects.

rick let's coordinate on this, I can take make sure the server-side is working.

Functionality

Must-have

These already exist or need to be slightly updated because of new APIs

  • Deploy a branch
  • List projects
  • List targets for a project
  • List all deploys
  • List deploys for a project
  • List deploys for a target
  • Auto-generate basic deploy script for onboarding

More to-do [ted]

  • Create a target
  • Create a Cased project (associated with a repo)

Packaging

  • Update README for running it
  • Need to ensure docs are accurate
  • Make sure rick has access to cased pypi
  • Version the cli
  • Upload to pypi

Marketing

  • Ted to announce etc

More Ideas

What are other onboarding things?

  • Can I run some command from the website/docs and install cased cli? Probably a bash script piped in
  • Goal: onboarding setup

cased/cli.py Outdated
@@ -27,6 +27,8 @@ def cli():
cli.add_command(logout)
cli.add_command(deployments)
cli.add_command(branches)
cli.add_command(projects)
cli.add_command(targets)

# ... (keep the login and setup_target commands as they were) ...
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# ... (keep the login and setup_target commands as they were) ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol should ask this LLM to not generate those comments

@@ -73,17 +74,17 @@ def build() -> None:

project_name = get_repo_name()
secrets = extract_secrets_from_workflow(workflow_content)
create_secrets(project_name, secrets)
CasedAPI().create_secrets(project_name, secrets)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts about exporting the empty constructor form of this as just cased_api? cc @ivan-cased

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

You could have cased_api = CasedAI() in another file, so is can be imported as cased_api. Not a big deal either way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah could be, may choose to do that in the branch_deploy PR, wanting to organize the error messages from api a bit and determine the final structure, right now we sys.exit on non 200 response, that's not a good way to implement or debug.

Copy link
Contributor

@tnm tnm left a comment

Choose a reason for hiding this comment

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

🚢🚢🚢🚢🚢

Great work making it happen.

@SirEntropy SirEntropy merged commit 30bfa72 into main Oct 3, 2024
1 check passed
@SirEntropy SirEntropy deleted the rick/cas-1945-cli-to-match-web-functionality branch October 3, 2024 18:18
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.

2 participants