#dev-contrib

1 messages · Page 178 of 1

vale ibex
#

oh as in i didn't realise .set still used the deco

vale ibex
#

this is very weird

wild prism
#

glad to hear it, spent the last two days feeling crazy

vale ibex
#

I've managed to get it to work once

#

no idea why

#

steping all the way through it seems fine

wild prism
#

you should double check my boilerplate if you haven't, I'm new to redis

#

that's one more than I got

vale ibex
#

I ruled out the lock fwiw

#

took that out sicne it was annoying to step through all the time

#

getting same issue

wild prism
#

was the success after that?

vale ibex
#

the success seems to be whenever I step into the redis call

#

sec I'll show

molten perch
#

You got it figured out?

#

I did, just asking.

mellow hare
#

Carry on

molten perch
gritty wind
#

It’s deprecated but still used under the hood for backwards compatibility as I understand

#

It’s part of why I bumped to 1.0

slow boneBOT
#

This is not a Modmail thread.

surreal veldt
#

So at the time of the message I am replying to, I did the git fetch and git pull commands, and it updated my local files.
But now again the main repo was updated and I pressed fetch upstream on github, and then in vscode I did ```
PS C:\Users\tenuk\ModMail-FAQ> git pull origin
Updating 509795c..e439064
Fast-forward
classes/dropdown.py | 18 +++++++++++++-----
classes/topics.py | 50 ++++++++++++++++++++++++++++++++++++++------------
main.py | 47 ++++++++++++++++++++++++++++++++++-------------
3 files changed, 85 insertions(+), 30 deletions(-)
PS C:\Users\tenuk\ModMail-FAQ>

Even though i did this, my local files don't show the updates
gritty wind
#

Are you on the same branch?

surreal veldt
#

can you remind me how to check that please?

#

if it's git branch, that shows master

#

i did git fetch origin and git pull origin . Should i replace origin with master?

gritty wind
#

Origin is correct

#

Could you link your fork

surreal veldt
gritty wind
#

Everything looks correct

#

Do you have changes locally

surreal veldt
#

Does this help?

gritty wind
#

Stash it before pulling

surreal veldt
#

is that just git stash?

gritty wind
#

Yeah

surreal veldt
#

it said No local changes to save

surreal veldt
#

oh wait

gritty wind
#

Try to do git stash -u

surreal veldt
#

I jsut realized that the original repo author duplicated a file topics.py and moved one of them to the classes folder, leaving one out (at least locally that's what I see)

austere hornet
wild prism
#

this isn't a modmail thread

austere hornet
#

I know that lol, I was just confused why Modmail sent that

surreal veldt
#

I think there are commands specific to ModMail channels and if you use it in another channel it'll send that message

austere hornet
#

Right so you think someone ran a Modmail command and deleted the command usage?

#

That would make sense actually

austere hornet
#

Anyways, let's get on topic

wild prism
#

are there any blockers to using modals in our bots?

vale ibex
#

Nope, just that they don't support much atm

#

afaik only select fields can be in modals

wind ruin
wind ruin
wild prism
wind ruin
#

iirc "views" are a discord.py concept that refers to message components in a normal chat message
"modal" is a term used by discord to refer to actual modal popup windows

winter bone
#

Hi. I am a python dev with few months of experience. I am looking to volunteer for startups/ new ideas. Dm me if you are interested working with me.

jolly parcel
#

I am looking to contribute to Snexbox possibly. Is there anything that needs to be done, has been requested, or is being worked on that I could assist with?

cold island
brazen charm
jolly parcel
gritty wind
# jolly parcel the file IO seems like the most interesting to me atm

Fwiw a lot of snekbox will just be trying to figure out what techniques you can use, discussing them, and getting them approved, more than actually writing code. More than any of our other projects

If you’d like to work on it, go through the issue history, and leave a comment with what you’d like to do

vocal wolf
#

@obtuse arrow Hello. What is your status of these PRs? bot#1940, bot#1941

gritty wind
#

Require CPR lol

wild prism
#

i have what i think is a strange question:
yesterday my redis container for sir-robin was named sir-robin_redis_1
today it is named sir-robin-redis-1
....why?

cold island
#

Uuuh did you update anything?

wild prism
#

not that I know of

#

and as far as I can tell im starting them in exactly the same way

gritty wind
#

Last time docker updated it was in January, is your install just really out of date :D

#

Either that or the latest version reintroduced a regression, but it’s not listed yet

vale ibex
gritty wind
#

(Related to an older discussion: it’s specifically a regression in docker compose vs docker-compose)

#

Yup

wild prism
vale ibex
#

might have done docker compose once and then the image names have stuck if you didn't do down

#

EG you did docker compose the first time creating the container and docker-compose since

#

it'll retain the hyphens

wild prism
#

if you do up --build does it retain the container names?

vale ibex
#

yea afaik

#

would be easy to test though

#

I can't atm

wild prism
#

hmm maybe i used docker compose at some point yesterday, but literally

Set-Alias -Name "dc" -Value "docker-compose"
```is in my profile
gritty wind
#

Alias docker-compose to the space version and you’ll never have issues again 😋

gritty wind
#

Lmao

vale ibex
#

I'll stay on my deprecated v1 branch

gritty wind
#

I just learned v1 is written in python while looking this up

vale ibex
#

yea dude

gritty wind
#

We need to revert

#

Downgrade all our composes plz and thx

vale ibex
#

version number is irrelevant anyways, it's only for backwards compat

#

it's ignored in latest versions of compose

wild prism
#
- Set-Alias -Name "dc" -Value "docker-compose"
+ Set-Alias -Name "dc" -Value "docker compose"
```because dashes are slightly easier to type
vale ibex
#

lol

gritty wind
#

👌

gritty wind
#

Pycharm's docker interpreter support is simultaneously some of the most amazing and janky shit I've ever seen

#

Making it work is impossible, but when it does work

#

It's oh so sweet

cold island
#

anything in pycharm related to docker and ssh is like that

#

I'm using VSC for the sole reason that I can't be assed to make ssh work properly in pycharm

molten perch
#

You run the projects on an external server? 😄

gritty wind
#

It’s snekbox

#

And good luck running that anywhere lol

cold island
#

how do I rebase one commit at a time? like I have 5 commits I want to rebase, and I want to take one at a time and adjust it to the new base

wild prism
#

like cherry-picking?

gritty wind
#

Do an interactive rebase and set everything to edit

cold island
#

Yeah I think interactive is what I'm looking for

thorny obsidian
#

@brazen charm Question for you re:tag group + improvements stuff: Are the supported tag metadata found anywhere else besides the __init__ in the Tag class in tags.py?

From the PR I see you implemented embed and restricted, but I'm not sure if I'm missing any others.

brazen charm
#

I don't believe any others are used. It should all be in the class for the tag so if it's not there, it's unused

surreal veldt
#

Can the docs command support the fishhook library?

placid ermine
#

apart from the readme

#

which makes sense because there's like 2 public functions

outer oasis
outer oasis
#

Can I get some feedback on sir-lancebot#1070 ?
I literally just stole the implementation from !remind

dusky shoreBOT
vale ibex
#
text = text or getattr(ctx.message.reference, "resolved", None)
if text is None:
    raise commands.UserInputError("Your message must have content or you must reply to a message.")
``` would this work instead?
#

I came across that logic when i was refactoring the bookmark cog myself

#

sir-lancebot#1049

dusky shoreBOT
vale ibex
#

speaking of, @timid sentinel I have only now seen your suggestion. should I commit this to that branch or were you planning to pr that yourself?

outer oasis
#

I can give it a shot

vale ibex
#

getattr(None, "foo", False) would return False

#

so getattr(ctx.message.reference, "resolved", None) either returns ctx.message.reference.resolved if present, or None

