#dev-log

1 messages ยท Page 46 of 1

regal archBOT
#

I think we should expand upon the subtests to include user IDs that follow a more realistic format, perhaps using the real user IDs of a few staff members (since it's fully public information). Also, having something around 5 valid user IDs and 5 invalid ones would help to improve coverage (not literal code coverage %; I'm referring to coverage of possible inputs).

IMO, the ones might be a bit too unrealistic for testing purposes.

#

With there now being two separate ways to get a False return from is_maybe_token, we may want to consider adding some logging to clearly separate each case for debugging purposes. I'd also change it to an explicit else clause instead of the bare return False. For example:

    @classmethod
    def is_maybe_token(cls, test_str: str) -> bool:
        """Check the provided string to see if it is a seemingly valid token."""
        try:
            user_id, creation_timestamp...
regal archBOT
#

Also, this may be more of a personal preference, but I've found that it's significantly easier to read and debug when the valid and invalid cases are separated into 2+ tests, and then using something like assertTrue(result) and assertFalse(result) for each of the subtests respectively. At a glance, it can sometimes be needlessly difficult to discern whether it should be true or false for that specific input, especially if the list of test inputs grow.

regal archBOT
#

Could mod_log not just use the @autospec decorator since it allows any valid **kwargs for patch.object()?

E.g. @autospec(TokenRemover, "mod_log", new_callable=mock.PropertyMock) instead of having @mock.patch.object(TokenRemover, "mod_log", new_callable=mock.PropertyMock) and mod_log = mock.create_autospec(ModLog, spec_set=True, instance=True)? It would behave the same AFAICT, but it seems worthwhile to remove a line of boilerplate.

Note that I don't personally have much ex...

ebon magnetBOT
#

Build 20200514.1 succeeded

Requested by

GitHub

Duration

00:01:25

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200514.2 succeeded

Requested by

GitHub

Duration

00:01:23

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200514.3 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Bot

regal archBOT
#

I'm not sure how the is_valid_timestamp works as I couldn't find anything about how the token structure works but it doesn't seem to be behaving as expected.

With the int struct unpacking, the resulting number can be negative which just seems invalid if it's a timestamp.
Then the "snowflake" + TOKEN_EPOCH gets passed to snowflake_time where the value gets right shifted into some small number and a datetime is returned from that, as that's supposed to work with the ...

ebon magnetBOT
#

Build 20200514.4 failed

Requested by

GitHub

Duration

00:00:55

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200514.5 succeeded

Requested by

GitHub

Duration

00:01:24

Build pipeline

Bot

regal archBOT
regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200514.6 succeeded

Requested by

GitHub

Duration

00:03:05

Build pipeline

Bot

oak estuaryBOT
regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200514.7 succeeded

Requested by

Leon Sandรธy

Duration

00:03:22

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
#

Well you wouldn't consider if x == True: correct, right? So why would assertEqual be correct when comparing booleans? Sure it works but I've learned it's not good practice to compare booleans and None with ==.

Yeah, disregard that comment; you're correct. It's actually better to use assertIs() over assertEqual() when directly testing a boolean return, since the truthiness of the object (from bool(object)) could give rather misleading results if the function returns anything other t...

regal archBOT
ebon magnetBOT
#

Build 20200514.9 succeeded

Requested by

GitHub

Duration

00:01:26

Build pipeline

Bot

ebon magnetBOT
#

Build 20200514.10 failed

Requested by

GitHub

Duration

00:01:17

Build pipeline

Bot

ebon magnetBOT
#

Build 20200514.11 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200514.12 failed

Requested by

GitHub

Duration

00:00:57

Build pipeline

Bot

regal archBOT
north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200515.1 succeeded

Requested by

GitHub

Duration

00:01:52

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200515.2 succeeded

Requested by

GitHub

Duration

00:01:36

Build pipeline

Bot

regal archBOT
regal archBOT
#
  1. this should be a feature
  2. there's a reasonable way to implement it.

I like the feature, but I'm less sure about the implementation.

whenever on_typing is triggered, if there's less than 5 minutes left, we set the timeout to 5 minutes. that should keep it from timing out if someone is working on a long message.

If a Task is currently pending because it's awaiting an asyncio.sleep, is there an easy way to introspect the time that's left? I think we'll have to investigate...

regal archBOT
regal archBOT
#

I don't see why we'd need the added complexity and added work.

Our on_typing could be as simple as

@Cog.listener()
async def typing(self, channel, user, when):
    if in_category(channel.id, Category.in_use):
        self._last_typing_event[channel.id] = when

