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: handle PermissionError in CLI #3717

Merged
merged 8 commits into from
Sep 6, 2023

Conversation

gabrielmbmb
Copy link
Member

Description

This PR adds a way to handle the PermissionErrors that could be raised when executing a command with a logged in user that doesn't have the required permissions because of his role. In addition, the module argilla.tasks.async_typer has been renamed to argilla.tasks.typer_ext (Typer extension) and the AsyncTyper class has been renamed to ArgillaTyper.

Type of change

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

How Has This Been Tested

In a local development environment:

  • Login with an API Key linked to an annotator account
  • Trying to execute a command that required to be owner or admin printed the message describing that the logged in user doesn't have enough permissions

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 area: cli Indicates that an issue or pull request is related to the Command Line Interface (CLI) labels Sep 6, 2023
@gabrielmbmb gabrielmbmb added this to the v1.16.0 milestone Sep 6, 2023
@gabrielmbmb gabrielmbmb self-assigned this Sep 6, 2023
@gabrielmbmb gabrielmbmb changed the title feat: handler PermissionError in CLI feat: handle PermissionError in CLI Sep 6, 2023
@gabrielmbmb gabrielmbmb marked this pull request as ready for review September 6, 2023 12:04
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! The new handler_permission_error looks really nice, and I also like the rename to ArgillaTyper, thanks

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

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

@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Patch has no changes to coverable lines.

📢 Thoughts on this report? Let us know!.

@gabrielmbmb gabrielmbmb merged commit dab26b4 into develop Sep 6, 2023
17 checks passed
@gabrielmbmb gabrielmbmb deleted the feature/cli-handle-permission-error branch September 6, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli Indicates that an issue or pull request is related to the Command Line Interface (CLI) type: enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants