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

Add command to queue packages #203

Merged
merged 6 commits into from
Jul 14, 2024
Merged

Add command to queue packages #203

merged 6 commits into from
Jul 14, 2024

Conversation

Robin5605
Copy link
Contributor

Closes #151

Copy link
Contributor

@jonathan-d-zhang jonathan-d-zhang left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

If the Dragonfly API returns a 409, then make another request to check
if the package has results already. If it does, then simply display
those results. If it doesn't, then that means the package is currently
in a "queued" or "pending" state. We can just send a feedback message
saying this in this case.
@Robin5605
Copy link
Contributor Author

Some suggestions from @import-pandas-as-numpy on Discord:

  • It would be nice to get the output... somewhere.
  • It would be nice to get some feedback if it was already scanned.

@import-pandas-as-numpy what do you think about a button on the result message that lets you check if the queued package is done? Something along the lines of a "refresh" button.

@Robin5605
Copy link
Contributor Author

Robin5605 commented Jan 29, 2024

After further discussion, we should also add a background task that would periodically check for this package, and update the message with the new results if it's done.

@Robin5605
Copy link
Contributor Author

Gonna hold off on the background task thing for now, and do that in a separate PR for the sake of getting this merged.

Copy link
Contributor

@jonathan-d-zhang jonathan-d-zhang left a comment

Choose a reason for hiding this comment

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

LGTM other than mild changes, though I am not too familiar with discord.py

src/bot/dragonfly_services.py Show resolved Hide resolved
src/bot/exts/dragonfly/dragonfly.py Outdated Show resolved Hide resolved
src/bot/exts/dragonfly/dragonfly.py Show resolved Hide resolved
src/bot/exts/dragonfly/dragonfly.py Outdated Show resolved Hide resolved
Robin5605 added 2 commits July 2, 2024 20:26
Instead of creating a new variable `package` assigned to the first item
of `scan_results` (or `None` if its' empty), we simply check if the
`scan_results` list is not empty - if it's not, use the first item. If
it is, display a message to the user.

The `package` variable obtained from getting the first item of
`scan_results` was unused regardless, so this only made the code harder
to read.
Copy link
Contributor

@jonathan-d-zhang jonathan-d-zhang left a comment

Choose a reason for hiding this comment

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

LGTM

src/bot/dragonfly_services.py Show resolved Hide resolved
src/bot/exts/dragonfly/dragonfly.py Outdated Show resolved Hide resolved
@jonathan-d-zhang jonathan-d-zhang merged commit 449f909 into main Jul 14, 2024
10 checks passed
@jonathan-d-zhang jonathan-d-zhang deleted the robin/feat/queue-pkg branch July 14, 2024 00:27
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

Successfully merging this pull request may close these issues.

Add command to queue packages
3 participants