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

wumpy-interactions migration CLI #8

Open
4 tasks
Bluenix2 opened this issue Mar 3, 2022 · 0 comments
Open
4 tasks

wumpy-interactions migration CLI #8

Bluenix2 opened this issue Mar 3, 2022 · 0 comments
Labels
feature New addition to the library minor Deprecate, remove, or add a feature wumpy-interactions

Comments

@Bluenix2
Copy link
Collaborator

Bluenix2 commented Mar 3, 2022

Summary

This a feature request for adding a __main__.py file to wumpy-interactions that would be used to manually synchronize and migrate application commands based on registered callbacks in code. This is meant as a tool for more stable bot updates.

One might argue that migrations of application commands should be managed by a third party but that has the downside of not integrating as closely to the library and being unable to generate migrations from the code.

Description

Usage

The CLI tool should be housed in the __main__.py file such that it can be invoked with:

python -m wumpy.interactions

For now, this file should only have one command migrate. This command only has one argument being where to find the InteractionApp that houses all commands, with the same format as extensions and ASGI (folder.file:variable). A typical invocation may look like this:

python -m wumpy.interactions migrate src.main:app

Functionality

After being involved the CLI should load the app requested and try to find its commands. It should then fetch all commands upstream (from Discord) and compare locally. This way, a confirmation dialogue showing everything that will be changed can be outputted. To bypass this confirmation the -y flag can be added to the migrate command.

If confirmed, the CLI tool should then make the bulk-update request and respond with a summarized changelog.

Implementation

I do not want this CLI tool to be the reason that another dependency is added. Therefore it should either be implemented directly, or using a module from the standard library. It'll be implement with async and wumpy-rest to make the requests since that is already a dependency.

Tasks

This is a summarized step-by-step list of changes that need to be made:

  • Create the __main__.py file and setup a basic CLI
  • Add the file loading functionality and be able to find the InteractionApp instance
  • Fetch registered commands from Discord and generate informative output about what's different to what the InteractionApp has registered
  • Wait for confirmation and make the final request, also implementing the -y flag to skip this prompt
@Bluenix2 Bluenix2 added feature New addition to the library minor Deprecate, remove, or add a feature labels Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New addition to the library minor Deprecate, remove, or add a feature wumpy-interactions
Projects
Status: 📁 - Planning
Development

No branches or pull requests

1 participant