aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| * | | | | | | | Remove codeql analysis as it had little effectGravatar Sebastiaan Zeeff2020-11-14-32/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The codeql analysis action we had proved to add little value to our test suite and has been removed. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| * | | | | | | | Set flake8 action checkName to correct value Gravatar Sebastiaan Zeeff2020-11-14-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `checkName` value of this action needs to have the same value as the name of the job. Co-authored-by: Joe Banks <[email protected]>
| * | | | | | | | Stop Checkout Actions from persisting credentialsGravatar Sebastiaan Zeeff2020-11-14-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, the Checkout Actions persists the credentials in the environment. As our Actions will also run for PRs made from a fork, we don't want to persist credentials in such a way. I've also: - Ported a comment on PIP_USER and pre-commit from the azure configs - Removed unnecessary id for the pre-commit caching step Signed-off-by: Sebastiaan Zeeff <[email protected]>
| * | | | | | | | Add CI dependency coveralls to our PipfileGravatar Sebastiaan Zeeff2020-11-14-4/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dependency `coveralls` was installed directly in GitHub Actions, as it's not required for local dev environments. However, it's a small package and there's value in keeping all our dependency specifications in one place. That's why I've moved it to the [dev] section of our Pipfile. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| * | | | | | | | Migrate CI Pipeline to GitHub ActionsGravatar Sebastiaan Zeeff2020-11-14-251/+265
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've migrated our Azure CI Pipeline to GitHub Actions. While the general workflow is the same, there are a few changes: - `flake8` is no longer run by `pre-commit`, but rather by a separate action that adds annotations to the GH Action results page. - As we no longer have need for xml-formatted coverage files, the xmlrunner for unittest has been removed as a dependency. Instead, we now publish our coverage results to coveralls.io. - We use version 2 of docker's GitHub Action build-and-push flow, which is split over multiple steps instead of one. - I have changed the badges to GitHub Actions and coveralls.io badges. Note: Because we accept PRs from forks, we need to be a bit careful with our secrets. While we do use the `pull_request_target` event, we should not expose secrets in steps that run code from the repository. Signed-off-by: Sebastiaan Zeeff <[email protected]>
* | | | | | | | CI: disable 'continueOnError'Gravatar kwzrd2020-11-13-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After #1219, we started to encounter issues with the cache being corrupted and CI failing due to 'pre-commit' not being installed after restore. Although it doesn't seem likely that this could have been the culprit, the issues began appearing shortly after merging the PR. Let's see what happens if we disable it.
* | | | | | | | CI: invalidate environment cacheGravatar kwzrd2020-11-13-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cache was corrupted again for unknown reasons.
* | | | | | | | Merge pull request #1272 from python-discord/Hemlock/voice-gate-pingGravatar Daniel Brown2020-11-12-3/+100
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Voice Gate: notify new unverified users in the verification channel
| * | | | | | | | Config: ensure 2 blank lines between classesGravatar kwzrd2020-11-11-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous changes reduced the spacing to 1 blank line, which is inconsistent with the prevailing style.
| * | | | | | | | Merge CI dep cache bump from 'master' branchGravatar kwzrd2020-11-11-1/+1
| |\ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | |
| * | | | | | | | Merge CI changes from 'master' branchGravatar kwzrd2020-11-10-5/+9
| |\ \ \ \ \ \ \ \ | | | |_|_|/ / / / | | |/| | | | | |
| * | | | | | | | Voice Gate: explain the purpose of `NO_MSG`Gravatar kwzrd2020-11-10-0/+4
| | | | | | | | |
| * | | | | | | | Voice Gate: ensure atomicity when notifying usersGravatar kwzrd2020-11-10-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the listener risked yielding control to a racing event at multiple points between checking whether the member was already notified, notifying them, and writing this information into the cache. As a result, in a pathological case, multiple racing coroutines could have passed the membership check and ping-spammed the user, before the first coro could have a chance to write the message ID into the cache. In this commit, we move this logic into an atomic helper, which will ensure that events are processed one-by-one, and subsequent events correctly abort. Co-authored-by: MarkKoz <[email protected]> Co-authored-by: Sebastiaan Zeeff <[email protected]> Co-authored-by: Daniel Brown <[email protected]>
| * | | | | | | | Voice Gate: define atomic `_delete_ping` functionGravatar kwzrd2020-11-10-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for ping deletion was duplicated in two places. In this commit, we move it into a helper function, and apply a lock to make each transaction atomic. This means that if two coroutines try to call the function, the first has to finish before the second can begin. This avoids the following: Coro1: Message in cache? Yes. Coro1: Send delete request. Yield control (await). Coro2: Message in cache? Yes. Now Coro2 has to wait for Coro1 to finish. Therefore it will always find the `NO_MSG` signal, and not attempt the deletion. Co-authored-by: MarkKoz <[email protected]> Co-authored-by: Sebastiaan Zeeff <[email protected]> Co-authored-by: Daniel Brown <[email protected]>
| * | | | | | | | Voice Gate: correct after-delay message delete methodologyGravatar kwzrd2020-11-09-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a HTTP method so that we do not have to fetch the message object, the cache only gives us the ID.
| * | | | | | | | Voice Gate: correct HTTP delete method usageGravatar kwzrd2020-11-09-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the need to fetch the Channel object. Add a trace log to help with testing.
| * | | | | | | | Voice Gate: refer to config rather than hard-coded durationGravatar kwzrd2020-11-08-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The const was introduced for this purpose, but it was accidentally not being used.
| * | | | | | | | Voice Gate: fix cache membership checkGravatar kwzrd2020-11-08-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the cache offers a 'contains' coro, let's use it. If the member ID is already present in the cache, they were either already verified, or were already pung about not being verified.
| * | | | | | | | Voice Gate: one-line func signatureGravatar kwzrd2020-11-08-7/+2
| | | | | | | | |
| * | | | | | | | Added dummy parameter, changed message delete logicGravatar Daniel Brown2020-11-08-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added a None placeholder in the `__init__` for voice gate channel. - Changed deletion logic in on_voice_state_update to check if the message has already been deleted. - Changed deletion logic in voice_verify to only require one api call.
| * | | | | | | | Removed extra else's and added constantGravatar Daniel Brown2020-11-06-28/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Removed unnecessary else statements - Added NO_MSG constant to replace the `False` that was being used previously in the redis cache. Signed-off-by: Daniel Brown <[email protected]>
| * | | | | | | | Requested fixes - Various restructures of code.Gravatar Daniel Brown2020-11-06-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Changed `VOICE_PING` constant to not contain the format brackets. - Added more detailed description of what the `redis_cache` will hold. - Changed message content verification to use the whole newly formatted `VOICE_PING` constant instead of a slice of it. - Added remaining parameters for the `on_voice_state_update` event for clarity. - Reorganized the logic of the `on_voice_state_update` for better clarity and better logging purposes. - Removed `_async_init` in favor of checking if the guild is ready inside the `on_voice_state_update` event. Verification channel is now loaded each time when needed, reducing risk of the object becoming stale or erroring out due to the not being ready before an event was triggered. Signed-off-by: Daniel Brown <[email protected]>
| * | | | | | | | Merge remote-tracking branch 'origin/Hemlock/voice-gate-ping' into ↵Gravatar Daniel Brown2020-11-05-108/+175
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hemlock/voice-gate-ping
| | * \ \ \ \ \ \ \ Merge branch 'master' into Hemlock/voice-gate-pingGravatar Daniel Brown2020-11-05-108/+175
| | |\ \ \ \ \ \ \ \
| * | | | | | | | | | Corrected linting errors.Gravatar Daniel Brown2020-11-05-3/+2
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Brown <[email protected]>
| * | | | | | | | | - Added ping deletion time to config file.Gravatar Daniel Brown2020-11-05-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added ping message constant to the top of the voice_gate.py file. - Corrected logic error in checking if a user is cached and in a voice channel. - Reduced default message deletion time to 1 minute from 5 minutes. - Adjusted on_message event to ignore the verification ping message. Signed-off-by: Daniel Brown <[email protected]>
| * | | | | | | | | Bug fixes, including improper cache calls, typos and moreGravatar Daniel Brown2020-11-03-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Corrected spelling on _async_init call - Changed the None value stored in the cache if the user is already verified to False, as RedisCache doesn't support None. - Changed RedisCache type hint to reflect change made in storage style - Suppress NotFound errors when the ping_message can't be retrieved. - Corrected lack of await on send call More fixes to come. Signed-off-by: Daniel Brown <[email protected]>
| * | | | | | | | | Added ping message, message id storage and message deletionGravatar Daniel Brown2020-11-02-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Users who have never joined the voice channels before (and are currently unverified) will receive a ping in the #voice_verification channel - If user is unverified, the message id is stored in the cache along with the user id. - Added a message deletion to the voiceverify command, which removes the ping message if one exists. Also sets stored message ID to None so that it doesn't attempt to delete messages that aren't there - Set timed message deletion for 5 minutes.
| * | | | | | | | | Added RedisCache and eventGravatar Daniel Brown2020-11-02-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added RedisCache instance as a class attribute of the VoiceGate cog. - Added voice_gate channel as an attribute to use it later in the cog. - Added cache type hint. Signed-off-by: Daniel Brown <[email protected]>
| * | | | | | | | | Added method definition and needed imports.Gravatar Daniel Brown2020-10-30-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Brown <[email protected]>
| | | | | * | | | | Make `additional_info` non-optional.Gravatar kosayoda2020-10-20-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `Optional` typehint suggests allowing None as a value, which does not make sense as a message in the logs.
| | | | | * | | | | Improve default argument.Gravatar kosayoda2020-10-08-4/+1
| | | | | | | | | |
| | | | | * | | | | Resolve logic error with reason override.Gravatar kosayoda2020-10-08-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason override for the user message should be set to the infraction reason *if* the override is None, not if it isn't. The parameter is also renamed to `user_reason` for better clarity.
| | | | | * | | | | Modify `!superstar` to use `apply_infraction`.Gravatar kosayoda2020-10-01-49/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using `apply_infraction` from `InfractionScheduler` rather than doing it manually allows us to handle HTTP errors while reducing code duplication. Specifically, discord.Forbidden is handled when the bot tries to superstar someone they do not have permissions to. Resolves BOT-5Q.
| | | | | | | * | | fix(bot): PR reivew of bot.pyGravatar Thomas Petersson2020-11-27-8/+10
| | | | | | | | | |
| | | | | | | * | | Merge branch 'master' into fix/tagp/graceful-stasd-connectGravatar Thomas Petersson2020-11-09-907/+2421
| | | | | | | |\ \ \ | | | | |_|_|_|/ / / | | | |/| | | | | |
| | | | | | | * | | fix(bot): statds pr review suggestionsGravatar Thomas Petersson2020-11-09-6/+14
| | | | | | | | | |
| | | | | | | * | | fix(bot): better fallback logicGravatar Thomas Petersson2020-10-05-3/+3
| | | | | | | | | |
| | | | | | | * | | fix(bot): refactor of connect_statsdGravatar Thomas Petersson2020-10-05-9/+5
| | | | | | | | | |
| | | | | | | * | | fix(bot): redundant false checks on self.statsGravatar Thomas Petersson2020-10-05-11/+3
| | | | | | | | | |
| | | | | | | * | | fix(bot): Not assign stats to NoneGravatar Thomas Petersson2020-10-05-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | self.stats is referred to as bot.stats in the project, which was overlooked. This should "disable" stats until it's successfully reconnected. The retry attempts will continue until it stops throwing or fails 10x
| | | | | | | * | | fix(statsd): Gracefully handle gaierroGravatar Thomas Petersson2020-10-05-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per issue #1185 the bot might go down if the statsd client fails to connect during instantiation. This can be caused by an outage on their part, or network issues. If this happens getaddrinfo will raise a gaierror. This PR catched the error, sets self.stats to None for the time being, and handles that elsewhere. In addition a fallback logic was added to attempt to reconnect, in the off-chance it's a temporary outage
| | | | | | | | * | Added docstring for the user activity function.Gravatar Xithrius2020-12-10-1/+6
| | | | | | | | | |
| | | | | | | | * | Merge branch 'moderation/user-from-metricity' of ↵Gravatar Xithrius2020-12-10-12/+7
| | | | | | | | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/python-discord/bot into moderation/user-from-metricity
| | | | | | | | | * | Slightly reformatted activity block building.Gravatar Xithrius2020-12-10-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Hassan Abouelela <[email protected]>
| | | | | | | | | * | Compressed embed buildingGravatar Xithrius2020-12-10-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Hassan Abouelela <[email protected]>
| | | | | | | | * | | Compressed if into or statements.Gravatar Xithrius2020-12-10-9/+2
| | | | | | | | |/ /
| | | | | | | | * | Changed logic of membership info creation.Gravatar Xithrius2020-11-11-14/+20
| | | | | | | | | |
| | | | | | | | * | Moved activity data further up in embed.Gravatar Xithrius2020-11-06-14/+31
| | | | | | | | | |
| | | | | | | | * | User command gets verification time and message count.Gravatar Xithrius2020-11-04-1/+21
| | |_|_|_|_|_|/ / | |/| | | | | | |