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

Feature/SK-1229 | Project resource for CLI extension #784

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

KatHellg
Copy link
Contributor

@KatHellg KatHellg commented Jan 8, 2025

Features:

  • create project
  • delete project
  • activate project
  • list projects
  • get project

@github-actions github-actions bot added feature New feature or request minor labels Jan 8, 2025
@KatHellg KatHellg changed the title feature/SK-1229 | Project resource for CLI extension Feature/SK-1229 | Project resource for CLI extension Jan 8, 2025
@Wrede Wrede added the HOLD label Jan 8, 2025
Copy link
Member

@Wrede Wrede left a comment

Choose a reason for hiding this comment

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

mycket bra! Har några kommentarer

fedn/cli/login_cmd.py Outdated Show resolved Hide resolved
fedn/cli/login_cmd.py Outdated Show resolved Hide resolved
if not os.path.exists(context_path):
os.makedirs(context_path)
try:
with open(f"{context_path}/context.yaml", "w") as yaml_file:
Copy link
Member

Choose a reason for hiding this comment

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

vad händer om det redan finns en context.yaml med innehåll?

fedn/cli/login_cmd.py Outdated Show resolved Hide resolved
fedn/cli/login_cmd.py Outdated Show resolved Hide resolved
fedn/cli/project_cmd.py Outdated Show resolved Hide resolved
fedn/cli/project_cmd.py Outdated Show resolved Hide resolved
fedn/cli/project_cmd.py Outdated Show resolved Hide resolved
fedn/cli/project_cmd.py Outdated Show resolved Hide resolved
@@ -16,6 +18,8 @@

API_VERSION = "v1"
Copy link
Member

Choose a reason for hiding this comment

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

detta måste funka för windows också, gör det det?

@KatHellg KatHellg requested a review from Wrede January 13, 2025 08:53
Copy link
Member

@Wrede Wrede left a comment

Choose a reason for hiding this comment

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

Nice! Some few things..

@@ -20,13 +19,13 @@ def login_cmd(ctx):


@login_cmd.command("login")
@click.option("-", "--name", required=False, default=None, help="username in studio")
@click.option("-pw", "--password", required=False, default=None, help="password in studio")
@click.option("-n", "--username", required=False, default=None, help="username in studio")
Copy link
Member

Choose a reason for hiding this comment

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

-u is more common

else:
click.secho(f"Unexpected error: {response.text}", fg="red")
click.secho(f"Unexpected error: {response.status_code}", fg="red")


def get_context(response, protocol, host):
Copy link
Member

Choose a reason for hiding this comment

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

add typing

print(f"Error: Failed to write to YAML file. Details: {e}")

click.secho(f"Project with slug {slug} is now active.", fg="green")
click.echo("No projects available to activate.")
Copy link
Member

Choose a reason for hiding this comment

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

"No projects available to set current context."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request HOLD minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants