#dev-log

1 messages ยท Page 10 of 1

oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: remove\_muted\_role
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: remove\_muted\_role
oak estuaryBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

We'd need to define the python versions statically somewhere at any rate, so we can actually define them in the dockerfile. We might be able to get away with an image that has all python versions already so we don't need to specify them, but that would require an external image most likely. I linked an example in the original issue, but that is no longer maintained.

On a more general level though, I'm not sure arbitrary binaries is the best approach. Different binaries would require differ...

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: fix\-ci
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: rule\_update
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: client\-id\-is\-now\-application\-id
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: enable\-sentry\-profiling
odd spireBOT
regal archBOT
#

The docs say "The profiles_sample_rate setting is relative to the traces_sample_rate setting.", which I guess would mean we get 25% of profiling events with this?

I also wonder whether this will work properly without hooking into discord.py to create transactions e.g. for messages/commands (https://docs.sentry.io/platforms/python/performance/instrumentation/custom-instrumentation). From what can guess from the docs, it may be that thi...

odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

I do quite like in-file constants for cog specific stuff, they're really easy to add/change, and only really make sense along with their usage anyway, so it's quite nice to have everything together for quick reference when writing code.

For durations the annoying thing is that it's hard to configure to use a shorter duration for testing in development (so you don't have to wait 45 days to see if it works :P). You have to change it and then change it back before commits.

Overall I don't ...

#

For durations the annoying thing is that it's hard to configure to use a shorter duration for testing in development (so you don't have to wait 45 days to see if it works :P). You have to change it and then change it back before commits.

That is actually the only thing that I find annoying.

Let's leave them here then, it's not something we got to work on / change / test that frequently anyway.

#

The test failure looks interesting, seems to be here:

https://github.com/python-discord/bot/blob/395e058c52ebc718f7c0c9acec710c71f45d7b38/tests/_autospec.py#L53-L54

not surprising since it seems like that was intended to be a private method.
Maybe replacing it with pkgutil.resolve_name will fix it? (python/cpython#18544)

I had actually forgotten about this PR.
I'll try to look into the option you proposed.

one oth...

regal archBOT
odd spireBOT
regal archBOT
#

9cb0c71 Bump coverallsapp/github-action from 1.2.4 to 2... - dependabot[bot]
ef64124 Replace removed path-to-lcov option with new i... - ChrisLovering
a2e2c96 Merge branch 'main' into dependabot/github_acti... - Xithrius
090fcec Merge pull request #907 from python-discord/dep... - Xithrius

odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: enable\-sentry\-profiling
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: update\-partners\-mention
odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/site] New branch created: events\-app\-readme
odd spireBOT
regal archBOT
#

Sure thing.

I have some questions that come off the bat

It may be redundant since the status could be determined by doing a query for the most recent action. Furthermore, an expired infraction could be determined by comparing expired_at to the current time. However, in both cases, using the status field is faster and more convenient.

Why would we query the most recent action here ? Wouldn't it depend also on the type of action executing ?

Meaning, if I mute someone, the mute inf...

regal archBOT
#

Why would we query the most recent action here ? Wouldn't it depend also on the type of action executing ?

Yes. What I likely meant is to query for the most recent action filtered by type. To check if an infraction is active, we can query for actions filtered by that infraction's ID and by action types that would affect the status. For example, if we just queried the most recent action, we may get an action for editing the description, and we'd be unable to deduce the status. Thus, we'd ...

#

The test failure looks interesting, seems to be here:

https://github.com/python-discord/bot/blob/395e058c52ebc718f7c0c9acec710c71f45d7b38/tests/_autospec.py#L53-L54

not surprising since it seems like that was intended to be a private method.

