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

Available project integrations not callable from the CLI #2774

Open
Sjord opened this issue Jan 23, 2024 · 1 comment
Open

Available project integrations not callable from the CLI #2774

Sjord opened this issue Jan 23, 2024 · 1 comment

Comments

@Sjord
Copy link
Contributor

Sjord commented Jan 23, 2024

slug is both required and unexpected:

$ python -m gitlab project-service available --project-id 1
...
__main__.py project-service available: error: the following arguments are required: --slug
$ python -m gitlab project-service available --project-id 1 --slug slack
...
TypeError: ProjectIntegrationManager.available() got an unexpected keyword argument 'slug'
@Sjord
Copy link
Contributor Author

Sjord commented Jan 23, 2024

ProjectIntegration:

class ProjectIntegration(SaveMixin, ObjectDeleteMixin, RESTObject):
    _id_attr = "slug"

In cli.py:

# We need to get the object somehow
if not issubclass(cls, gitlab.mixins.GetWithoutIdMixin):
    if cls._id_attr is not None:
        id_attr = cls._id_attr.replace("_", "-")
        sub_parser_action.add_argument(f"--{id_attr}", required=True)

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

No branches or pull requests

1 participant