outer oasis
#

I see

#

Can you give me a quick summary of Scale's comment on the issue?
I get the idea but I don't know how to actually call clean_content on a str

#

Oh hi Scale

gritty wind
#

The general way converters work in d.py

#

They are classes

#

So you just call await clean_content(settings).convert(ctx, str)

#

But it will raise exceptions

#

I think you can safely let them propagate though

vale ibex
#

Would ```
t.Optional[clean_content(fix_channel_mentions=True)] = None

#

I've never tried it 😅

gritty wind
#

Possibly, but it won't fix the reply content

outer oasis
#

Let's find out

#

Nevermind then

vale ibex
#

ah yea true

gritty wind
#

Jinx

vale ibex
#

I instinctively started typing out a mute

#

then stopped myself kek

gritty wind
#

Lmao

#

No one would be able to stop you 👀

vale ibex
#

@thorny obsidian would have words though

thorny obsidian
#

lemonshake I may not be an admin anymore but my wrath has not waned

outer oasis
vale ibex
#

yea

outer oasis
#

👍

vale ibex
#

raise commands.UserInputError("...") works because we have a global error handler that deals with this error and handles it nicely

outer oasis
#

Hmmm

#
sir-lancebot    | 2022-07-09 15:04:03 | bot.exts.core.error_handler | ERROR | Unhandled command error: expected string or bytes-like object
sir-lancebot    | Traceback (most recent call last):
sir-lancebot    |   File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
sir-lancebot    |     ret = await coro(*args, **kwargs)
sir-lancebot    |   File "/bot/bot/exts/fun/uwu.py", line 123, in uwu_command
sir-lancebot    |     await clean_content(fix_channel_mentions=True).convert(ctx, text)
sir-lancebot    |   File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/converter.py", line 945, in convert
sir-lancebot    |     result = re.sub(r'<(@[!&]?|#)([0-9]{15,20})>', repl, argument)
sir-lancebot    |   File "/usr/local/lib/python3.9/re.py", line 210, in sub
sir-lancebot    |     return _compile(pattern, flags).sub(repl, string, count)
sir-lancebot    | TypeError: expected string or bytes-like object
#

I ducked up the clean_content

gritty wind
#

Where did you put it?

outer oasis
#
text = text or getattr(ctx.message.reference, "resolved", None)
if text is None:
  # If we weren't able to get the content of a replied message
  raise commands.UserInputError("Your message must have content or you must reply to a message.")

await clean_content(fix_channel_mentions=True).convert(ctx, text)
vale ibex
#

Ah, yea getattr(ctx.message.reference, "resolved", None) will return the message, not the message content

gritty wind
#

For a second I though I’d have to admit I have no idea what I’m doing

#

But Chris with the save

vale ibex
#

getattr(ctx.message.reference, "resolved.content", None) might work

#

no idea if getattr can do a second level like that

#

I'm guessing not

outer oasis
#

guess not

#

not it's not seeing it

#
getattr(getattr(ctx.message.reference, "resolved", None), "content", None)
```?
#

Seems to work

vale ibex
#

yea, just a little complicated for one line lol

outer oasis
#

Yeah
Back to the original and just leave it there then?

vale ibex
#
text = text or getattr(ctx.message.reference, "resolved", None)
if text is None:
  # If we weren't able to get the content of a replied message
  raise commands.UserInputError("Your message must have content or you must reply to a message.")
elif isinstance(text, discord.Message):
  text = text.content 

await clean_content(fix_channel_mentions=True).convert(ctx, text)
#

maybe the other way around ```py
text = text or getattr(ctx.message.reference, "resolved", None)
if isinstance(text, discord.Message):
text = text.content

if text is None:

If we weren't able to get the content of a replied message

raise commands.UserInputError("Your message must have content or you must reply to a message.")

await clean_content(fix_channel_mentions=True).convert(ctx, text)

outer oasis
#

How does it look now?

vale ibex
#

looks good

outer oasis
#

👍
Then unless there's anything else I need to do, I declare my services fulfilled

vale ibex
#

hah thanks, I'll give it a test once i've sorted metricity

gritty wind
#

Does the converter cause issues when it raises exceptions?

#

If not, I think we should be good 👍

outer oasis
vale ibex
#

try to uwu a role ping

#

or channel ping

gritty wind
#

Lmfao

outer oasis
#

But after using Chris' snippet, I get pretty errors

gritty wind
#

@everyone uwu

outer oasis
gritty wind
#

Hahaha that's perfect

vale ibex
#

lol nice

gritty wind
#

I wonder what happens if I reply to an image

vale ibex
#

it should error

vale ibex
outer oasis
#

Should hit the "no text provided" UserInputError?

vale ibex
#

ye

wild prism
#

why are we not uwuifying images???

gritty wind
dusky shoreBOT
#

it's w-why i swapped these a-awound wow

gritty wind
outer oasis
gritty wind
#

lmfao just put an uwu over it

outer oasis
#

Also - Just to confirm, there's no issues with me creating branches directly on the repo, [as opposed to forking] right?

gritty wind
#

Yeah

#

Uhh

#

Where would one put a new route in the site api

#

These all seem to be views

#

Oh I think I figured it out

thorny obsidian
#

I'm going to write a changelog for this and no one can stop me

thorny obsidian
gritty wind
#

Can I make an HTTP request within an api view method in DRF? It's really hard to look up info because of the name conflict...

#

I did find one SO post which just said use requests (the library), does that cause issues

vale ibex
#

Take a look how the github stats are done on the homepage

#

That should be similar

gritty wind
#

It's a request with a custom timeout

#

Is the timeout necessary?

vale ibex
#

Yea, otherwise it'll block the worker

gritty wind
#

I feel like the solution here is to not use requests

#

I've seen that DRF supports async views, and I had already upgraded to httpx for other reasons 👀

vale ibex
#

beyond my paygrade with drf lol

#

httpx good

vale ibex
#

bot-core#98 tiny bug fix

dusky shoreBOT
gritty wind
#

Lighting fast

#

Feel free to merge

#

(once actions are done)

vale ibex
#

tyty

vocal wolf
#

@fallen patrol Hello. sir-lancebot#982 sir-lancebot#981 questionmark?

fallen patrol
#

the second one was just supposed to be a retrofit, i didn't want to modify much of the original author's code

#

updated the first one

gritty wind
#

Mark you're good to merge snekbox#147

dusky shoreBOT
gritty wind
#

Thanks for accommodating my messed up needs lol

tawdry vapor
#

ty for reviewing

gritty wind
#

😎

#

Still waiting for poetry to fix an ancient bug to add support for poetry versions 😔

vale ibex
#

sad

#

metricity#18 includes quite a large refactor, I've added (what I think to be) some useful instructions for people who get some time to test it out :)

dusky shoreBOT
gritty wind
#

Lmfao

vale ibex
#

lol I was getting worried why it was taking so long

#

time to add .cache to the ignore

#

casual 170k line flake8 output

gritty wind
#

Normal friday

#

It is Saturday

#

Do we not need the flake8 annotations action anymore?

vale ibex
#

shouldn't do, since it's a dev dep

gritty wind
#

Oh cool

#

Btw you crashed my browser

#

Thanks

vale ibex
#

not entirely sure what it was doing fwiw

#

it isn't in any of our other linting flows

#

and i didn't add annotations as a dev dep in this pr

gritty wind
#

Chris chris chris

#

It doesn't start

#

Please fix

slate gorge
vale ibex
slate gorge
vale ibex
#

I was referring to flake8-annotations, please read the context.

gritty wind
#

They are already there :D

slate gorge
gritty wind
#

What are we talking about

vale ibex
#

are you using docker?

gritty wind
#

Lol dw it's the dpy update bug

vale ibex
#

oh lol

#

get good

gritty wind
#

Could we get dotenv

vale ibex
#

no

slate gorge
#

just came to ask a question, could i clone the repos for my own bot?

gritty wind
#

Thanks

vale ibex
#

use docker

#

thanks

vale ibex
slate gorge
#

great

vale ibex
#

don't get too annoyed

#

ty

gritty wind
#

Lmao

#

Pycharm used to have a really nice plugin to auto-load them

#

But it stopped getting updatees 😔

#

Wait I know what my next project is 🌝

vale ibex
#

wait, it's already here

gritty wind
#

Lmao

#

I bet if you git blame, it's gonna be me too

vale ibex
#

yea, it's a prod dep lol

gritty wind
#

I wonder what's up with my thing

vale ibex
gritty wind
#

Thank

#

Oh I refreshed my token because of discord's stupid token thing

#

Lmao big brain

vale ibex
#

lol

gritty wind
#

Alright, I've managed to start the bot

#

That's a good sign, approved

vale ibex
gritty wind
#

before vs after. Is this code optimization?

vale ibex
#

i fixed

gritty wind
#

Oh cool we're doing voice channels now?

vale ibex
#

yeyeyey

#

the main reason I did metricity now

#

@viscid badge doesn't like text-in-voice right now

stable mountainBOT
#

metricity/exts/event_listeners/_utils.py line 39

if not await models.Thread.get(str(thread.id)):```
gritty wind
#