The comparison in the time-out deletion task would be trivial with datetime.datetime.now() and datetime.timedelta, and the channel move_to_dormant only needs to delete a key from that dict (even we even care...

ebon magnetBOT
#

Build 20200515.3 failed

Requested by

GitHub

Duration

00:01:05

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200515.4 failed

Requested by

GitHub

Duration

00:00:54

Build pipeline

Bot

#

Build 20200515.5 succeeded

Requested by

GitHub

Duration

00:01:33

Build pipeline

Bot

regal archBOT
#

Hey!

I think your PR has uncovered a fundamental flaw in our redirect_output decorator, but I'm not sure that the way in which you've currently solved it is the best way. The steps you took to mitigate the issue you encountered in your !help-command implementation require tweaks both at the site of the decorator (scheduling rather than awaiting the invocation deletion steps) and the command itself (moving the decorator to a dummy helper function that returns early and is only there to ...

regal archBOT
#

OK pretty sure everything mentioned has been fixed. Pretty sure I got all the ninja code but please lmk if I missed something.

Apply suggestions from Mark's code review. is a commit message that doesn't really tell me anything. It'd be better to actually list which changes were made.
Regarding this, I did try to rebase and fix this message but either I'm still useless with git or reading from 3 months ago didn't go down too well and it tried to get me to manually choose/merge every com...

north knotBOT
#

Postgres backup completed!

regal archBOT
#

The inclusion of .csv, .json and like file-types was discussed heavily in #meta around the time #925 was being solved. The consensus was that the primary purpose of that PR was to fix Discord's auto-conversion of long messages (2000 chars >)

Perhaps, instead of trying to include other file-types in the .txt filter you could simply revise the existing embed under the else to include the paste link?
![Screenshot from 2020-05-16 02-31-08](https://user-images.githubusercontent.com/64...

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200516.1 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200516.2 succeeded

Requested by

GitHub

Duration

00:01:09

Build pipeline

Bot

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200516.3 succeeded

Requested by

Leon Sandรธy

Duration

00:03:20

Build pipeline

Bot

oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: redis\_persistence
regal archBOT
#

This pull requests adds a new feature that the bot can use to add persistant storage.

This works by utilizing a Redis server as a cache, while providing a user-friendly dict-like interface.

Let's have a look at how it works and exactly what this pull request contains.

Creating a new RedisDict

The star of the show is the RedisDict. To create a new one of these, you have two options.

# Either create it as a class attribute
class SomeClass:
    my_cache = RedisDict()

...
ebon magnetBOT
#

Build 20200517.1 failed

Requested by

GitHub

Duration

00:01:30

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200517.2 failed

Requested by

GitHub

Duration

00:01:31

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200517.3 failed

Requested by

GitHub

Duration

00:01:08

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200517.4 succeeded

Requested by

GitHub

Duration

00:01:22

Build pipeline

Bot

#

Build 20200517.5 succeeded

Requested by

GitHub

Duration

00:01:23

Build pipeline

Bot

ebon magnetBOT
#

Build 20200517.6 succeeded

Requested by

GitHub

Duration

00:01:25

Build pipeline

Bot

regal archBOT
#

05616ae Refactor the Help command. - mathsman5133
87f9fdd Minor formatting changes to align with current ... - mathsman5133
5ebb87d Add a special case for when the help command in... - mathsman5133
79d5b2d Few changes to keep formatting same as current - mathsman5133
d8384b2 Show a maximum of 8 commands per page rather th... - mathsman5133

north knotBOT
ebon magnetBOT
#

Build 20200517.7 succeeded

Requested by

GitHub

Duration

00:03:06

Build pipeline

Bot

oak estuaryBOT
ebon magnetBOT
#

Build 20200517.8 succeeded

Requested by

GitHub

Duration

00:01:14

Build pipeline

Bot

#

Build 20200517.9 succeeded

Requested by

GitHub

Duration

00:01:14

Build pipeline

Bot

ebon magnetBOT
#

Build 20200517.10 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200517.11 succeeded

Requested by

GitHub

Duration

00:02:23

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200517.12 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] New branch created: help\-command\-fix\-invocation
#

Currently, we're invoking our help command manually like this:

await ctx.invoke(self.bot.get_command("help"), "bot")

However, unfortunately, this fails when the command callback function is decorated, leading to exceptions like:

AttributeError: 'Help' object has no attribute 'channel'
  File "discord/ext/commands/core.py", line 83, in wrapped
    ret = await coro(*args, **kwargs)
  File "bot/cogs/snekbox.py", line 292, in eval_command
    await ctx.invoke(self....
ebon magnetBOT
#

Build 20200517.13 failed

Requested by

GitHub

Duration

00:01:02

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200517.14 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

regal archBOT
#

A Quick comment, would it be more efficient to pass in ctx.command rather than the name of the command, where applicable? Passing in a string means an extra lookup and if for some reason the command name were to change this way means an additional change isn't required

The docs don't mention support for passing in a Context object. It can either be a Cog, a Command-object, or a string.

ebon magnetBOT
#

Build 20200517.15 succeeded

Requested by

GitHub

Duration

00:01:10

Build pipeline

Bot

#

Build 20200517.16 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200517.17 succeeded

Requested by

GitHub

Duration

00:01:10

Build pipeline

Bot

ebon magnetBOT
#

Build 20200517.18 succeeded

Requested by

GitHub

Duration

00:01:21

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: help\-command\-fix\-invocation
north knotBOT
ebon magnetBOT
#

Build 20200517.19 succeeded

Requested by

GitHub

Duration

00:03:00

Build pipeline

Bot

oak estuaryBOT
regal archBOT
#

Thanks for addressing the feedback, @decorator-factory. I think this looks really good now:

image

@ikuyarihS made a good comment earlier that the string variable in the examples could be renamed to text or similar to prevent collision with the string stdlib module (and also maybe it would make some parts of the tag more clear, where it can be difficult to tell whether we're ref...

ebon magnetBOT
#

Build 20200517.20 succeeded

Requested by

GitHub

Duration

00:01:23

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200517.22 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: decorator\-factory\-mutability\-tag
north knotBOT
ebon magnetBOT
#

Build 20200517.23 succeeded

Requested by

GitHub

Duration

00:02:57

Build pipeline

Bot

oak estuaryBOT
ebon magnetBOT
#

Build 20200517.24 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

ebon magnetBOT
#

Build 20200517.26 succeeded

Requested by

GitHub

Duration

00:01:15

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200517.27 succeeded

Requested by

GitHub

Duration

00:01:17

Build pipeline

Bot

regal archBOT
#

Description

This PR make the .8ball command use hashing instead of random.choice()

Reasoning

This makes the outcome always the same for the same question, so a user cannot brute-force the 8ball until they obtain the answer they want :grin:.

Did you:

  • [X] Join the Python Discord Community?
  • [X] If dependencies have been added or updated, run pipenv lock?
  • [X] Lint your code (pipenv run lint)?
  • [X] Set the PR t...
ebon magnetBOT
#

Build 20200517.1 succeeded

Requested by

GitHub

Duration

00:01:00

Build pipeline

Seasonal Bot

regal archBOT
#

I've opened a PR to increase the timeout while a more noticeable and clearer interface is agreed upon here; but as @SebastiaanZ pointed out in #dev-contrib there's really no downside to increasing the timeout beyond the 30s suggested here.

Any thoughts on a longer timeout? Two minutes were proposed in the #dev-contrib convo but I feel like that may be a bit long if the code would be re-evaled at the end of the timeout when a channel is a bit more active; although that shouldn't happen that...

#

I haven't tested yet, but I wanted to leave a couple of initial comments and questions. I have no experience with Redis so this is a learning opportunity for me.

It has taken me some time to figure out how the namespace is inferred when not provided explicitly. I appreciate the effort to have it done automatically, but I found the underlying machinery a little bit confusing. I'm not entirely convinced that it is necessary, either. Couldn't each cog simply provide a namespace explicitly? Wo...

regal archBOT
regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200517.2 succeeded

Requested by

GitHub

Duration

00:00:54

Build pipeline

Seasonal Bot

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200517.3 succeeded

Requested by

GitHub

Duration

00:02:21

Build pipeline

Seasonal Bot

night lilyBOT
#
SeasonalBot

Connected!

regal archBOT
#

On windows (possibly some other OSs), non utf8 default encodings are used which produces UnicodeDecodeErrors when files with characters not included in the default encodings are read.

The main issue comes from bot\resources\evergreen\trivia_quiz.json which is always ran on bot startup, and crashes with the latin1 encoding (english windows); other files incompatible with the encoding are opened with an utf8 specified.

Here's a small list of where the encoding should be specified, but...

ebon magnetBOT
#

Build 20200518.1 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200518.1 succeeded

Requested by

GitHub

Duration

00:01:01

Build pipeline

Seasonal Bot

regal archBOT
#
[python-discord/seasonalbot] branch deleted: prefix\-rich\-presence
north knotBOT
ebon magnetBOT
#

Build 20200518.2 succeeded

Requested by

GitHub

Duration

00:02:05

Build pipeline

Seasonal Bot

night lilyBOT
#
SeasonalBot

Connected!

ebon magnetBOT
#

Build 20200518.3 succeeded

Requested by

GitHub

Duration

00:00:54

Build pipeline

Seasonal Bot

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200518.4 succeeded

Requested by

GitHub

Duration

00:02:00

Build pipeline

Seasonal Bot

night lilyBOT
#
SeasonalBot

Connected!

north knotBOT
#

Postgres backup completed!

native joltBOT
#

Bumps flake8 from 3.7.9 to 3.8.1.

Commits

f94e009 Release 3.8.1
00985a6 Merge branch 'issue638-ouput-file' into 'master'
e6d8a90 options: Forward --output-file to be reparsed for BaseFormatter
b4d2850 Release 3.8.0
03c7dd3 Merge branch 'exclude_dotfiles' into 'master'
9e67511 Fix using --exclude=.* to not match . and ..
6c4b5c8 Merge branch 'linters_py3' into 'master'
309db63 switch dogfood to use python3
8905a7a Merge branch 'logical_position_out_of_bound...

regal archBOT
native joltBOT
native joltBOT
#

There are multiple methods for accomplishing this and you've provided two valid ones, via PEP 484 and PEP 563, in your original post.

The problems seem to be:

  1. PyCharm doesn't resolve a bound TypeVar
  2. The annotations seem redundant

We have no control or influence over the former, and the latter is a decision for you to make.

As discussed in #75:

The purpose of this package is not to enforce the related PEPs, as they make no mandates regarding full annotation coverage...

regal archBOT
#

I think the randomness and the chance of getting a different answer for the same question is part of the 8ball experience. It's just a random answer generator, which is often implemented purely in hardware form using a container of fluid and a floating die. Brute-forcing your answer has been a feature since its introduction in 1950.

As such, I don't think we have a desire to make ours a non-standard implementation that deterministically tries to divine the Truth.

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200518.2 succeeded

Requested by

GitHub

Duration

00:01:23

Build pipeline

Bot

north knotBOT
ebon magnetBOT
#

Build 20200518.3 succeeded

Requested by

GitHub

Duration

00:02:53

Build pipeline

Bot

oak estuaryBOT
regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200519.1 succeeded

Requested by

Joseph Banks

Duration

00:02:53

Build pipeline

Bot

oak estuaryBOT
regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200519.2 succeeded

Requested by

GitHub

Duration

00:02:47

Build pipeline

Bot

oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200519.3 failed

Requested by

GitHub

Duration

00:01:05

Build pipeline

Bot

regal archBOT
#

Rationale

Sometimes people ask regex-related questions. In order to test a particular regular expression or to demonstrate that it works, helpers have to do this:

import re
print(re.search(r"hello\s*world"))

There are a few issues with this approach:

  • non-helpers simply can't to that
  • this is inconvenient -- it's quite a setup
  • this doesn't highlight the matched groups

To solve these issues, I propose to create a !regexp command that would handle that.

Usag...

ebon magnetBOT
#

Build 20200519.4 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
north knotBOT
night lilyBOT
#
SeasonalBot

Connected!

ebon magnetBOT
#

Build 20200519.5 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
#

d2c538e Increase snekbox re eval timeout. - Numerlor
1c06d2a Move the re eval timeout to a module constant - Numerlor
5a48ed0 Change tests to use the new timeout constant - Numerlor
73943c2 Merge branch 'master' into eval-timeout-increase - Den4200
9c7627a Merge pull request #944 from Numerlor/eval-time... - Den4200

north knotBOT
oak estuaryBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200519.10 succeeded

Requested by

GitHub

Duration

00:01:53

Build pipeline

Bot

regal archBOT
#

Description

python-discord/bot#519 got merged some days ago so these changes should get merged to here too.

Reasoning

Because current help command is basically Python bot help command, just some small changes.

Would you like to implement this yourself?

  • [ ] I'd like to implement this feature myself
  • [x] Anyone can implement this feature
ebon magnetBOT
#

Build 20200520.1 succeeded

Requested by

GitHub

Duration

00:01:37

Build pipeline

Bot

regal archBOT
regal archBOT
#

Relevant Issues

  • Cleanup: Add explicit encoding on open() calls #334
  • Files without an encoding specified may crash bot #411

Closes #334
Closes #411

Description

Added explicit encoding to utf8 for cogs that open json or other text files.

Reasoning

Though this did not cause errors in Unix based OS, it was causing errors when loading some of those files in windows OS.

Additional Details

We may require explicit encoding going forward for other cogs being a...

ebon magnetBOT
#

Build 20200520.1 succeeded

Requested by

GitHub

Duration

00:01:00

Build pipeline

Seasonal Bot

regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200520.2 succeeded

Requested by

GitHub

Duration

00:01:45

Build pipeline

Bot

ebon magnetBOT
#

Build 20200520.3 succeeded

Requested by

GitHub

Duration

00:01:23

Build pipeline

Bot

regal archBOT
regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200520.4 failed

Requested by

GitHub

Duration

00:00:57

Build pipeline

Bot

#

Build 20200520.5 failed

Requested by

GitHub

Duration

00:01:02

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200520.7 failed

Requested by

GitHub

Duration

00:01:02

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200520.8 failed

Requested by

GitHub

Duration

00:01:05

Build pipeline

Bot

#

Build 20200520.10 failed

Requested by

GitHub

Duration

00:01:07

Build pipeline

Bot

#

Build 20200520.11 failed

Requested by

GitHub

Duration

00:01:26

Build pipeline

Bot

ebon magnetBOT
#

Build 20200520.12 failed

Requested by

GitHub

Duration

00:01:00

Build pipeline

Bot

#

Build 20200520.13 failed

Requested by

GitHub

Duration

00:01:04

Build pipeline

Bot

#

Build 20200520.14 succeeded

Requested by

GitHub

Duration

00:01:30

Build pipeline

Bot

regal archBOT
#

Why are you monkeypatching this directly instead of using unittest.mock.patch? The downside of monkeypatching directly is that the monkeypatch will stay behind, as the object in memory is mutated. While unittest.mock.patch does the same, in principle, it restores the original after the fact. By providing an argument for new, we can determine what it should be patched with and it makes sure that the mock doesn't get passed as an attribute to test methods.

You could use `unittest.mock....

regal archBOT
ebon magnetBOT
#

Build 20200520.15 failed

Requested by

GitHub

Duration

00:00:26

Build pipeline

Bot

ebon magnetBOT
#

Build 20200520.16 failed

Requested by

GitHub

Duration

00:01:15

Build pipeline

Bot

ebon magnetBOT
#

Build 20200520.17 succeeded

Requested by

GitHub

Duration

00:02:25

Build pipeline

Bot

#

Build 20200520.18 succeeded

Requested by

GitHub

Duration

00:01:26

Build pipeline

Bot

regal archBOT
native joltBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200521.1 succeeded

Requested by

GitHub

Duration

00:01:24

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200521.2 succeeded

Requested by

GitHub

Duration

00:01:16

Build pipeline

Bot

regal archBOT
regal archBOT
regal archBOT
#

This is something I've brought up a few times in various PRs. Basically, I don't think we should assert exact values of strings. In most cases it doesn't really matter what the exact value is. What the test should really care about is if it uses the value we wanted to. For example, rather than testing that it shows "x" every time, we should test that if we give it "x", it will show "x", but if we gave it "y", it'd show "y". This can be achieved by defining and using constants rather than usin...

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200522.1 failed

Requested by

GitHub

Duration

00:01:01

Build pipeline

Bot

ebon magnetBOT
#

Build 20200522.2 failed

Requested by

GitHub

Duration

00:00:55

Build pipeline

Bot

ebon magnetBOT
#

Build 20200522.3 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

#

Build 20200522.4 succeeded

Requested by

GitHub

Duration

00:01:07

Build pipeline

Bot

#

Build 20200522.5 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Bot

ebon magnetBOT
#

Build 20200522.6 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200522.7 succeeded

Requested by

Joseph Banks

Duration

00:03:00

Build pipeline

Bot

oak estuaryBOT
regal archBOT
#

This like is a bit problematic, as it assumes the prefix to be !. This may work for production, but a lot of testing bots are set up to use a different prefix in their config.yml. The consequence of that is that running tests locally, like people are hopefully doing after they've made changes, will show a failing test

AssertionError: 'To show a tag, type +tags <tagname>.' != 'To show a tag, type !tags <tagname>.'
- To show a tag, type +tags <tagname>.
?                     ^
...
#

Not a required change, more of a discussion.

I would have opted for an approach that provided the function with test data instead of executing the actual function on the actual data. That way, it's easy to assert not only if the keys that we set are present in the dictionary, but also that the actual parsing of the tag file and Path have worked correctly. That's the critical part of our tags storage system, I think (being able to parse the format in which we store tags), while I'm fairly c...

ebon magnetBOT
#

Build 20200522.8 succeeded

Requested by

GitHub

Duration

00:02:41

Build pipeline

Bot

oak estuaryBOT
ebon magnetBOT
#

Build 20200522.9 succeeded

Requested by

GitHub

Duration

00:02:07

Build pipeline

Bot

ebon magnetBOT
#

Build 20200522.10 succeeded

Requested by

GitHub

Duration

00:02:06

Build pipeline

Bot

regal archBOT
#

93cce50 Stats: Create guild boost stat collection - ks129
1a6abaa Stats: Added codeblock correction stats - ks129
158e19a Stats: Added stats for eval successes + fails - ks129
5878ec9 Stats: Added stats for eval role uses (Helpers/... - ks129
613b00a Stats: Added stats for eval channel using (Help... - ks129

north knotBOT
ebon magnetBOT
#

Build 20200522.11 succeeded

Requested by

Joseph Banks

Duration

00:04:17

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200523.1 succeeded

Requested by

GitHub

Duration

00:01:11

Build pipeline

Seasonal Bot

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200523.2 succeeded

Requested by

GitHub

Duration

00:02:15

Build pipeline

Seasonal Bot

night lilyBOT
#
SeasonalBot

Connected!

north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200523.1 failed

Requested by

GitHub

Duration

00:01:39

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200523.2 failed

Requested by

GitHub

Duration

00:02:31

Build pipeline

Bot

regal archBOT
#

The reason that this worked before is that when you "call" a Mock, it returns the same child mock each time. That means the lack of an argument to post() does not matter here: All you care about is getting the child mock that you want to manipulate the __aenter__ return value of.

self.bot.http_session.post() will return the mock that will be returned later when the actual code we want to test is run and the return value of that mocks __aenter__ mock is configured.

#

Other "lazy" session creators hook into the _recreate method below to do their work. What's the reason for doing it here instead of there? I don't think I mind either way, this will ensure that it will be scheduled as soon as the loop starts.

The only thing I'm slightly worried about is that I don't know when Discord calls Bot.close(): If that's done before it calls Bot.clear(), your redis session will be closed but not recreated.

Edit: A quick glance at discord.py makes me thin...

ebon magnetBOT
#

Build 20200523.3 succeeded

Requested by

GitHub

Duration

00:03:02

Build pipeline

Bot

ebon magnetBOT
#

Build 20200523.4 succeeded

Requested by

GitHub

Duration

00:02:16

Build pipeline

Bot

regal archBOT
#

I wonder if these could be defined in one place?

A very simple example:

TEMPLATES = (
    (float, "f|{value}"),
    (int,   "i|{value}"),
    (str,   "s|{value}"),
)

Both functions then use this definition, e.g. by lopping through the pairs until it finds a match. I don't love that this is essentially a bi-directional map with each direction defined elsewhere, seems fragile. Both functions also return None should no match be found, which is not annotated nor documen...

ebon magnetBOT
#

Build 20200523.5 succeeded

Requested by

GitHub

Duration

00:02:15

Build pipeline

Bot

ebon magnetBOT
#

Build 20200523.6 succeeded

Requested by

GitHub

Duration

00:01:57

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200523.7 succeeded

Requested by

GitHub

Duration

00:01:23

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200523.8 succeeded

Requested by

GitHub

Duration

00:01:19

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: bug/filters/933/dont\-delete\-in\-dms
north knotBOT
ebon magnetBOT
#

Build 20200523.9 succeeded

Requested by

GitHub

Duration

00:02:49

Build pipeline

Bot

oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200523.10 succeeded

Requested by

GitHub

Duration

00:02:05

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200523.11 succeeded

Requested by

GitHub

Duration

00:02:14

Build pipeline

Bot

regal archBOT
#

Sorry I didn't get around to reviewing this sooner - I wanted to give myself some time to think about what we're really doing here w.r.t. the persistence module and files already existing in the production environment. Ultimately I think everything is fine since in production the encoding should always default to UTF-8 anyway, as far as I'm concerned, so files already existing there will still open fine.

I do agree with @Numerlor in that we should also specify the encoding when opening fil...

ebon magnetBOT
#

Build 20200523.12 succeeded

Requested by

GitHub

Duration

00:02:07

Build pipeline

Bot

regal archBOT
regal archBOT
#

I don't know if this is a "wrong" way to write unit tests, but it's different from my approach. My problem with doing something like this is that your test not only relies on update working, but also clear and set. If set breaks, this test will fail even though it's only supposed to fail if update is broken (because it's meant to test update). It would be misleading to see this test fail for such reason because my first thought would be something is wrong with update, but upon c...

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200524.1 failed

Requested by

GitHub

Duration

00:00:56

Build pipeline

Bot

regal archBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
#

I'm not 100% certain about the usage of a bare create_task() here for creating the redis session. To me, it seems like you would want to guarantee that the session is created before proceeding rather than scheduling the initialization to be ran in the background whenever it has the chance to (which is usually while other coroutines are being awaited, but there's no guarantee that it will have time to complete).

In order to guarantee its completion, you could do one of the following, depe...

regal archBOT
#

We've been discussing on Discord about reworking the creation of all the objects here. Creating events for each thing is just too cumbersome. Your proposal to block the loop is quite a novel approach to me. Somehow, it never crossed my mind to do it like this.

I'm inclined to leave this as is and rework it along with creation of the other objects in a separate PR. Thoughts on this course of action?

regal archBOT
#

Your proposal to block the loop is quite a novel approach to me. Somehow, it never crossed my mind to do it like this.

Yeah, I personally think that for initialization purposes when startup/restart is highly infrequent and doesn't take especially long, it's perfectly okay for some calls to block the event loop. This can help simplify the startup process significantly, and the performance impact is usually negligible at best.

I'm inclined to leave this as is and rework it along with ...

#

I don't think I agree with that. Docstrings are internal docs. I think I have the opposite opinion here: I don't particularly see the need for some guide on our website to contain these sorts of implementation details, a guide should just explain how to use it. Docstrings, however, are for people who are digging into the source, and should provide a fuller idea of how the object works and behaves.

I should fix the wrong variable name, though.

ebon magnetBOT
#

Build 20200524.2 succeeded

Requested by

GitHub

Duration

00:02:08

Build pipeline

Bot

#

Build 20200524.3 succeeded

Requested by

GitHub

Duration

00:02:09

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200524.5 succeeded

Requested by

GitHub

Duration

00:02:04

Build pipeline

Bot

#

Build 20200524.4 succeeded

Requested by

GitHub

Duration

00:02:10

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200524.6 succeeded

Requested by

GitHub

Duration

00:02:22

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200524.7 succeeded

Requested by

GitHub

Duration

00:02:08

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200524.8 failed

Requested by

GitHub

Duration

00:01:44

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200524.9 succeeded

Requested by

GitHub

Duration

00:02:00

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200524.10 succeeded

Requested by

GitHub

Duration

00:03:20

Build pipeline

Bot

regal archBOT
#

I've added an option to config.yml called use_fakeredis in the latest commit, see 66d273f.

This will allow you guys to do a feature test of this without having to set up Redis. Just set this option to True, and the bot will use fakeredis instead of trying to connect to a Redis server.

This will make it a lot more contributor friendly, particularly for contributors on Windows. Redis is not even officially supported in Windows at all.

regal archBOT
#

If I want to learn how to use this class, I will first read the class docstring to get an overview. My perspective is that knowing the implementation details is just noise at this point. I don't need to know that it specifically uses __set_name__ in order to learn to effectively use this class; I just need to know that it has to be instantiated as a class attribute.

I don't know what you mean by website guide. By internal docs, I meant moving this information to one of the "private" meth...

#

One way to look at it is that we assume our redis library is already tested and working. So we can assume that if we use hmset_dict, it will work properly. The library already has tests written to ensure this. Thus, all our tests need to do is assert hmset_dict was called with the right arguments.

If not that, another way to do it is to use the redis command directly rather than via your class since, again, we assume these to be tested by the library.

On the other hand, these tests ...

#

@aeros the fact that it's not a coroutine is cause it's following discord.py's design. If a non-coroutine is called by a coroutine, then I think it's fine (which is the case when login() calls this). But there's also clear(), which isn't a coroutine. And you can see I noted in a comment that calling it outside a coroutine will raise a warning. Discord.py creates its session outside a coroutine and supports re-creating it by calling clear() and I'm just going along with this design thoug...

regal archBOT
#

I appreciate and understand your point. I think I will keep this in mind for future tests, but perhaps leave these to be for the time being, since it would require me to rewrite almost all the tests to achieve this sort of atomic testing at this point.

I think for our purposes, it's probably good enough for now that some of these tests start failing if there's a problem with the RedisCache. But I will try to write more atomic tests in the future.

ebon magnetBOT
#

Build 20200524.11 succeeded

Requested by

GitHub

Duration

00:02:07

Build pipeline

Bot

ebon magnetBOT
#

Build 20200524.12 succeeded

Requested by

GitHub

Duration

00:01:15

Build pipeline

Bot

regal archBOT
#

6c5979b Config: Added new HelpChannels config delete... - ks129 [0c84302](https://github.com/python-discord/bot/commit/0c84302f7e3475c13924fda33c52e98566114082) Help: Implemented faster close when claimant de... - ks129 [a46eff8](https://github.com/python-discord/bot/commit/a46eff8d976cf65155f27ed75f49bd3e58155c84) Help: Fix docstrings of is_emptyandon_mess... - ks129
841ce9b Help: Create embed_description_match - ks129
d3550ce HelpChannels: fix is_empty not being awaited - MarkKoz

north knotBOT
ebon magnetBOT
#

Build 20200524.13 succeeded

Requested by

GitHub

Duration

00:03:02

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
#

Description

Add additional parameters that can return

  • the date based on zodiac sign
  • zodiac sign based on dates.

Reasoning

I would like to for when .partnerzodiac is called with a zodiac sign,
In addition the zodiac info, we can also have the date range for the signs, such that those unfamiliar with the zodiac signs can learn about the dates as well.

Proposed Implementation

.partnerzodiac date
.partnerzodiac date virgo
The amazing people who are born b...

#

Within the community several discord.gift links are shared, half of them are trolls and this isn't worth keeping.

We'd like to add discord.gift links to the filter system so they are automatically deleted.

Links look like discord.gift/AABBCCDDEEFF and should be handled in a similar way to the way Discord invites are.

A lot of the code from the Discord invite filters can most likely be reused or refactored into a DRY approach to things to handle all links in this way.

An example ...

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200524.14 succeeded

Requested by

Joseph Banks

Duration

00:02:53

Build pipeline

Bot

oak estuaryBOT
regal archBOT
#

Background

How sessions are currently created

There are things the Bot needs to create which rely on a running event loop like aiohttp ClientSessions. This is done in Bot._recreate():

https://github.com/python-discord/bot/blob/b25619567d5d1ceee939d4b17c1a90ae9ac337bf/bot/bot.py#L87-L117

Because discord.py manages the event loop, we currently hook into Bot.login() and create everything in there. This is done indirectly by calling _recreate() within login():

ht...

ebon magnetBOT
#

Build 20200525.1 succeeded

Requested by

GitHub

Duration

00:00:56

Build pipeline

Seasonal Bot

#

Build 20200525.2 succeeded

Requested by

GitHub

Duration

00:01:02

Build pipeline

Seasonal Bot

regal archBOT
regal archBOT
#

@SebastiaanZ had concerns of whether the object created would be fine with the fact that the loop would temporarily stop running after they're created. There'd be a gap in which the loop is stopped between when the objects are finished being created and when discord.py starts the loop back up to run the bot.

Although I have not specifically tried this w/ aiohttp, I don't believe this will be an issue as long as the event loop is not closed during the "gap". It's definitely worth some exp...

north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200525.3 succeeded

Requested by

GitHub

Duration

00:01:02

Build pipeline

Seasonal Bot

regal archBOT
#

16a28ac 5/19 - evergreen | triva - fixed utf-8 bugs for... - jodth07
9c0cbed 5/19 - bot | xmas, easter, evergreen - updated ... - jodth07
ec1604d 5/19 - ext - set upen files encoding to utf8 fo... - jodth07
86dad21 5/24 - bot exts - updated writing with utf8 enc... - jodth07
de7e39a 5/24 - bot utils - added encoding, and notes fo... - jodth07

north knotBOT
ebon magnetBOT
#

Build 20200525.4 succeeded

Requested by

GitHub

Duration

00:02:15

Build pipeline

Seasonal Bot

night lilyBOT
#
SeasonalBot

Connected!

regal archBOT
native joltBOT
#

Bumps flake8 from 3.7.9 to 3.8.2.

Commits

4071645 Release 3.8.2
b9fe4d6 Merge branch 'extend_exclude_is_files' into 'master'
31c2f9f treat --extend-exclude as a file list
d95f9cf Merge branch 'opt-config-relative-to' into 'master'
563220b config: Normalize paths in CLI-specified config relative to config dir
8be5a72 config: Normalize paths in config relative to provided parent directory
c8494e7 Merge branch 'master' into 'master'
4557357 Parse --jobs as a ...

native joltBOT
native joltBOT
#

For consistency with mypy, it would be nice to have an option/rule that behaved the same way as mypy regarding typing of init().

Currently, flake8-annotations always raises a violation if there is no return type annotation.

Mypy, however, raises an error if there are no annotations (as this would indicate an untyped function).
i.e. If there are any annotations on parameters, then a return type is not needed. The return type is only needed when there are no parameters in order to ma...

native joltBOT
oak estuaryBOT
regal archBOT
native joltBOT
#
[python-discord/flake8-annotations] New branch created: suppress\-dynamically\-typed\-defs
regal archBOT
native joltBOT
#
[python-discord/flake8-annotations] branch deleted: suppress\-dynamically\-typed\-defs
regal archBOT
regal archBOT
regal archBOT
#

I played with this a little bit today and it seems to work really well - I think this PR is very close to being ready. Redis worked for me right out of the box with no extra set-up needed (using Docker).

I tested by setting up my own cog that uses two RedisCache instances. The namespace resolution is very cool - I was worried a little bit earlier but that was mainly due to the "3 allowed ways to instantiate" part. I don't mind awaiting the getters and setters at all. Trace-level logs hel...

ebon magnetBOT
#

Build 20200525.1 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200525.2 succeeded

Requested by

GitHub

Duration

00:02:06

Build pipeline

Bot

regal archBOT
#

Here is a cog I wrote to test this out. All the functions work!

That being said, I had trouble trying to forcefully trigger some of the errors in __get__ and _validate_cache. Whether I created the cache as an instance attribute, local variable in a function, or a module variable, the error was always that the bot is missing.

I wanted to try to trigger this error

https://github.com/python-discord/bot/blob/redis_persistence/bot/utils...

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200525.3 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: bug/filters/929/invalid\-invites
north knotBOT
ebon magnetBOT
#

Build 20200525.4 succeeded

Requested by

GitHub

Duration

00:03:03

Build pipeline

Bot

oak estuaryBOT
regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200526.1 succeeded

Requested by

Joseph Banks

Duration

00:03:24

Build pipeline

Bot

oak estuaryBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200526.2 succeeded

Requested by

GitHub

Duration

00:01:18

Build pipeline

Bot

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200526.3 succeeded

Requested by

GitHub

Duration

00:03:07

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
#

RuntimeErrors are supposed to help you figure out what you're doing wrong when you're trying to implement the RedisCache.

These logging events are supposed to help us find and diagnose bugs via Sentry.

I would be okay with including the full message, but I guess the motivation was that RuntimeErrors are contributor-facing while the exceptions are mostly just for core devs, who wouldn't mind the brevity.

Anyway, I'll change exceptions into errors and use the same error message.

regal archBOT
ebon magnetBOT
#

Build 20200526.5 succeeded

Requested by

GitHub

Duration

00:01:59

Build pipeline

Bot

regal archBOT
north knotBOT
ebon magnetBOT
#

Build 20200526.6 succeeded

Requested by

GitHub

Duration

00:03:29

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: moderation\_commands\_in\_modmail\_category
#

This pull request allows commands like !infr search inside any channel in the new ModMail category.

It does this by refactoring the in_whitelist decorator into an in_whitelist_check and making the in_whitelist deco simply use this check. Then we also use that check in the moderation/management.py's cog_check function, asking it to check that anyone using this cog has a moderator role, is in one of the moderation channels, or is in any channel inside the ModMail category.

The...

ebon magnetBOT
#

Build 20200527.1 succeeded

Requested by

GitHub

Duration

00:01:20

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!

regal archBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: remove\_avatar\_hash
ebon magnetBOT
#

Build 20200527.1 succeeded

Requested by

GitHub

Duration

00:02:42

Build pipeline

Site

regal archBOT
#

I'm probably missing something here, but why did you add these? I'm a bit surprised that this error code would pop-up here (unless PyFlakes does not understand allowed_strings with arguments) and I can't reproduce it locally with our linting set-up and these noqa's removed.

        infraction_id: t.Union[int, allowed_strings("l", "last", "recent")],
        duration: t.Union[Expiry, allowed_strings("p", "permanent"), None],
#
[python-discord/bot] New branch created: stop\_sending\_avatar\_hash
ebon magnetBOT
#

Build 20200527.2 failed

Requested by

GitHub

Duration

00:01:07

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200527.3 succeeded

Requested by

GitHub

Duration

00:01:22

Build pipeline

Bot

regal archBOT
#

Other than that, just a general observation: The "in_whitelist" check/decorator combo is slowly taking over the locations where we currently use in_channel. I know that there was some initial resistance to the idea, but I think we should consider unifying it across the code base to make things consistent.

Ah yeah, I was gonna do this. I think this PR is a good time to do it, too, so I'll commit a fix a little later today removing in_channel and replacing all instances of it with `in_wh...

#

Without knowing how exactly the Redis Cache will be used, this may be a bit hard to predict, but do you have a general estimate of how frequently the caller might attempt to increment a key that doesn't exist? If it's expected to be reasonably often, it may be worth releasing the lock immediately after the if value is None: check.

However, if this is more for API safety and it's expected that the caller will be using a key that definitely exists 99% of the time, it's probably fine as it is.

#

I would suggest also having a test_increment_concurrent() to ensure it's actually safe from race conditions. It should be okay with the current lock implementation, but to actually test for it I'd advise something like the following:

await self.redis.set("test_key", 0)
tasks = []
# Feel free to adjust the count if needed
for _ in range(100):
    task = asyncio.create_task(
        self.redis.increment("test_key", 1))
    tasks.append(task)

await asyncio.gather(*tasks)
v...
#

We're going to merge a PR that includes a relock soon-ish, right?

It would make more sense to document this in that PR so it's clear why this was changed, but it feels a bit like creating a lot of work (removing it here, adding it back in another PR).

Do you know which PR is merging that version upgrade? It'll be good to keep an eye on if it ran a full lint over the entire code or just the files changed. If the latter, it may create confusing linting errors for future contribs, as linti...

ebon magnetBOT
#

Build 20200527.4 succeeded

Requested by

GitHub

Duration

00:01:25

Build pipeline

Bot

regal archBOT
#

do you have a general estimate of how frequently the caller might attempt to increment a key that doesn't exist?

There is no reason this should ever happen outside of the local environment. If someone wrote a feature that did this, we would probably catch it during review and prevent it from ever being merged. This feature won't be directly exposed to users (at least, I really don't think it should be), so in my opinion this should practically never happen.

regal archBOT
#

@kwzrd

My approach would have been to make sure the cache is cleared before each test (probably in the setUp), but I don't require that this is done.

I agree that it would make sense to clear the cache in between tests, otherwise it ends up being somewhat subject to side effects from previous tests and can lead to inconsistent results depending on the order the tests are executed in (which is typically something to avoid).

ebon magnetBOT
#

Build 20200527.5 succeeded

Requested by

GitHub

Duration

00:03:17

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200527.6 succeeded

Requested by

GitHub

Duration

00:02:28

Build pipeline

Bot

ebon magnetBOT
#

Build 20200527.7 failed

Requested by

GitHub

Duration

00:01:14

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200527.8 succeeded

Requested by

GitHub

Duration

00:18:57

Build pipeline

Bot

regal archBOT
regal archBOT
#

So, I think the overall approach (tracking names that are used with a boolean and setting everything to used=False when you run out) is the right approach. However, I don't think I see any need for this to be a parameter. This should just be the way that it always works. Why would we ever want to return names in any other way than this?

Additionally, making this change would require a change on the bot side to make use of this new optional param.

Please refactor this so that this new ro...

#

d9190d9 Refactor the in_whitelist deco to a check. - lemonsaurus
b51c206 Allow infraction management in modmail category - lemonsaurus
d310f42 Find + change all InWhitelistCheckFailure imports - lemonsaurus
7562262 No redirect for mod management. - lemonsaurus
c3cbc84 Allow some commands to fail checks silently. - lemonsaurus

#
[python-discord/bot] branch deleted: moderation\_commands\_in\_modmail\_category
north knotBOT
ebon magnetBOT
#

Build 20200527.9 succeeded

Requested by

GitHub

Duration

00:04:32

Build pipeline

Bot

oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200527.10 succeeded

Requested by

GitHub

Duration

00:02:19

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200527.13 succeeded

Requested by

GitHub

Duration

00:02:10

Build pipeline

Bot

regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200527.14 succeeded

Requested by

GitHub

Duration

00:02:15

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200527.15 succeeded

Requested by

GitHub

Duration

00:02:06

Build pipeline

Bot

regal archBOT
#

I don't know if I agree. This kind of testing is very brittle. I don't really like the idea that changing a string should fail a test, especially for a project like a community bot.

Fair enough. I mostly come from experience w/ the exception messages remaining static for long periods of time (if not forever), so the string for the exception message changing isn't an issue.

The custom exception classes are another good approach, and I'd say it probably makes more sense in this case sin...

regal archBOT
#

I think there's a bit of an issue with relying on await self.bot.redis_ready.wait() after the redis session is closed in Bot.close(). Specifically, when the bot calls self.redis_ready.clear(), it sets the condition to False, and with how Condition.wait() works, it could end up indefinitely suspending the coroutine while waiting for the condition to be set to True. This would be an issue if _validate_cache() was called during or after Bot.close().

I'm not overly concerned about ...

regal archBOT
ebon magnetBOT
#

Build 20200528.1 failed

Requested by

GitHub

Duration

00:01:56

Build pipeline

Site

#

Build 20200528.2 failed

Requested by

GitHub

Duration

00:01:58

Build pipeline

Site

ebon magnetBOT
#

Build 20200528.3 failed

Requested by

GitHub

Duration

00:01:55

Build pipeline

Site

north knotBOT
#

Postgres backup completed!

ebon magnetBOT
#

Build 20200528.4 succeeded

Requested by

GitHub

Duration

00:02:19

Build pipeline

Site

regal archBOT
ebon magnetBOT
#

Build 20200528.5 succeeded

Requested by

GitHub

Duration

00:02:16

Build pipeline

Site

ebon magnetBOT
#

Build 20200528.1 succeeded

Requested by

GitHub

Duration

00:02:24

Build pipeline

Bot

regal archBOT
#

When we add the bulma-related JS scripts and the CSS stylesheets into the , we don't enable any kind of deferment or preloading.

This means that sites using django-simple-bulma are taking a performance hit, because these are render-blocking resources.

To fix this, these should be inserted with async and preloading parameters so that they will not block the loading of the page itself.

#

Here are actual actionable points:

Don't load unused Bulma Extensions

Currently, we're not defining the extensions key in our BULMA_SETTINGS config dict. This means that all Bulma extensions are being loaded, which is stupid because we're not using any of them afaik.

To solve this, just add extensions=[] to BULMA_SETTINGS.

Off-site asset loading has bad caching policies

We're loading a few assets from off-site - the Django logo from djangoproject.com, and some cod...

regal archBOT
ebon magnetBOT
#

Build 20200528.2 succeeded

Requested by

GitHub

Duration

00:02:22

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: redis\_persistence
north knotBOT
ebon magnetBOT
#

Build 20200528.3 succeeded

Requested by

GitHub

Duration

00:05:10

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
north knotBOT
#

Postgres backup completed!

regal archBOT
ebon magnetBOT
#

Build 20200529.1 succeeded

Requested by

GitHub

Duration

00:03:03

Build pipeline

Bot

regal archBOT
#

@ Reviewers:

Discussion has taken place in #dev-contrib where we have agreed to use the on_message event. The reasoning is that we do not intend to moderate inactive users. Alert spam / repetition should be prevented by internal logic & caching.

This should explain the discrepancy between @ks129's latest comment on the issue & the implementation as seen in this pull request.

Discord jumplink.

regal archBOT
#

You can save yourself a call to Redis if you just get the value and abort if it gives None.

Keep in mind that this event will fire for every message sent in the guild, so if we can avoid the superfluous Redis call, we probably should. In fact, it would likely make more sense to poll Redis if and only if a match is found (L153).

In other words, instead of:

  1. See if an alert can be sent for given user (regardless of nickname)
  2. If so, analyse author name

We can do:

1...

regal archBOT
ebon magnetBOT
#

Build 20200529.2 succeeded

Requested by

GitHub

Duration

00:02:02

Build pipeline

Bot

ebon magnetBOT
#

Build 20200529.3 succeeded

Requested by

GitHub

Duration

00:02:43

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] New branch created: sebastiaan/help\-channels/ratelimits
#

Discord has introduced new, strict rate limits for editing the names and topics of individual channels: You may only change the topic/name twice per 10 minutes per channel.

Unfortunately, our help channel system frequently goes over that rate limit as it edits the name and topic of a channel on all three "move" actions we have: to available, to occupied, and to dormant. In addition, our "unanswered" feature adds another channel name change on top of the move-related edits.

That's why I...

ebon magnetBOT
#

Build 20200529.4 succeeded

Requested by

GitHub

Duration

00:02:21

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] branch deleted: sebastiaan/help\-channels/ratelimits
north knotBOT
ebon magnetBOT
#

Build 20200529.5 succeeded

Requested by

Joseph Banks

Duration

00:04:03

Build pipeline

Bot

oak estuaryBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: staff\_count\_server
ebon magnetBOT
#

Build 20200529.6 succeeded

Requested by

GitHub

Duration

00:02:24

Build pipeline

Bot

regal archBOT
ebon magnetBOT
#

Build 20200529.7 succeeded

Requested by

GitHub

Duration

00:04:10

Build pipeline

Bot

north knotBOT
oak estuaryBOT
regal archBOT
regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200529.9 failed

Requested by

GitHub

Duration

00:01:54

Build pipeline

Bot

regal archBOT
#
[python-discord/bot] New branch created: remove\_periodic\_ping
#

This will count #:BIG RED CIRCLE: verification :BIG RED CIRCLE: as a public channel, which it is, I guess; just not for actual members of our guild. I doubt anyone is going to do a manual count and compare the numbers, though.

On a more serious note: One reason this may fail in the future is if we decide to cherry-pick which channels we want to showcase in Discovery. When changing the permissions over, I thought about that, but decided to postpone such a discussion. I think just leaving...

ebon magnetBOT
#

Build 20200529.11 succeeded

Requested by

GitHub

Duration

00:02:17

Build pipeline

Bot

regal archBOT
regal archBOT
ebon magnetBOT
#

Build 20200529.12 succeeded

Requested by

GitHub

Duration

00:02:35

Build pipeline

Bot

north knotBOT
ebon magnetBOT
#

Build 20200529.13 succeeded

Requested by

GitHub

Duration

00:04:00

Build pipeline

Bot

oak estuaryBOT
regal archBOT
ebon magnetBOT
#

Build 20200529.14 succeeded

Requested by

GitHub

Duration

00:02:07

Build pipeline

Bot

ebon magnetBOT
#

Build 20200530.1 succeeded

Requested by

GitHub

Duration

00:02:27

Build pipeline

Bot

#

Build 20200530.2 succeeded

Requested by

GitHub

Duration

00:02:18

Build pipeline

Bot

north knotBOT
#

Postgres backup completed!