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: add login command #3600

Merged
merged 20 commits into from
Aug 21, 2023
Merged

feat: add login command #3600

merged 20 commits into from
Aug 21, 2023

Conversation

gabrielmbmb
Copy link
Member

@gabrielmbmb gabrielmbmb commented Aug 21, 2023

Description

This PR adds the login command that will allow to login in an Argilla server and store the credentials locally so they can be used later when calling rg.init or other CLI commands.

In addition, a init_callback function has been added to be reused as callback function for the groups of commands that needs to "login" before getting executed.

Closes #3584

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested

Tested manually in a local development environment and added tests to cover the additions and changes.

Checklist

  • I added relevant documentation
  • I followed the style guidelines of this project
  • I did a self-review of my code
  • I made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I filled out the contributor form (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

@gabrielmbmb gabrielmbmb added type: enhancement Indicates new feature requests client labels Aug 21, 2023
@gabrielmbmb gabrielmbmb added this to the 1.15.0 milestone Aug 21, 2023
@gabrielmbmb gabrielmbmb self-assigned this Aug 21, 2023
Copy link
Member

@alvarobartt alvarobartt left a comment

Choose a reason for hiding this comment

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

LGTM!

app = typer.Typer(invoke_without_command=True)


@app.callback(help="Login to an Argilla server")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@app.callback(help="Login to an Argilla server")
@app.callback(help="Login into an Argilla Server")

Comment on lines 24 to 30
api_url: str = typer.Option(..., help="The URL of the Argilla server to login"),
api_key: str = typer.Option(..., help="The API key to use to login to the Argilla server", prompt="API Key"),
workspace: Optional[str] = typer.Option(
None, help="The default workspace over which the operations will be performed"
),
extra_headers: Optional[str] = typer.Option(
None, help="A JSON string with extra headers to be sent in the requests to the Argilla server"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
api_url: str = typer.Option(..., help="The URL of the Argilla server to login"),
api_key: str = typer.Option(..., help="The API key to use to login to the Argilla server", prompt="API Key"),
workspace: Optional[str] = typer.Option(
None, help="The default workspace over which the operations will be performed"
),
extra_headers: Optional[str] = typer.Option(
None, help="A JSON string with extra headers to be sent in the requests to the Argilla server"
api_url: str = typer.Option(..., help="The URL of the Argilla Server to login into"),
api_key: str = typer.Option(..., help="The API key to use to login into the Argilla Server", prompt="API Key"),
workspace: Optional[str] = typer.Option(
None, help="The default workspace over which the operations will be performed"
),
extra_headers: Optional[str] = typer.Option(
None, help="A JSON string with extra headers to be sent in the requests to the Argilla Server"

@github-actions
Copy link

The URL of the deployed environment for this PR is https://argilla-quickstart-pr-3600-ki24f765kq-no.a.run.app

Co-authored-by: alvarobartt <alvaro@argilla.io>
@gabrielmbmb gabrielmbmb merged commit 525c381 into develop Aug 21, 2023
2 of 3 checks passed
@gabrielmbmb gabrielmbmb deleted the feature/login-command branch August 21, 2023 16:12
artikandri pushed a commit to CLARIN-PL/argilla that referenced this pull request Oct 30, 2023
# Description

This PR adds the `login` command that will allow to login in an Argilla
server and store the credentials locally so they can be used later when
calling `rg.init` or other CLI commands.

In addition, a `init_callback` function has been added to be reused as
callback function for the groups of commands that needs to "login"
before getting executed.

Closes argilla-io#3584

**Type of change**

- [x] New feature (non-breaking change which adds functionality)

**How Has This Been Tested**

Tested manually in a local development environment and added tests to
cover the additions and changes.

**Checklist**

- [ ] I added relevant documentation
- [x] I followed the style guidelines of this project
- [x] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [x] I have added relevant notes to the `CHANGELOG.md` file (See
https://keepachangelog.com/)

---------

Co-authored-by: alvarobartt <alvaro@argilla.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add login command python -m argilla login
2 participants