Maybe replacing it with pkgutil.resolve_name will fix it? (python/cpython#18544)

Yeah, this is intended to be like [this](https://github.com/python/cpython/blob/3.11/Lib/unittest/...

regal archBOT
#

The most flexible system would be statically defined sets of configurations

I agree, and we want to leave the door open for that in the future.

Different binaries would require different configurations, be that resources, mounts, or permissions.

This is true, but not always. It is feasible for a single NsJail config to support multiple binaries (though it can only have one default entry point I think).

We'd need to define the python versions statically somewhere at any rate...

regal archBOT
#

Hi, thanks for the feature request, and the offer to implement it! I'm not familiar with what the security implications are for allowing access to its own process. I have several questions regarding this request.

First, what uses cases are we supporting by allowing access to this? If we're going to be making the default sandbox less strict, we need to have good reason to take on the potential risk. We're aiming to provide a sandbox with sane, secure defaults. Bear in mind that it is possib...

regal archBOT
#

It is feasible for a single NsJail config to support multiple binaries (though it can only have one default entry point I think).

This is true, but we can probably just avoid defining a default entry point in the first place. That's more or less what this PR does for python.

It seems simpler and more intuitive to create an NsJail config, which effectively defines an environment, and have everything in that environment be available via the API.

My problem is it moves the burden of...

regal archBOT
odd spireBOT
regal archBOT
#

Let me start off by explictly saying that I think an expires_at column is also needed for the actions table.
The current timestamp column should only state when the action was executed for historical purposes, and we obviously need to record the nex expiration date, if provided.

We could also add a jump_url like we currently have for infractions, in case someone needs more context on what happened, etc.

In retrospect, we likely need the status column anyway for use in indices.
...

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: drop\-pyfakefs
#

Create a temporary directory to manage our resource tests instead of reyling on pyfakefs to mock it away for us. This also makes the code more portable: all we need now is a way to create a temporary directory. pathlib mostly abstracts away the other parts for us. Since we're well-behaved, we clean up the temporary directory at the end of the Python interpreter's life using atexit and shutil.rmtree.

This PR was written and tested with Python 3.9 which required some hacks in `pyprojec...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

I'm still reading, but before anything I'd like to put aside the matter of voiding. It's a new type of action that requires separate discussion (it was discussed several times in the past and has been a bit controversial), and seems out of scope for this redesign. With the right design, adding a new type of action should be fairly simple anyway.

regal archBOT
#

A few questions that come up to me while looking at the schema:

  • When the bot queries an infraction, will it automatically get all of the actions? in the current design, without changing the serializer the bot would need to query once for the infraction, and a second time for the infraction actions.
  • How do you know the order of the actions? do you need to sort by timestamp in either the site or the bot?

To address both of these it might make sense to have an array field in the infract...

odd spireBOT
regal archBOT
#
  • When the bot queries an infraction, will it automatically get all of the actions? in the current design, without changing the serializer the bot would need to query once for the infraction, and a second time for the infraction actions.

That actually just depends on what we want to do, it's a matter of changing the serializer here. I imagined it'll only query the infraction, and each infraction that has gone through edits will have a flag saying it did. And then we can just query all th...

odd spireBOT
regal archBOT
#

it's a matter of changing the serializer

It can be a matter of changing the serializer, I was wondering if we could do it differently. But alright, I understand your answer.

The values that have been edited will be clear in the row (it's either reason or expiration date anyways) since the ones that didn't will be null

This doesn't align with the example you gave afterwards. In the example each action contains the reason and expiration so far, rather than the new values th...

regal archBOT
#

This doesn't align with the example you gave afterwards. In the example each action contains the reason and expiration so far, rather than the new values they were changed to. Meaning that if you didn't edit the reason, then the action will contain the reason of the previous action.

Forgive me, but I'm not sure how you're seeing that.
Here's the action table

Action Actor Reason Expiration Timestamp
create shtlrs reason1 exp...
regal archBOT
#

Ok, looks like I mixed up the table of actions and the table after that which showed the infraction after the corresponding action. Forget most of what I said.

But we're going back to the reason why I said we can't use this approach: A null expiration already has a meaning. It means the infraction was made permanent. So in the table in your latest comment, the third row is invalid.

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

It should be done by adding reverse_sql="ALTER TABLE api_filter DROP CONSTRAINT unique_filters" kwarg to the RunSQL instance.

The reason I'm asking this is because when testing locally, and then wanting to move to a different branch to test something else, you'll need to apply migrations up until some version prior to yours, which will result in a
django.db.migrations.exceptions.IrreversibleError

This is ok to happen locally, as you can always drop the container & spin up a new ...

regal archBOT
regal archBOT
#

The follwing are highlights of the different approaches Zig and I had discussed, which started [here](#dev-contrib message).
@mbaruh will correct me if i'm wrong on any of these points.

Having null values in the actions table isn't a good idea. As that leads to a loss of context/meaning. Example: We make a permanent infraction, we make it non permanent (we set the value for expiration_date), and then make it permanent a...

regal archBOT
#

Can you elaborate?
I was mostly thinking of a trigger at the db level upon insertion / update to the infraction table.

We also discussed this in chat, and seemed to agree that it'll be more natural to do something like editing and deactivation by POSTing a new action, which will make the site make the right change in the infractions table.

#

I also see that the topic of whether to use an ID as the primary key in the actions table, or some combination such as infraction ID and timestamp.

One thing I envisioned we would be able to do with these changes is to resend an earlier version of the infraction. For example, if we added internal context to the infraction reason, we would be able to use !infraction resend to resend the original reason without the added context, by specifying the action which created the desirable version...

regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

There's a difference between the technical & the functional terms, even though you're stating the correct technical term, it's not guaranteed that people would recognize it.

When people use the commands, they don't know it as "prefix-based" commands. A slash command is a slash command (even though technically they're based on interactions), and the prefix based command is just "command", or "text command" (even though they're based on the command prefix)

It's fine to leave it is now, b...

#

e.original is only present for app_commands.CommandInvokeError iirc. Also the cause is the original statement that caused the error, eg:

# this happens internally somewhere(not in a transformer or a command)
raise ValueError("a is smaller than b")

The cause will be returned as "a is smaller than b".

The only times it retuns None is when you explicitly raise an app_command error.

regal archBOT
#

First, what uses cases are we supporting by allowing access to this? If we're going to be making the default sandbox less strict, we need to have good reason to take on the potential risk. We're aiming to provide a sandbox with sane, secure defaults. Bear in mind that it is possible to use a custom config for one's own snekbox instance.

The main use case of this (and really all that it would allow it to do) would be to allow a process to dynamically access/analyze information about itsel...

odd spireBOT
regal archBOT
#

Why not put this atexit register right after the directory is created. This would ensure it is run only once, and also run even if the tests weren't run for some reason (e.g. selectively running tests possibly?).

Alternatively it may make more sense to move the tempdir to the test setup function, so it is only called when the tests are run. (could also use a tempfile.TemporaryDirectory which has a cleanup method instead of needing to rmtree but should be the same so doesn't matter).

regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

oak estuaryBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#

Sentry Issue: BOT-3EZ

Forbidden: 403 Forbidden (error code: 90001): Reaction blocked
(2 additional frame(s) were not displayed)
...
  File "bot/decorators.py", line 143, in inner
    ) -> None:
  File "bot/exts/utils/snekbox/_cog.py", line 583, in eval_command
    await self.run_job(ctx, job)
  File "bot/exts/utils/snekbox/_cog.py", line 541, in run_job
    job = await self.continue_job(ctx, response, job....
odd spireBOT
regal archBOT
#

Sure, I was referring to the case when we'd raise an app command error explicitly. As I said before, I don't like raising a TextCommand error from within a slash command context

The cause should be present when an exception if raised from another.

try:
    raise ValueError("initial")
except ValueError as e:
    raise KeyError("second") from e

when you catch that later,

try:
    ...
except KeyError as e:
    print(e.__cause__)
    # this will print: initi...
regal archBOT
#
[python-discord/bot] New branch created: wookie184\-botstrap\-error
odd spireBOT
regal archBOT
#
Traceback (most recent call last):
  ...
  File "C:\Users\wookie\Documents\GitHub\bot\botstrap.py", line 158, in 
    webhook_channel_id = int(all_channels[webhook_name])
KeyError: 'big_brother'

Not worked out exactly what this is yet, although we should probably handle it and raise a clearer error/warning. fwiw this was me trying to run botstrap on my old test server, but I decided to just make a new one and it worked perfectly :D

#

This error is, in part, a usage error. The bootstrap script is not intended to support old or random configurations, but to work from well-defined states. Itโ€™s trading off the maximum possible utility, with simplifying the program greatly.

To that end, I went through and manually updated the staff test server to make it fully compatible, and updated the template to make sure it works as expected. Weโ€™re also currently working on adding a sort of migration system to make sure you always have...

regal archBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

At least one of our unit tests in the content apps seems to make requests to GitHub while it runs. When running multiple times, for instance when retrying tests after issues, this will cause 403 errors to appear. This also affects CI pipelines: https://github.com/python-discord/site/actions/runs/4515801023/jobs/7953504322?pr=916
When ratelimited, two other tests, will also log some form of "Could not find GitHub repository metadata from response!".
We should ideally mock away these HTTP req...

odd spireBOT
regal archBOT
regal archBOT
#

This defaults site_paste to our production pastebin as i don't think no one will ever host their own pastebin service. And this moves it to BaseURLs

Same goes for site_logs_view, however this one can be overriden if people want to access logs from their local sites. So it'll be included in the guide as an optional section to work with mod logs.

After the previously mentioned changes, site and site_schema aren't needed anymore, so need for the useless config.
site_staff isn'...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: drop\-pyfakefs
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: events\-app\-readme
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
#

LGTM, tested and seems to work.

Two test warnings are raised due to this:

bot-hu2rt1Uv-py3.11\Lib\site-packages\feedparser\encodings.py:29: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi

The issue tracking that is https://github.com/kurtmckee/feedparser/issues/330, it seems it was already fixed (https://github.com/kurtmckee/feedparser/commit/ed8c762286aa1d8a248a6900190bd02c01ac2f8d) and is just waiting on a release.

bot-hu2rt...
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
#

I wish I could put it in the modal, but the lengths of everything are pretty limiting. The title and any labels are up to 45 chars, placeholder strings are up to 100. I can make the description the default value but then people will need to delete it every time they want to input a value, which seems bad. I'll see if I can come up with something decent.

regal archBOT
#

So this is how it looks like when I only display overrides:
image
Like I mentioned, it feels like it makes editing more difficult, since you don't know at first glance what it is that needs to be overridden. To do that you will also need to pull up the filter list defaults embed, but then the whole process takes even more space.


This is what happens when I ignore all false-y v...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

@HassanAbouelela did you mean that we shouldn't do anything at all, or that we shouldn't try and handle the case fully (e.g. making the channel if it doesn't exist)?

I agree it's a usage error and we shouldn't try handle the case fully. I think the specific error was because I didn't have a channel with the correct name, so here it would make sense to raise a warning like with other things, so it's clear that it's not working due to a user error rather than a script error.

#

I think it's of limited utility to try and handle/warn on this case, considering it mostly occurred due to migrating from a legacy server. Someone not following the guide at all and starting with a completely blank server would get a different error, and someone starting from the guide won't get an error, it's only this shrinking subset of migrating users that would experience the error.

We're best of exiting the program at this point anyway instead of warning and powering through since misc...

regal archBOT
#

Ok, it seems I missed the mark. Is this about exposing the filters in this dictionary? https://github.com/python-discord/site/blob/main/pydis_site/apps/resources/views/resources.py#L68

Yeah I think that's the idea.

Currently if the !resources command is given an argument e.g. !resources web development, the link will filter the topic by web development (links to https://www.pythondiscord.com/resources/?topics=web-development). This would potentially allow fuzzy matching for topics...

#

There is quite a lot of code for the message relaying (in https://github.com/python-discord/bot/blob/main/bot/exts/moderation/watchchannels/_watchchannel.py), so there's some benefit in having it separate to avoid having one very large cog, maybe merging them could work though, having the QoL/util functions sounds like a good reason.

I think making it having an expiry was something that was brought up a while ago as a good idea, although it might be worth discussing it again so we're sure ...

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/site] New branch created: add\-home\-app\-readme
odd spireBOT
regal archBOT
regal archBOT
#

Relevant Issues

Closes #1198.

Description

Replaced all instances of "with ctx.typing()" to "async with ctx.typing() to comply with discord.py's v2.0 changes.

Did you:

odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: wookie184\-botstrap\-error
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
#

My problem is it moves the burden of knowing what binaries are available on the API from the project (which can reasonably control the matter) to the user (which can not directly affect it).

I don't necessarily see that as a problem. I've seen snekbox as primarily an internal service for which users build their own front ends. Thus, the users are in control of both, and they will be aware of what is available in the snekbox environment. It'd be a different story if the snekbox API was di...

odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: update\-base\-iamge
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/site] New branch created: add\-home\-app\-readme
odd spireBOT
odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: Update\-base\-image
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
oak estuaryBOT
regal archBOT
#

The APIError exception (as per the docstring) is for when "an external API returns an error message". Since this isn't an error returned by the API, I didn't opt to use the exception.

If we do want to use it, what should the status_code argument be? 200? The error handling for it also seems pretty bare (doesn't actually use the .error_msg or .status_code).

odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: fix\-1121
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

It's been a while since this discussion was active but i really like the idea. I just tested everything but for me there seems to be a problem when snoozing a timer for the second time. I get the option to snooze again and when i click it I can also select for how long i want to snooze but then it says "This interaction failed". Did this happen to any of you as well?

EDIT: The problem seems to be that once the first reminder is finished and you click snooze the second reminder is aut...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: fix\-2492
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] New branch created: add\-readme\-to\-redirects\-app
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

In general I would avoid renaming variables if not required because:

  • It's not related to the PR (the name existed already), and slows down the PR if someone disagrees with the change.
  • It causes merge conflicts with other PRs (I have one open I think).
  • Variable names are personal preference, I prefer site_api which is why I used it when I wrote the code.

I don't think it improves clarity (site_api.get reads most fluently and clearly to me), so while I agree it's not a big issue...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Sentry Issue: BOT-3F4

HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In name: Contains words not allowed for servers in Server Discovery.
  File "bot/exts/fun/off_topic_names.py", line 66, in update_names
    await channel_1.edit(name=OTN_FORMATTER.format(number=1, name=channel_1_name))

Unhandled exception in internal background task "update_names".

The blocked word was "swallow...

odd spireBOT
regal archBOT
#

What do we actually want to happen when this occurs?

We can't prevent this from happening in the first place (the list of blocked words isn't public), so any action has to be reactive (i.e. try/except) as opposed to proactive (not allowing adding of the name to the pool).

I imagine a log.warn() stating that it attempted to rename but failed because the name "contains words not allowed for servers in Server Discovery", and then re-rolling would be sufficient?

regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
thin oysterBOT
#
Sir Robin

Connected!

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: helper\-role
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: helper\-role
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: helper\-role
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] New branch created: lesser\_yellow
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: helper\-role
oak estuaryBOT
regal archBOT
#

Relevant Issues

Update the color list to include the new helper yellow color.

<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->

Description

Did you:

odd spireBOT
regal archBOT
#
[python-discord/sir-lancebot] branch deleted: lesser\_yellow
#
[python-discord/sir-lancebot] New branch created: lesser\_yellow
#
[python-discord/sir-lancebot] branch deleted: lesser\_yellow
#
[python-discord/sir-lancebot] New branch created: lesser\_yellow
#

Relevant Issues

Add new helper role color to color list

<!-- Link the issue by typing: "Closes #" (Closes #0 to close issue 0 for example). -->

Description

Did you:

odd spireBOT
regal archBOT
regal archBOT
regal archBOT
#

@shtlrs

For the indexes, would it be a good option to have 2

Did you mean that it doesn't make sense ? Since later on you state that keeping them separate is awkard.
In any case, this won't affect the main schema in the end, so we can start with the implementation once we agree on it then we can add necessary indexes for optimization.

Sorry, I quoted the wrong thing. I meant to quote the following:

I'm in favor of merging the active & void columns into a status one.

regal archBOT
#

After some more conversation it might make more sense to go with option 3. It will give us more control over the information and make migrations saner.

I'm also in favour of option 3. I'm not totally against JSON, but it's something I'd have to give more thought to. Initial impression is that using JSON data can be an anti-pattern for relational database depending on how we need to use/query that data.

I'm assuming this new field will be a boolean field, e.g. is_permanent (if you ha...

#

The main use case of this (and really all that it would allow it to do) would be to allow a process to dynamically access/analyze information about itself.

Do you have any specific use cases in mind? How is a process being able to access information about itself useful?

the access could be limited to only certain parts of the /proc/[pid]/ directory if we want to be absolutely sure of safety/security

I'm more comfortable starting with this, and leaving the door open to expanding ...

regal archBOT
#
[python-discord/site] New branch created: improve\-performance
#

One problem that is often mentioned with the Python Discord website is the slow
performance of endpoints, and the huge file structure that comes with cloning
the site causing problems on antiquated platforms such as Windows.

This pull request aims to fix it. The index page can now sustain up to 35731
requests per second on my machine. The confusing directory structure in
pydis_site is removed. As a bonus, virtual environments are no longer
required, as our new build tool manages dep...

odd spireBOT
regal archBOT
#

I'm fine with the idea, it's just that we need to be picky about the names since they expand real quick to become confusing.
We had it at site before, and it got people & me [confused](#dev-better-config message) when it came to usage.

I agree with you on the fact that it makes sense to have a base url, and only that needs to be configurable, as I also didn't like having to configure that long url if i ever wanted to use s...

odd spireBOT
regal archBOT
regal archBOT
#
[python-discord/bot] New branch created: update\_ping\_cooldown
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: update\_ping\_cooldown
oak estuaryBOT
regal archBOT
#
[python-discord/bot] New branch created: ruff\-investigation
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
oak estuaryBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: swfarnsworth/ping\-on\-thread\-close
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
#

@MarkKoz An alternative could be an expiry_edited field. It might be a bit redundant when the expiry is edited to a new date, but when the expiry is set to null, this field would then be true if the null means "permanent" or false if it was just not edited at all. But if we go with this direction it would probably be one of those three options, as awkward as they may be.

regal archBOT
#
[python-discord/bot] New branch created: newlines\-filter\-exclude\-help\-forum
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: new\-helpers\-end
odd spireBOT
regal archBOT
#
[python-discord/bot] branch deleted: new\-helpers\-end
oak estuaryBOT
regal archBOT
regal archBOT
#

This code seems quite complex, given this is balancing quite a lot of different aims/constraints I think we'd benefit from having some tests for this.

I'm also not sure the complexity is really worth it, a simple solution that replaces the current logic and fixes the linked issue would be something like this:

def truncate(text, max_lines, max_chars):
    # Make the truncation message
    lines = text.split("\n")
    reason = []
    if len(text) > max_chars:
        reason....
regal archBOT
#

Deactivating a name sets a column in the database to indicate it as inactive, rather than fully removing it. Deactivated names can't be chosen as ot names. IIRC this feature was added to prevent a name being re-added if it was removed, and so it can still be looked at in the future if wanted (you can !otn list deactivated).

I'm not sure about a warning with log.warn, since it isn't something core devs can/should do anything about. I'd prefer a message in a mod channel somewhere (possib...

#

Would checking the error.code and ignoring when it's 90001 (reaction blocked) be an adequate solution to this? That way we prevent both the sentry alert and the message saying to contact staff (or can even send a custom message).

If we're concerned about it suppressing other things we can always ensure we create a log message as part of the handling.

Were you thinking this would go in the global er...

regal archBOT
#

Deactivating a name sets a column in the database to indicate it as inactive, rather than fully removing it.

Ah, I see. That sounds good then, yes.

I'm not sure about a warning with log.warn, since it isn't something core devs can/should do anything about. I'd prefer a message in a mod channel somewhere

Makes sense, I think a message to mod-meta for good visibility works in-place of a log.warn (given, as you said, the low frequency of occurrences it will have).

Can I please ...

regal archBOT
regal archBOT
#

@wookie184

  1. Never have more than max_chars characters in the final output
  2. Never have more than max_lines lines in the final output
  3. Have as many lines/chars as possible in the final output

For the record, none of these are fulfilled in the old code (that's currently in main). All three of these are fulfilled by my new code, so it does meet the necessary criteria.

This code seems quite complex

I've added some images showing before vs after for different scenarios to...

regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
regal archBOT
#
[python-discord/bot] branch deleted: snekbox\-3\.11\-default
regal archBOT
regal archBOT
regal archBOT
#

@mbaruh

but when the expiry is set to null, this field would then be true if the null means "permanent" or false if it was just not edited at all.

I'm not sure I follow what you mean by if the null means "permanent" here, isn't that what null always signifies for an expiry ?

How would this work when the expiry changes, but to a valide date time ? It would be confusing for it to be true since that's the value we'd use for permanent infraction changes as well if I understood y...

odd spireBOT
regal archBOT
odd spireBOT
night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#

Do you have any specific use cases in mind? How is a process being able to access information about itself useful?

It's the most useful thing, in that almost everything you could do using it you could do via similar already allowed means, but there are some things like /proc/[pid]/fd/ and /proc/[pid]/fdinfo/ which are not only benign but provide information which is hard to find elsewhere.

I'm more comfortable starting with this, and leaving the door open to expanding it in the f...

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

The !resources command accepts an optional argument to specify the resource topic in the URL. For example, !resources data science will result in the following link: https://www.pythondiscord.com/resources/?topics=data-science

However, there is no difference in the embed (other than the hyperlink itself) to indicate that a topic has been specified. I propose that when a topic is specified, it will be added to the title of the embed, like "Resources for: Data science".

(I would l...

regal archBOT
#

The resources command currently does no validation for the given argument. There is this new issue https://github.com/python-discord/bot/issues/2510, which I think is very reasonable, but I would rather the bot didn't spit back arbitrary strings given by the user (both for the correctness of the provided URL and from a moderation perspective). I think that's already a solid use case for this feature.

night lilyBOT
#
Sir Lancebot

Connected!

odd spireBOT
oak estuaryBOT
odd spireBOT
oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/bot] New branch created: vivek/mod\-edit\-log\-embed\-jump\-url
odd spireBOT
odd spireBOT
odd spireBOT
oak estuaryBOT
regal archBOT
odd spireBOT
odd spireBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: new\-filter\-schema
#
[python-discord/bot] branch deleted: new\-filters
odd spireBOT
oak estuaryBOT
odd spireBOT
odd spireBOT
regal archBOT
#
[python-discord/site] branch deleted: filters\_fix