When would this be true

#

Shouldn't the listener catch it

vale ibex
#

iirc this was a fix in case the message event was handled before the thread create event

gritty wind
#

Cool cool

#

How long have you been working on this

#

There's so much stuff

vale ibex
#

just moved to Cogs

gritty wind
#

Yeah my review strategy is copy the old content in and see the diff 🤡

vale ibex
#

ah lol

#

there's a few small changes in there, but it's mostly copy-paste

gritty wind
#

But no, I rather meant there's a bunch of hidden small stuff like that

#

Ye ye

stable mountainBOT
#

metricity/exts/event_listeners/message_listeners.py line 30

if message.type in (discord.MessageType.thread_created, discord.MessageType.auto_moderation_action):```
vale ibex
#

it's easy to test too

vale ibex
gritty wind
#

Alright, I think that's everything

vale ibex
#

Yea, I was right, it's not needed, since I also guarded against that in the on_message listener

gritty wind
#

Sick

vale ibex
#

can also remove ```py
if from_thread and not message.channel.parent:
# This is a forum channel, not currently supported by Discord.py. Ignore it.
return

gritty wind
#

Doesn't it make more sense to do the opposite to avoid forcing a blocking sync

vale ibex
#

since they are supported now

#

wdym do the opposite?

gritty wind
#

As in, don't handle thread creation in on_channel_update, and instead handle it in on_message

vale ibex
#

thread creation has it's own event

gritty wind
#

Oh

vale ibex
#

it's just that it also sends a message event

gritty wind
#

No I mean the event generates a full sync

vale ibex
#

since the thread opener is also the first message in the thread

gritty wind
#

As opposed to the message which just syncs the thread

#

Ultimately it's fine, I don't think the sync is that long

vale ibex
#

yea, the standard seemed to be sync everything when a new channel is created

#

so I did the same for threads

gritty wind
#

Alright, that's fine

vale ibex
#

pushed a commit to remove those two guards

gritty wind
#

How on earth did my suggestion auto resolve itself haha

#

Noice, that looks good

#

Dude the linting is lighting quick

vale ibex
#

yea it's nice

gritty wind
#

PR cache 💪

vale ibex
#

I'm gonna add concurrency rules to the workflows too

#

pushed

gritty wind
#

I'm approving, if you're happy with it, you're welcome to merge

vale ibex
#

guess we'll find out

gritty wind
#

Lol

vale ibex
#

lol just noticed the deploy action doesn't wait for the lint action

#

very nice

gritty wind
#

We never merge bad code to metricity

vale ibex
#

@viscid badge status

gritty wind
#

Give it a minute

vale ibex
#

ye

gritty wind
#

Docker desktop updated it's UI

#

It's so shit

vale ibex
#

@viscid badge status

viscid badgeBOT
#
Status

Hello, I'm Dave. I insert all your data into a GDPR-compliant database.

Command processing time

31156.927 ms

Last event received

<t:1657406233>

Discord API latency

9355.926 ms

#
Status

Hello, I'm Dave. I insert all your data into a GDPR-compliant database.

Command processing time

3808.356 ms

Last event received

<t:1657406233>

Discord API latency

9355.926 ms

vale ibex
#

nice

gritty wind
#

Yeee

#

31000 ms

#

Top notch dev-ops here

vale ibex
#

got that dialup

molten perch
#

Hey 👋 , if anyone is interested sir-robin#49 is waiting for reviews. It's not that big, most of the things were ported over from bot, and were tested previously.

dusky shoreBOT
vale ibex
#

will take a look tomorrow

gritty wind
#

The site test suite took ~4 minutes to run

#

Then pycharm reported it as 8s

#

Thanks pycharm

vale ibex
#

very good

#

pycharm is fast

#

just look at the performance tests!

green oriole
#

Hey funny devops men

#

Where is graphite data being pushed to?

#

Is it all stored by graphite?

#

I see it has a PVC

vale ibex
#

Yea, graphite stores it

gritty wind
#

Hm, well I've spent some time getting pytest working

#

Well, it does, but it still takes 1:14 minutes

#

Even with no migrations

#

To be fair, it's creating 8 databases lol

gritty wind
#

I've gotta go to bed here, but in the mean time I'll drop my latest issue here. I've more or less setup pytest on site, but I'm having issues with the migrations.

If I completely disable them, the tests which test the migrations fail. If I enable them, they seem to run twice. I'm not sure how it's managing to bypass django's safety checks. I know for sure it's definitely migrated after the first time. I can open the database, and browse it. The migrations table is set correctly, and it's all there.

Running the migrations twice however is problematic, since the migrations make normally safe assumptions that we can't guarantee anymore

#

If it means anything, it fails on/after migration 47, and complains that:

    sql = 'SELECT DISTINCT "api_user"."id", "api_user"."name", "api_user"."discriminator", "api_user"."avatar_hash", "api_user"....raction"."active" AND "api_infraction"."type" = %s) GROUP BY "api_user"."id" HAVING COUNT("api_infraction"."id") >= %s'
params = ('ban', 2), ignored_wrapper_args = (False, {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x0000018EE7EB4430>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x0000018EE92727F0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
>               return self.cursor.execute(sql, params)
E               django.db.utils.ProgrammingError: column api_user.avatar_hash does not exist
E               LINE 1: ...", "api_user"."name", "api_user"."discriminator", "api_user"...
E                                                                            ^

green oriole
#

Would it be possible the manage.py and the tests each run them?

gritty wind
#

The manage would've just been calling the django runner anyway, but the pytest integration bypasses the manage anyway

surreal veldt
#

@brisk brook would you have an update on site#702?

surreal veldt
#

site#702 *

dusky shoreBOT
gritty wind
brisk brook
vale ibex
#

metricity#20 fairly small pr

dusky shoreBOT
outer oasis
vale ibex
#

guess it was just never added

gritty wind
#

Our smaller projects don't use them

vale ibex
#

it does require 1 member to approve before merging

gritty wind
#

Because the builtin tools work better

gritty wind
#

So uhhhh who understands how the site's migration tests work 👀

#

Some of these use the current model, and a historical model at the same time, which creates conflicts when any fields are added or removed

#

Yet it works somehow

#

But bumping django from 3.1 to 3.2 breaks it

#

For reference, this stuff has not been touched since 2019 lol

#

I found the PR that introduced this: site#278

dusky shoreBOT
gritty wind
#

Since a migration is really snapshot in time of the migration history, this also allows us to work with the database models as they were at those two time points in the migration history (directly before and directly after applying this migration), since otherwise these tests will fail in the future if we decide to change the models.
This must be no longer true

cold island
#

migration tests?

gritty wind
#

We have some tests that ensure that a migration worked as expected

#

Which is... kind of strange considering migrations are historical and unchanging

#

To test the effect of the migration file, I've created a subclass of django.test.TestCase, MigrationsTestCase, that reverts the test database to the migration just prior to the one of interest. We can then inject test data, apply the migration, and test if the migration had the desired effect.

molten perch
#

And this test breaks when bumping to 3.2? What's the error?

gritty wind
#

The latest (current) model introduces a field, which did not exist at the time of this migration. In theory according to the comment above, this shouldn't matter because we are only using the model at the provided migration. This was true on django 3.1. For whatever reason though, bumping to 3.2 has made it so that when the test itself runs, it is using the latest model.

#

The weirdest part though

#

The creation of the object itself is done before the test starts, and that's created correctly. But for some reason between the setup function and the test itself, it has updated the model, and somehow updated the old objects

#

The exception itself isn't super useful here, as it show's what's wrong, not the root cause, but here it is:

Failure
Traceback (most recent call last):
  File "C:\Users\hassa\AppData\Local\pypoetry\Cache\virtualenvs\site-xCgAncD9-py3.9\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedColumn: column api_infraction.dm_sent does not exist
LINE 1: SELECT "api_infraction"."id", "api_infraction"."dm_sent" FRO...

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Github\PyDis\site\pydis_site\apps\api\tests\migrations\test_active_infraction_migration.py", line 451, in test_migration_leaves_user_with_one_active_ban_untouched
    x = model_to_dict(infraction)
...
  File "C:\Users\hassa\AppData\Local\pypoetry\Cache\virtualenvs\site-xCgAncD9-py3.9\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column api_infraction.dm_sent does not exist
LINE 1: SELECT "api_infraction"."id", "api_infraction"."dm_sent" FRO...
#

I've omitted a bit of the traceback (the portion which goes into django internals), but the rest of the cropping (FRO...) is what the traceback actually looks like

cold island
#

It also has tests for the tests

gritty wind
#

It's tests all the way down baby

cold island
#

We never added anything beyond the tests for that specific migration

gritty wind
#

I'm contemplating just... removing them

#

These are the same tests which seem to be breaking my pytest work too

cold island
#

We can ask for Sebastiaan's opinion tomorrow, but yeah I am too

molten perch
#

I'm currently checking out the release note for 3.2, to see if I can find something

gritty wind
#

Btw, I tested to make sure

#

site is on 3.1.14

cold island
#

Are we switching to pytest? 🤔

gritty wind
#

Initially I jumped to the last 3.2, because django's versioning guarantees it doesn't change on minor versions

#

But I've tested with 3.2.0 to make sure

#

And it has the same problem

gritty wind
# cold island Are we switching to pytest? 🤔

Well, I haven't discussed it, I was just doing a cost assessment first. It's not a full-fledged pytest migration either, it's just switching to use the pytest runner with our unittest tests

#

We usually see a nice performance boost by switching to pytest (and changing nothing else), and then we get access to plugins like xdist which give an even larger boost

cold island
#

ok

tawdry vapor
#

Migrations don't modify the model. They only affect the database schema. Pretty sure that has always been the case with Django

gritty wind
#

You are technically correct

#

Yet it's still being modified

#

And not just the model, but instances of it too, which were created before the migration

#

I've gone ahead and printed the concrete_fields of the instance that is causing the issues:

# 3.1
(<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: inserted_at>, <django.db.models.fields.DateTimeField: expires_at>, <django.db.models.fields.BooleanField: active>, <django.db.models.fields.CharField: type>, <django.db.models.fields.TextField: reason>, <django.db.models.fields.BooleanField: hidden>, <django.db.models.fields.related.ForeignKey: actor>, <django.db.models.fields.related.ForeignKey: user>)  # Setup
(<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: inserted_at>, <django.db.models.fields.DateTimeField: expires_at>, <django.db.models.fields.BooleanField: active>, <django.db.models.fields.CharField: type>, <django.db.models.fields.TextField: reason>, <django.db.models.fields.BooleanField: hidden>, <django.db.models.fields.related.ForeignKey: actor>, <django.db.models.fields.related.ForeignKey: user>)  # Test

# 3.2
(<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: inserted_at>, <django.db.models.fields.DateTimeField: expires_at>, <django.db.models.fields.BooleanField: active>, <django.db.models.fields.CharField: type>, <django.db.models.fields.TextField: reason>, <django.db.models.fields.BooleanField: hidden>, <django.db.models.fields.related.ForeignKey: actor>, <django.db.models.fields.related.ForeignKey: user>)  # Setup
(<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: inserted_at>, <django.db.models.fields.DateTimeField: expires_at>, <django.db.models.fields.BooleanField: active>, <django.db.models.fields.related.ForeignKey: user>, <django.db.models.fields.related.ForeignKey: actor>, <django.db.models.fields.CharField: type>, <django.db.models.fields.TextField: reason>, <django.db.models.fields.BooleanField: hidden>, <django.db.models.fields.BooleanField: dm_sent>)  # Test
#

What you're looking for here is the model change in 3.2-test

#

For the sake of curosity, I also printed it after the migration, but before the setup function ended
It's the same as the setup on both versions

tawdry vapor
#

It's unclear how to use the historical versions

gritty wind
#

Lol I remember looking into that when Chris was removing a field needed in a migration

#

I came to the same conclusion

#

But I think this is unrelated to what our issue is
I think because it's unclear what that even is

tawdry vapor
#

Maybe using get_model instead of importing?

gritty wind
#

We are using get_model

tawdry vapor
#

In the tests?

gritty wind
#

Yeah

#

Hmm, I've checked the instances, not the model themselves. Not sure if those have changed too

molten perch
stable mountainBOT
#

pydis_site/apps/api/tests/migrations/base.py line 36

def setUpTestData(cls):```
molten perch
#

Just a suggestion though.

gritty wind
# gritty wind Hmm, I've checked the instances, not the model themselves. Not sure if those hav...

I've done that now:

Setup                   ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Base pre-migration      ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Base post-migration old ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Base post-migration new ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Test original           ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Test new                ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']

It does not change at any point, just the instances do

gritty wind
molten perch
#

Sorry, setUpClass

molten perch
gritty wind
#

So what am I changing

#

Well, that's done it for some reason

#

For some of the tests, some still fail

#

These are all due to the test_base tests though, which need to be rewritten, so I'll figure that out

#

The question now is whether we take the win and forget about this, or continue thinking about removing them

#

Looks like we won't get to make that decision, since setupClass terminates our database connection once it's done, which then fails everything else

hoary haven
#

@tawdry vapor @trim cradle is something supposed to be added to the yaml resource file or is everything supposed to "just work"
this is how it looks, no padlock icon or anything

molten perch
hoary haven
#

i'm guessing it should be fa-lock-alt or something. will test

gritty wind
#

That would run migrations on every test, which is... slow to say the least

tawdry vapor
hoary haven
#

it was a paid icon so fa-lock-alt doesn't render either. i went with fa-solid fa-lock
can i learn how to rebase this branch?

outer oasis
hoary haven
#

i forget which branch rebases "on" to which

#

or merge commit, idc either way

outer oasis
#

Sorry, that was bigger than intended

tawdry vapor
outer oasis
tawdry vapor
#

If you want a rebase then change git merge to git rebase

#

I guess just to update with commits from main?

hoary haven
#

PR was just saying it was out of date, but looks like stel took care of it

molten perch
outer oasis
#

I think it does actually use rebase, but all you have to do is push the button

tawdry vapor
#

I think it's always a merge

#

Actually, you get a choice

outer oasis
#

oh
I'm wrong again

tawdry vapor
#

But it is a merge by default

hoary haven
#

i just heard the update w/ rebase button for sure has surprising effects, i think

#

okie, i don't know how to get this OK to merge now though lumi_aww is it the netlify stuff?

outer oasis
hoary haven
#

no it behaves distinctly differently in the github ui, last i saw..

outer oasis
#

I apologized!

warm vigil
#

You do what you want on your repo. I'm not a fan of rebasing esp on repo with a ton of other people working on it. It's a history rewrite and that may drive others insane.

gritty wind
#

We tend to allow rebases before and after reviews

#

During reviews it can be annoying as you've said

hoary haven
#

thanks Mark! i guess my review didn't count

tawdry vapor
#

The netlify stuff is broken at the moment in any case

tawdry vapor
gritty wind
outer oasis
gritty wind
#

Normally Mina would be right, but right now due to the issues, the netlify check is allowed to fail

#

Under normal circumstances, we usually require all checks to pass

hoary haven
#

hm, this PR does not fall under content change rules?

outer oasis
hoary haven
#

here's a 🍪

outer oasis
#

And the check is now green

outer oasis
tawdry vapor
#

Yes anyone could go on GH and view it

#

It's already public is what I am trying to say

outer oasis
#

Right right, I think you have to be a member of the org to actually see the page itself
But the same information is already available in the review-policy.yml anyways

tawdry vapor
hoary haven
#

hm i suppose it's fine, it's a python file and has some code in it

#

so say hypothetically i start a branch/PR that gets a bit old, or take over a stale PR whose branch is out of date. can't i do something to make that branch be "caught up" to the commits from main?

#

i thought that's what rebasing was (mostly) for

outer oasis
outer oasis
hoary haven
#

why not just git rebase main ?

tawdry vapor
#

Rebasing is primarily useful for cleaning up your history. You could also use it instead of a merge, but it's not the only use case.

#

If you try git rebase -i <commit-sha> you will see there are lots of things you can do

outer oasis
# hoary haven why not just `git rebase main` ?

Because that rewrites history
Merging creates a new commit(s) that add on the new changes, while rebasing actually changes which commit your branch started from to pretend it actually started somewhere else

hoary haven
#

yeah i'm familiar with rebasing while in the 1 branch

#

not so much btwn branches

outer oasis
#

Lots and lots of git people are purists and absolutely hate changing things

#

But it's with reason

#

When you pull someone else's changes and all of a sudden git says it can't process something because your commits don't exist anymore, it can cause issues

hoary haven
tawdry vapor
#

In the context of a PR it can cause GitHub to hide old reviews, or at least that used to be the case

#

It just makes it confusing for a reviewer

hoary haven
#

i see

tawdry vapor
#

I don't really care so much because the ship sailed long ago of keeping the history perfectly clean

#

So merge commits don't bother me

#

Also if you rebase and you're not the author of the commits, it will add you as a co-author (at least through GH; if you use commands and you really want to you can avoid that)

hoary haven
#

yeah that's what i was going to attempt

#

one more question, i edited the PR's original message to link meta#185 and meta#180 but github only linked to 185. is there a way to link #180 after the fact?

dusky shoreBOT
gritty wind
#

In the side bar of the issue, you can link the PR, then close it

#

Specifically under Development

hoary haven
#

dunno how to do that cross-repo

patent pivot
#

the sidebar only allows you to do same repo yea

#

fixed it

gritty wind
#

In that case, just link it in a comment and close

patent pivot
#

it's not pretty

#

but it worked

hoary haven
#

oh just separate lines?

outer oasis
#

AFAIK they can be on the same line

patent pivot
#

you can do same line yea

#

last line of this

outer oasis
#

But you can't do closes #156 #157
It has to be closes #156 closes #157

patent pivot
#

yea

outer oasis
#

Which is annoying

#

Feels like it'd be pretty easy to let us do that

patent pivot
#

yea

#

at the very least supporting commas or just adjacent issue nums

gritty wind
#

Anyone have thoughts on testing abstract models?

#

Instantiating them is undefined behavior in django, and it's explicitly disallowed in 3.2

#

From what I'm reading, you wouldn't test it in isolation anyway because you'll be testing it's inheritors

#

(The model is Message, and the only place it seems to be used is DeletedMessage)

tawdry vapor
#

i wouldnt bother keeping the tests

#

or at least transfer them to a concrete class

gritty wind
#

I've pushed something for now to make sure nothing has broken yet, but I still need to keep bumping the django version a bit longer

gritty wind
dusky shoreBOT
static canyon
#

I've been looking for an easy issue to implement so that I get back into contributing to bot, and stumbled across bot#2168.

I see someone else was already assigned (donmonc) but it's been 2 months since then with seemingly no activity on the matter, so may I take over?

dusky shoreBOT
gritty wind
broken topaz
#

what do you guys do to read a env yaml file?

gritty wind
#

env yaml file?

#

This seems like it's conflating two things. I think our only project which uses yaml configs is bot, and in that we load a dotenv file into the environment using python_dotenv. We have a YAML constructor which pulls keys from the environment

broken topaz
#

seems confusing to me

#

but why not just use pyamlenv

#

?

gritty wind
#

Because the first version was released in mid-2021, while the constructor has existed for 4 years

#

Regardless, I'm not in favor of adding dependencies without good reason. It's another thing that makes maintenance harder, compared to 30 lines of code that haven't changed in 4 years

hoary haven
#

it was gonna be his first foray into our projects so just wanna check with him

thorny obsidian
#

How do we feel about moving all the d.py related tags under the discord tag namespace?

outer oasis
#

What about a discord_bots namespace?

thorny obsidian
#

It would look like this:

vale ibex
#

do tag groups support aliases?

#

typing discord_bots each time seems annoying

outer oasis
#

Okay, "DiscordBots", so the spacing doesn't duck it up like people do with polls

thorny obsidian
cold island
#

I'd still prefer discord for brevity

outer oasis
#

I would put things directly related to Discord's UX in there
But I don't think we actually have anything for that

wild prism
#

are they all about dpy, or discord api in general?

vale ibex
#

they all seem d.py related, based of the tag names

thorny obsidian
#

Looking through those related tags they're all d.py related, none are about the discord api itself

outer oasis
brazen charm
#

the group is still fuzzy matched so a longer name shouldn't be a big problem

thorny obsidian
#

yeah, with the discord_bots namespace, discord as a group name works fine for pulling it up

vale ibex
#

sounds good then

outer oasis
#

If it'll fuzzy match, we could use Discord Bots as a more astec - astehc - asctech?

#

aesthetically, thank you Google

wild prism
#

huh i was gonna guess asstech

vale ibex
#

not sure how spaces would work

outer oasis
#

That parts a given

thorny obsidian
outer oasis
#

Yeah, no, fuck that

#

DiscordBots it is

gritty wind
#

I need to con an admin-core dev into reviewing site#740

dusky shoreBOT
gritty wind
#

@vale ibex is my go to

#

It's a pretty small PR, most of the diff is deleting files :D

vale ibex
#

if you can look at metricity#19 and metricity#20

#

both much smaller

gritty wind
#

Linting passes? Merge ✅

vale ibex
#

lol

gritty wind
#

What's the Projects category

#

Oh found it

vale ibex
gritty wind
#

Thanks

vale ibex
#

what's with this diff?

gritty wind
#

The message model is an abstract model, so instantiating it is undefined behavior

vale ibex
#

ahh cool

gritty wind
#

In django 3.2 it's illegal

vale ibex
#

you're illegal

gritty wind
#

Thanks 🤩

vale ibex
#

that was a pretty easy one to review lmfao

#

there was like 10 lines of actual things to look at

gritty wind
#

Yeah lol

#

It's an evil diff size

thorny obsidian
#

Alright, I think I figured out alt-names for our tag system

vale ibex
#

just duplicate the file

#

easy

thorny obsidian
#

I know I didn't make an issue or get it approved........ but I'm gonna open a PR anyway

vale ibex
#

I wonder how a symlink would work

thorny obsidian
#

I just added this as a metadata feature you can add to specify alt names and then add the alt names as part of the tag dict to search

vale ibex
#

runing on windows host would likely complain

gritty wind
#

So update on the static previews thing

#

I've written most of it as a github app that's managed by django

#

But now the part I didn't anticipate is that there is a portion of the process where we just sit around and wait

#

Original plan was to do this async, since I added httpx, and django 4 has support for async views

#

But not DRF apparently

#

Any thoughts?

#

I could do CF workers, but I'm keeping that as a last resort because it's much nicer on site

outer oasis
gritty wind
#

If the process happens too fast, we can't optimize it in the future

#

Lol it waits for the github build to finish

outer oasis
#

What's wrong with CF Workers?

gritty wind
#

Nothing, it's just that we have way fewer JS devs than python devs

outer oasis
#

Oh right
CF doesn't support Python

gritty wind
#

Why did I write pycharm

#

This is why you don't multitask kids

#

Well, what if I don't make this a DRF view, but just a regular view 🤔

#

It's not using the ORM, or any of the other DRF features

#

Maaaaybe I can get it to work with django's async_to_sync and DRF

outer oasis
#

Damn - I'm going to have to learn Djagno

outer oasis
gritty wind
#

Oh I don't mind explaining, but I'm not too familiar either

#

DRF doesn't support async views though

#

It's a rather new feature in django

#

There's a discussion on the DRF repo, but it's still all tentative

thorny obsidian
#

@vocal wolf with the review of bot#2213 we will be one step closer of allowing you to invoke the new !dashmpip tag with !minusmpip =P

dusky shoreBOT
vocal wolf
#

lol

vocal wolf
thorny obsidian
vocal wolf
#

are you sure pre-commit is installed? That's what usually gets me

thorny obsidian
#

Yeah, it's been installed since forever and I got pissy at it like 2 days ago

vocal wolf
#

hmmmmmmmmm

wild prism
#

my precommit on sir robin was borked somehow and I had to re-poetry install the other day

gritty wind
#

I think that's more or less what the async_to_sync util does

#

It says it runs in a "sub-thread"

vale ibex
#

yea, sounds about right

gritty wind
# dusky shore

Code looks functionally fine, and linting mostly passes, now waiting on the whitespace one lol

thorny obsidian
#

@vale ibex So you're like the local king of interactive rebases. I can do that and rewrite the SHA of commits on a feature branch and it should be fine as long as it hasn't been reviewed or checkout by anyone else, right?

vale ibex
#

Yea, rewriting history like that is fine so long as other people don't have it checked out

#

I do it quite a lot 😅

#

and yea as you said it can mess with github reviews sometimes, so usually best not to do it if there are active comments

static canyon
thorny obsidian
placid ermine
#

oh COME on you didnt seriously add minus m pip lmaooo

thorny obsidian
#

:3c you can blame @dim pelican for that suggestion

vale ibex
#

so when you do a rebase locally, you need to git push --force

#

otherwise it will just do a merge commit in gh :D

thorny obsidian
vale ibex
#

if you wanted to fix, you could do git rebase -i HEAD~7 and drop the 4 commits you don't want

thorny obsidian
#

I'm always a bit terrified everytime I have to use HEAD because I've never not fucked it up. So I just called it a day and let it be

vale ibex
#

fair enough

#

also, with the fstring aliases, does the fuzzy matching not give us that for free?

thorny obsidian
#

The issue is another tag

#

!fstring

stable mountainBOT
#
Did you mean ...

» sql-fstring
» f-strings

vale ibex
#

Ahh

cold island
# stable mountain

What if we made this a dropdown that invokes the command. No idea how smart this is

vale ibex
#

if only you could spawn ephemeral messages from message commands

#

would be even cleaner

#

but that does sound good

thorny obsidian
#

New tags
!dashmpip tag showing how to install things via pip without relying on pip being on PATH.
!regex tag for explaining what regex is and providing some of our favorite resources for testing regex.

Check out all of these tags in #bot-commands ✨

Updates & new features
.uwu got a major facelift scofflaw_chan The new uwu-levels are off the charts. Thanks to LP and Shenanigans for the update and Bluenix, lemon, Senjan, and ToxicKidz for the review.
.uwu will also work if you reply to a message! Thanks to Shenanigans for the change and Chrisjl and Scaleios for the review.
.latex is now allowed in the data science and AI channel and it has amsmath support. Thanks to Chrisjl and Verboof for the changes, and wookie, fix error, and hsp for the reviews.
!charinfo is now allowed in all channels (except for python-general). Thanks Chrisjl for the change and MrHemlock and Mark for the review.
• typing-extensions is now part of snekbox! Feel free to type-hint away~

You can check out what the above commands do in #sir-lancebot-playground as well.


I wanted to changelog .uwu, figure I should changelog everything else that we've done for a bit as well. How does it look? Will replace names with actual pings

vale ibex
#

looks good to me

#

there's a bunch of other things been merged since the last changelog, we should try to catchup

#

dependabot does flood this a little

thorny obsidian
#

So I was planning on not changelogging anything from Sir Robin or Forms or bot-core, just because it's not really ultra user facing like Python or Sir Lance are

outer oasis
placid ermine
#

i too feel important now

wild prism
#

isnt regex old?

thorny obsidian
#

last changelog was timeit command

wild prism
#

lol

thorny obsidian
#

wait, did we ever changelog the uwu-fication update itself?

thorny obsidian
#

lmfao, okay will update my text

thorny obsidian
vale ibex
#

ah lol

thorny obsidian
#

I think I captured everything though at least public user facing

vale ibex
#

a lot of the bot changes are mod speciifc

thorny obsidian
#

I do think we need a mod-specific changelog though

vale ibex
#

we post relevant stuff in mod announcements

thorny obsidian
#

Cause there are a fuckton of improvements and I think some went unnoticed

wild prism
#

wot if we automated generating prompts for us to changelog things

thorny obsidian
placid ermine
#

label on pr pithink

wild prism
#

we could just generate a list of merged PRs and toss out the ones we dont want

outer oasis
#

What part of everything gets a changelog entry do you not understand?

thorny obsidian
thorny obsidian
outer oasis
#

Have an action that runs on merge that sends an even if the merged PR has a label?

thorny obsidian
#

The other hard part is the connection between github username and discord username for non-staff, if we wanted to 100% automate it

thorny obsidian
thorny obsidian
vocal wolf
#

ye

#

I'm wondering what color it should be

placid ermine
#

'tis a momentous decision

thorny obsidian
#

y'all pls.... I was so close to pressing enter on the changelog. Now I have to changelog the tag aliases too ;-;

thorny obsidian
dusky shoreBOT
#

i'm wondewing nyani cowow it shouwd b-be

thorny obsidian
#

Can I get an admin or mod to pull all tag usage from grafana or whatever stats service has that available from the past 6 months?

gritty wind
#

You should be able to see that page for the next hour

#

@sharp charm#6000 I'm working on a resource on site which should redirect to a download URL on github after some processing. Which status code should I use, and would it affect our SEO (I can do it in another way if that's the case)

#

Thanks discord

sharp charm
#

wrong joe

gritty wind
#

Yeah I figured

sharp charm
#

@patent pivot

gritty wind
#

Thanks

#

I literally couldn't bring this discord to find him

#

Went looking for his ID lol

sharp charm
#

ye lol

thorny obsidian
gritty wind
#

Good point

#

I wonder if this is related to the injection attack we had a while back

patent pivot
#

no we are not subdomaining because we removed that

gritty wind
patent pivot
#

uhhhh

gritty wind
#

It's looking like DRF won't even accept that, so I might just return the URL in the body, and handle it in the receiver end

patent pivot
#

pick whatever you feel is most appropriate, we should get a working robots.txt for pythondiscord.com

patent pivot
patent pivot
#

hmmmm

gritty wind
#

I think the table might just be wrong,

patent pivot
#

whhmmm

#

yeah

#

why is graphite spitting out 500s like the US spitting out those golden stimmy checks

gritty wind
gritty wind
#

Is this now or in general

#

Because I'm going crazy on the query console

patent pivot
#

right now

#

ur killing my graphite man what the hell!

gritty wind
#

It's volccy's fault for not stopping me

patent pivot
#

time to fix this live

#

real life fixing this right now real

#

oh

#
11/07/2022 19:13:20 :: [console] Error creating stats_counts.bot.pep_fetches.375: [Errno 28] No space left on device
11/07/2022 19:13:21 :: [console] Unhandled Error
Traceback (most recent call last):
  File "/opt/graphite/lib/python3.9/site-packages/twisted/python/threadpool.py", line 260, in <lambda>
    inContext.theWork = lambda: context.call(  # type: ignore[attr-defined]
  File "/opt/graphite/lib/python3.9/site-packages/twisted/python/context.py", line 117, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/opt/graphite/lib/python3.9/site-packages/twisted/python/context.py", line 82, in callWithContext
    return func(*args, **kw)
  File "/opt/graphite/lib/carbon/writer.py", line 191, in writeForever
    writeCachedDataPoints()
--- <exception caught here> ---
  File "/opt/graphite/lib/carbon/writer.py", line 142, in writeCachedDataPoints
    state.database.create(metric, archiveConfig, xFilesFactor, aggregationMethod)
  File "/opt/graphite/lib/carbon/database.py", line 144, in create
    whisper.create(path, retentions, xfilesfactor, aggregation_method,
  File "/opt/graphite/lib/python3.9/site-packages/whisper.py", line 537, in create
    fh.write(zeroes)
builtins.OSError: [Errno 28] No space left on device

11/07/2022 19:13:21 :: [console] Error creating stats_counts.bot.channels.pythonlogoonrslashplace: [Errno 28] No space left on device
#

lol

#

@gritty wind

vale ibex
#

Lol

#

Time to fight linode to expand the volume

patent pivot
#

let me give this guy a little extra wiggle room

vale ibex
#

Joe I expect every data store to have 8TB dedicated storage

#

Preferably m.2 ssds in raid0

#

Thanks

gritty wind
#

Just save it on the local disk

#

It's not like graphite ever restarts

patent pivot
#

oh

#

huh

#

the vol is 30GB in Linode console, but not in Kubernetes API

#

what's the actual pod saying hmm

gritty wind
#

I can see the preview of the stream, but not the stream itself

patent pivot
#

20GB on system

gritty wind
#

Amazing

patent pivot
#

so just not resized

gritty wind
#

Change the PV :O

vale ibex
#

Lol Yea this is postgres volume all over again

patent pivot
#

shutting down graphite

gritty wind
#

Yeah good riddance, it was bloatware

vale ibex
#

We had to resize the volume manually in the node and then restart the node

gritty wind
#

Does this mean #dev-log is gonna start popping off now

austere hornet
#

I love how Joe is basically screensharing to himself in #dev-voice lmao

patent pivot
#

alright should be fixed

#

no restarts needed because i am sysadmin pro

#

they should give me a medal

#

okay it should be fine now -- but those stats still seem skewwhiff, now that might be because of the storage being fucked but there might be another root cause, so it's something to keep an eye on

#

and we need to go cry to Linode that they really need to expose volume use stats

static canyon
#

So if the storage was only now then there's some other issue I think

patent pivot
#

hmmmm

static canyon
#

I probably sent a message about itsomewhere

#

But maybe not

gritty wind
#

It's not a storage issue, it's a query issue

#

When I pulled it up as a graph, it matched my discord search

#

My lack of understanding of graphite, and my unwillingness to learn it means I can't debug it :D

patent pivot
#

i will take a look™️

#

soon™️

gritty wind
#

We should get the autospec helper from bot added to botcore

#

Would love to have it on site

#

Oh, would we consider having botcore on site, for the non-bot related utilities

#

Petition: rename bot-core to pydis-core, and use it on site :D

tawdry vapor
tawdry vapor
#

Hey, that rhymed.

outer oasis
#

Can I get an issue approval on sir-lancebot#1072 ?

dusky shoreBOT
outer oasis
#

Only the @coredevs are supposed/allowed to add the "approved" label, right?

tawdry vapor
#

Apparently yes. That's what its description states. But I'm not sure if that necessarily needs to be the case.

#

I guess it depends on the scope of the issue so it's easier to just put a blanket requirement of core dev approval.

gritty wind
#

Yeah basically

#

From the internal core-dev policy:

The decision to approve an issue always falls down to a core developer decision. That is, it’s your responsibility to approve, block, or discuss issues from any technical aspect.

If the decision on approving an issue or not falls down to a policy matter (e.g: should we allow ...), then it will most likely be an organizational decision. That might mean requiring admin approval, discussion on the org-repo, or a staff meeting.

Which is more words to say what Mark has said. If an issue is created which is related to an event, it's probably fine for Kat to approve it. But there are a lot of nuances and pitfalls here, so it's easier to say ask the core dev.

tawdry vapor
outer oasis
#

every damn time I always click "assign myself" on an issue

tawdry vapor
#

It's not just you don't worry

outer oasis
#

@fossil veldt, sir-lancebot#1072 has been approved
Thank you for your service, both to us here in this guild, and to the advancements of uwuification algorithms as a whole

dusky shoreBOT
tawdry vapor
#

I remember looking into using phonemes instead of graphemes but it turned out that there wasn't anything that can precisely map the latter to the former. If I recall correctly things like digraphs wouldn't properly be mapped, so it was difficult to generate a word that preserved the original spelling when needed.

fossil veldt
#

is this for English?

tawdry vapor
#

Yes

#

I'm not sure if I shared the failures of my research here or if it just stayed in my head. Don't remember the exact details at this point.

fossil veldt
#

English is essentially the most difficult language to do this in, (even more than French, which is the 2nd worse)

tawdry vapor
fossil veldt
#

It is the first deep learning Grapheme-to-phoneme model to preserve input part of speech tokens during training

#

and as such can resolve sentences like: (disambiguating 'read' and 'read' correctly)

g2p.convert('I read the book, did you read it?')
>> '{AY1} {R EH1 D} {DH AH0} {B UH1 K}, {D IH1 D} {Y UW1} {R IY1 D} {IH1 T}?'
tawdry vapor
#

Sounds very cool and also very over my head 😄

fossil veldt
#

it also can resolve the phonemes for new graphemes / made-up words

#

such as

#

c1_reg is my model, on top are Google's espeak and Deep Phonemizer

tawdry vapor
#

So how can you get the map of graphemes to phonemes cause it's unclear from the example you showed

fossil veldt
#

essentially each phoneme definitively map to an English pronunciation, unlike graphemes

fossil veldt
#

otherwise there are dictionaries that transform well-known words

#

there are no real rules as English pronunciation is very arbitrary

fossil veldt
tawdry vapor
#

Let's say there was a word like aballos, so there is a digraph ll but the phoneme is still just L. You'd need to know that L covers ll.

#

That's the problem I was facing

hoary haven
fossil veldt
#

some words have different spellings but are pronounced the same

#

having the same phonemes means the word is pronounced the same, it doesn't retain the spelling information

mellow basin
tawdry vapor
#

That was the problem. If I want to uwu-ify a word, it'd be weird if the spelling change for the letters that aren't meant to be uwu-ified. It could make the word too unrecognisable.

#

Like I see "B" phoenem and say "okay this one I just want to leave as it is", but I don't know which characters that maps to in the original word. So I could just assume it maps to "b" but that may not necessarily be true since spelling rules aren't consistent.

fossil veldt
#

or interpreting whether each word is a verb / noun / tense, etc.

#

if something is a verb, you could replace it with a uwu-fied verb

#

it's obviously lossy in terms of information, but the sentence would still be valid grammatically

tawdry vapor
#

So, the meaning of the sentence could change, but grammatically it's still valid, and the replaced word would still sound similar to the original?

fossil veldt
#

I have half a mind to just fine tune a GPT-2 model to uwu-fy text and see what happens 👀

#

Because like, uwu-fication is not just about 1:1 word transforms fundamentally right? Sometimes you need to add whole sentence parts, or express meanings in different ways.

tawdry vapor
#

I'm not sure. I haven't analysed uwu-fication forms carefully.

#

I thought 1:1 would be a decent result anyway

gritty wind
#

Woah policy bot got a serious UI update

#

It now actually explains stuff

#

Genuinely mind-blowing

gritty wind
#

@tawdry vapor have you tried running the PR locally? When I merged the normal postgres with test-postgres, the tests became slow again

#

I checked that all the settings were applied in psql, so I can't quite figure out why that would be

#

The only thing that should be different is the actual prod data, but I'm not sure how that would affect it

tawdry vapor
#

No I have not tried it yet

#

I can in a moment

#

You want me to test it as it is now, before your merging of the services?

gritty wind
#

Yeah give it a go, though I suspect that you might not notice an improvement either way. The benefits might only be a windows thing, since CI is already 20 seconds

#

I think I'll drop my database and try again

#

This is a little funny. I dropped my main DB, recreated it from scratch with the same arguments as the test db, on the same port as the test db, but still it managed to be slower

#

I wonder...

#

Hahahahaha no way

#

The speed loss wasn't actually from the database, but the networking adaptor

#

The speed gain was because the test DB didn't define the host

#

That would also explain why the CI was so quick

tawdry vapor
#

Sorry I am just getting around to this

#

Do you still want me to test?

#

And what do you mean by not defning a host?

gritty wind
gritty wind
#

That seems to have been the only thing that made a difference

tawdry vapor
#

🤔 that saves almost 5 minutes?

gritty wind
#

I honestly have no idea what's up with it lol

tawdry vapor
#

Okay let me try

gritty wind
#

It's entirely possible I have something borked with my networking, but I can reproducibly slow it down by adding the host back in

tawdry vapor
#

On your branch the result was 28 seconds for tests

#

On main, for some reason poetry run task test is getting hung up on something and I'm not seeing any output

#

Oh wait I forgot to restart the db

gritty wind
#

Make sure to compose stop and start to apply the changes

tawdry vapor
#

Yeah I pruned in between

gritty wind
#

Perfecto

tawdry vapor
#

It ran 96 (out of almost 300) in 49 seconds and then failed

#
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
gritty wind
#

I kept getting that error when migrations werent done

tawdry vapor
#

I don't think it applied migrations before the test

gritty wind
#

Ye ye

tawdry vapor
#

It's not done yet but it's clearly taking a lot longer on main

gritty wind
#

Feel free to call it, I think this is enough proof

tawdry vapor
#

Just finished: 162 seconds

gritty wind
#

Thanks for your effort

#

Ah

tawdry vapor
#

Almost 6x slower

gritty wind
#

I guess docker must be doing something smarter with the networking when we don't set the IP

tawdry vapor
#

I tested on main with the modified pg command only, and it saved a negligible 1.5 seconds

#

Not enough to even rule it out of general variance for runtimes

gritty wind
#

Yeah

#

I'm pretty sure it's just the port stuff that's affecting it at this point

patent pivot
#

phone guinness

gritty wind
#

Nah I've been running docker on my smart watch for ages

#

Joe you understand this stuff, explain pls

patent pivot
#

i've beeeeen

#

reading over it

#

lol

#

i'm not super sure what's going on

gritty wind
#

Alright I've pushed the changes and overwrote the old ones

#

I resubmit for your consideration

tawdry vapor
#

I don't think it's quite the same situation though

gritty wind
#

I found some DNS stuff, but it seems unrelated too

surreal veldt
#

Pretty sure that in the !regex tab, the example is a bit off

#

!regex

stable mountainBOT
#

Regular expressions
Regular expressions (regex) are a tool for finding patterns in strings. The standard library's re module defines functions for using regex patterns.

Example
We can use regex to pull out all the numbers in a sentence:

>>> import re
>>> x = "On Oct 18 1963 a cat was launched aboard rocket #47"
>>> regex_pattern = r"[0-9]{1,3}"  # Matches 1-3 digits
>>> re.findall(regex_pattern, foo)
['18', '196', '3', '47']  # Notice the year is cut off

See Also
The re docs - for functions that use regex
regex101.com - an interactive site for testing your regular expression

surreal veldt
#

The foo in the findall method should be x, or the x variable should be foo

gritty wind
#

Yes, I think you're right

cold island
#

Wait where did foo come from lol

#

Should definitely be x

gritty wind
#

I say x should be foo 👀

#

We'll settle this with a duel

cold island
#

foo is for foonctions

gritty wind
#

lmfaooooo

#

Ok you've won

atomic ivy
#

text would be better

cold island
#

Probably yeah

hoary haven
#

i think scoff might have changed things around to appease my character per line limitation on macOS so that each line of code doesn't wrap

#

idk if something's changed but it currently doesn't fit on one line anyway now lol

hoary haven
cold island
#

It's just a markdown file, I can do it from the browser, sec

outer oasis
dusky shoreBOT
frozen galleon
#

Hey, I tried running docker-compose up for the pixels repository, but for some reason it hangs on installing poetry dependencies. Specifically, the moment it reaches sniffio dependency, it just doesn't seem to be doing anything, I tried waiting it out, but that didn't help. When installing locally poetry install is finished in just a few seconds

#

Any ideas what's going on here?

vale ibex
#

hmmm, I'm not sure, I just tried to build the docker image and it worked fine for me

#

what version of docker & docker-compose do you have installed?

frozen galleon
#

it should be up to date, it's managed by my system's package manager

#

oops, forgot sudo with the second command

vale ibex
#

yea, those are the same versions as me, so I really don't know

#

I'm using the experimental build engine though

frozen galleon
#

yeah me neither, it's such a weird issue

#

I know that just running postgre and redis works fine

#

so it shouldn't be a docker issue

vale ibex
#

yea, not sure

#

is it consistent?

frozen galleon
#

well, sometimes there is some other package that's printed last, but it always stops somewhere around sniffio

#

I think that's just because of some concurrency in poetry or something

#

like here it stopped at typing extensions

#

(I've even tried bumping down sniffio to 1.0.0 which is why the version here isn't 1.2, but that didn't help)

vale ibex
#

yae I just cleared my docker system cache and did a docker build, and it worked fine

#

so it shouldn't be anything to do with the versions etc

frozen galleon
#

that's so weird then

#

I don't have any local changes, this is the exact version that's on github

#

hm, building it on my ubuntu based server also works without issues, so it must be some problem with my installation, but I just can't figure out what it could be

vale ibex
#

you could try enabling experimental builds for now