#dev-contrib

1 messages Β· Page 8 of 1

gritty wind
#

Sentry 1.9.9 changelog:

Faster Tests (DjangoCon) (#1602) by @antonpirker

vale ibex
#

lol

#

how ironic

#

tests pass, lint passes, bot interacts with the new image fine

#

PR lgtm

gritty wind
#

Alright, seems like a harmless enough timeout from the github api on a low volume request, so likely not a rate limit

#

We just need to like increase the timeout period

vale ibex
#

it's currently 180s

gritty wind
#

That's from the netlify side, which is not what timed out

#

It's the internal request on the site to GitHub, which is at 5

#

I think that's seconds

#

It's most likely just a temporary failure though

#

Network hiccup

gritty wind
#

I can see it, but not modify it

#

Interesting that it didn't link tho to that issue

vale ibex
#

Ah, there wasn't a code mapping

#

added that now

#

also updated @stable mountain and @dusky shore code mappings to use main instead of master

gritty wind
#

That fixed it, thanks

#

And on that note, here's the line of the error

stable mountainBOT
#

pydis_site/apps/api/github_utils.py line 176

runs = client.get(f"/repos/{owner}/{repo}/actions/runs", params={"per_page": 100})```
gritty wind
#

Now it's a question of whether we just dismiss it as a temporary error and ignore it, or if we increase the timeout

#

For reference, that timeout is only used in two places

#

All parts of that github request chain for static builds

#

And showing the github repos on the homepage (cached)

vale ibex
#

looks like it's currently set to TIMEOUT_PERIOD env var, but I can't see where we set that

#

or even where the default is set

stable mountainBOT
#

pydis_site/settings.py line 30

TIMEOUT_PERIOD=(int, 5),```
gritty wind
#

It can also be set as an env var

vale ibex
#

ahhh

#

we should probably decouple the static preview from that number

#

as that number is also used in other places, that we don't want to extend

gritty wind
#

Well, it's not used in static previews, that route is on the prod version for that API route

#

Though theoretically timing out that request would not impact anyone other than API users

#

For which there should only be netlify (and anyone trying to be sneaky)

vale ibex
#

Seems fine then

gritty wind
#

Alright I'll just kaizen this into my PR

#

What is a reasonable timeout

vale ibex
#

wait

#

that timeout is also used on the homepage of the site

#

to fetch repo info

gritty wind
#

Yes

#

Thats the only place its used

#

But I won't change that

#

Just add a separate timeout for this route

vale ibex
#

alright

#

Maybe double it to 10?

gritty wind
#

Great idea

#

Pushed

#

Now we see if it works

vale ibex
#

I have absolute faith in your changeset scalios

gritty wind
#

Green across the board

vale ibex
#

feel free to merge

gritty wind
#

4 words every developer wants to hear

vocal prairie
#

hates to hear*

#

if someone else merges it and it breaks at least you can blame it on them

gritty wind
#

My PRs don't break, morged

#

🧠

#

site#774

dusky shoreBOT
vale ibex
clever wraith
#

@vale ibex I've updated bot#2283, would be great to have a look whenever you can.
Thanks!

dusky shoreBOT
hoary haven
static canyon
#

Last worked end of August from the looks of it

#

.src hangman

dusky shoreBOT
#
Command: hangman

Play hangman against the bot, where you have to guess the word it has provided!

Source Code
static canyon
#

Looks like the commit making the setup async broke it for some reason

#

Which doesn't really make sense but :shrug:

#

@vale ibex any ideas?

vale ibex
#

Can't check myself right now

vale ibex
#

4 new issues in lance from sentry reports

#

2 seem to be from d.py 2.0 breaking changes, other 2 seem like pre existing problems

static canyon
dusky shoreBOT
vale ibex
static canyon
#

Hmm

#

I searched and didn't see it elsewhere

#

Not sure why that didn't show up

vale ibex
#

Thanks :D

atomic ivy
#

that made me curious and I ran pyright on the repo
it found 715 errors lemon_grimace

gritty wind
#

Lance?

#

We are very lenient with typing

#

It contributes a large portion of the issues

atomic ivy
#

yeah, lance

gritty wind
#

Does pyright raise issues for non-generic type hints?

#

Like using list instead of collection

atomic ivy
#

that would depend on the Python version, right?

gritty wind
#

Hm, tbf I haven't tried it on 3.9+, but I remember it's something mypy would always complain about

#

Was that removed, I can no longer get that error, even on earlier python versions

static canyon
static canyon
#

Thanks for the reviews @timid sentinel lemon_hyperpleased

If you've got time, would appreciate some reviews on my other two (slightly more complex) PRs:

  • bot-core#137 (is blocking sir-lancebot#1062)
  • bot#2089 (has been waiting on review for couple of months now lemon_sweat)
rapid swallow
#

Hello Chris I'll approve #2267 tomorrow

outer oasis
vale ibex
#

probably just make a tracking issue on the k8s repo would be easiest

#

Which has a checklist of repos to be actioned, which we can check off as they're fixed

vale ibex
#

yea, those are fine

outer oasis
#

As requested - kubernetes#140

timid sentinel
static canyon
clever wraith
#

If anyone has 30 seconds to review this, it would be great.
bot#2284

dusky shoreBOT
trim cradle
#

Someone in pygen keeps rerolling the .topic command rapidly, and it's kind of obnoxious. can we set a minimum duration between rerolls?

trim cradle
cold island
#

sorry πŸ˜”

exotic ember
#

@waxen notch Hello, I have removed your post. We do not allow unapproved advertising in the server, and this channel is intended for discussions about Python Discord's projects, not any project in general.

waxen notch
#

Ok, I'm sorry :/

grand holly
#

hey any update on sir-lancebot#1098

dusky shoreBOT
cold island
bleak temple
#

Is there any plans to convert commands to slash commands?

subtle kraken
karmic silo
#

is there any chance eval output could be allowed in pygen? or at least stop the bot from deleting the message? it’s really annoying trying to give examples or debug something when the bot is deleting the message and/or you have to go to another channel to see the output

#

if spam is your worry it shouldn’t be all that hard to have a cooldown and line limit right?

dim pelican
clever wraith
#

Hello @glass pecan,

Could you help review bot#2283 please ?
Or any other <@&295488872404484098> review would be appreciated.

Thanks !

dusky shoreBOT
subtle kraken
dim pelican
#

I see bot#2264 but I think it's different from allowing members to run eval in #python-discussion , with a line limit

grand holly
#

Anyways it's just a fun command like

#

like .anagram and etc...

livid bronze
#

I was directed here to share a screenshot. I'm not familiar with your discord bot, but just tested the "I run code" bot in my test server. It works in forum posts (as shown in first screenshot)... Your bot may need additional scope or permissions. Anyway, this server would be much cleaner and more user friendly if you move to the forum channels (in my opinion). Also attached a screenshot to show how we use them (although my server is not near as popular as this one).

vale ibex
atomic ivy
#

let's test in production ducky_beer

dim pelican
#

Also, the bot currently does much more than just running a python code evaluator with the help system setup

clever wraith
vale ibex
clever wraith
#

Oh

cold island
#

Is there a way to get a URL's path? like in https://google.com/hi it would be "hi". tldextract doesn't deal with that, urllib is annoying, and I'd rather not resort to regex

timid sentinel
cold island
outer oasis
# cold island Is there a way to get a URL's path? like in `https://google.com/hi` it would be ...

Is it not just urlparse().path?

>>> from urllib.parse import urlparse
>>>urlparse("http://docs.python.org:80/3/library/urllib.parse.html?"
...         "highlight=params#url-parsing")
ParseResult(scheme='http', netloc='docs.python.org:80',
            path='/3/library/urllib.parse.html', params='',
            query='highlight=params', fragment='url-parsing')

https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse

atomic ivy
#
>>> from yarl import URL
>>> URL("https://google.com/hi").path
'/hi'
>>> URL("https://google.com/hi/").path
'/hi/'
cold island
atomic ivy
#
>>> URL("google.com").path
'google.com'
>>> URL("google.com/").path
'google.com/'

πŸ₯΄

cold island
#

yyyep

#

I made do with urllib, just manually added the scheme

#

and stripped any slashes

atomic ivy
#

makes sense

dusky shoreBOT
covert fog
#

do i just proceed with implementing this and creating a PR or do i have to be assigned to do this

static canyon
#

Once it has approval, you can comment on it saying you'd like to implement, at which point you can be assigned (if it's something that can be done by non-staff / non core-devs), and then you can implement

#

In fact, in this specific case, since it's your PR and you've indicated that you want to implement it yourself, you just need to wait for approval

#

Tl;Dr; wait for approval, then implement & PR

#

@covert fog

covert fog
#

ok

stable mountainBOT
#

:incoming_envelope: :ok_hand: applied mute to @crimson harbor until <t:1665112758:f> (10 minutes) (reason: duplicates rule: sent 4 duplicated messages in 10s).

The <@&831776746206265384> have been alerted for review.

green oriole
#

that's a new one

#

=about

#

what's your modmail version?

#

I assume it isn't the latest one

gritty wind
#

This is a known wont-fix issue with poetry 1.2 that we’ve mitigated on our other repos by

#

Just missed this repo

#

The error is here fwiw

ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

#

@green oriole it has been fixed, just go ahead and update your PR

green oriole
#

pulled

gritty wind
#

CI passed πŸ‘

vale ibex
#

FWIW we're not on the new release of modmail just yet

gritty wind
#

200 new commits 😬

#

Does it merge with our deployment branch

vale ibex
#

didn't touch deployment

green oriole
#

I heard their CI is fixed

#

but yeah I remember the fork

green oriole
#

I heard their CI is not fixed

#

hahat*

#

hold on I got some emails about it

vale ibex
#

I deleted my fork because I cba to fix it when they finally picked it up

green oriole
vale ibex
#

yea it closed automatically, since I deleted my fork

green oriole
#

you should update, the new 2.0 interface is more pleasant to work with

vale ibex
#

it seems kyber is the only one with dockerhub access, so it didn't go anywhere

#

Yea, we should migrate at some point

#

it's just updating modmail and then making sure plugins work

green oriole
#

could you recover your repository?

vale ibex
#

I dont want to :)

green oriole
#

tagging does work

#

we're not using the others though, so no idea

vale ibex
#

yea it should be fine

#

just making loading async

#

and just check if any internal things we rely on have changed

green oriole
#

I'm mildly annoyed they broke all the plugins

#

it wouldn't have been that hard to provide compatibility

vale ibex
#

eh it's non-zero effort so why not push it off to 3rd party plugin creators :P

#

but yea, if you're making a plugin system, you should provide a solid api

#

and if you make breaking changes provide some sort of migration guide

wind ruin
#

@cold island was that actually supposed to go in dev-announcements or just in here?

clever wraith
#

@cold island i know you're currently working on filters, have you seen bot#2266?

I was thinking that filters might have a human readable name ( if they don't already) and upon triggering a filter, we can use that as the Embed's title

dusky shoreBOT
cold island
clever wraith
#

Alright, thanks!

cold island
#

Sneak peak (110 is the filter ID)

clever wraith
#

Byoutifulle!

cold island
vale ibex
#

Yea, still correct

cold island
#

fwiw there's info on metricity in the guide, just in a separate section

vale ibex
#

ahh yea,

#

I'll remove that line

cold island
#

Is it possible to skip tests if only markdown files were changed?

vale ibex
#

Yea, you can add a paths-ignore section to the trigger

#

something like ```yml
paths-ignore:

  • '**.md'
cold island
#

did your force push remove the merge from main?

vale ibex
#

Yea, I rebased onto main

cold island
#

ah

vale ibex
#

I wanted to squash the removal of the metricity part

#

but I couldn't do that if there was a merge main commit there

grand holly
#

Any updates?
sir-lancebot#1098

dusky shoreBOT
green oriole
timid sentinel
#

It's currently a draft pending a conclusion on what regex to use, so if you have any thoughts on that feel free to say

green oriole
#

I do wonder if the first part is long enough for the new ID length

#

yeah it is

#

oh yeah that was that time

#

hm'kay

#

left a comment

green oriole
#

DevOps question: is snekbox not running in UTC?

cold island
#

Hi, this channel is about our server's projects, not anyone's. Also we don't allow offering pay here.

gritty wind
vale ibex
#

!e import datetime; print(datetime.datetime.now());

stable mountainBOT
#

@vale ibex :white_check_mark: Your 3.11 eval job has completed with return code 0.

2022-10-10 08:35:13.313321
vale ibex
#

yea, utc it seems

gritty wind
#

;

#

Excuse me

vale ibex
#

oh yea sorry, I forgot one

gritty wind
#

Thank you

vale ibex
#

Updated

green oriole
#

How weird

grim prairie
#

Question/idea. A semi-frequent problem is simulating input() in help channels. And while sometimes there are workarounds; it might be nice to add a sort of nomenclature to allow users to specify strings for input.

Something like:

((My input string))
data = input()
print(data)
#

On the back end we could parse out "my input string" and override the input() function to make it return the given string.

#

Any appetite for something like that?

#

I was looking at the bot layout the other night but couldn't quite find where the code is processed. I got up to the comment #this works just ignore it

subtle kraken
#

I don't think its really feasible without modifying stdin/stdout while providing no value,
You can just replace input() directly with the string and that'd work just finr

grim prairie
#

Well it wouldn't be indifferent to how some browser based interpreters take stdin. And its purpose would primarily be for the help channels for demonstrating input to learners

#

I've seen many instances where it would be useful.

subtle kraken
#

I'd argue it'd be rather misleading since you already are hardcoding the string into the code which isn't something that'd occur in actual program (ignoring that the example would return a Syntax Error).

While showing an example is good, I think in that case its better to explain to user what the input is and instruct them on how to use it
Just replacing input() with a predefined string and explaining that to user would be helpful

#

Of course another suggestion would be to accept input as a discord message, however our NsJail setup has time limit so it'd expire prior to getting said input most likely

vocal prairie
subtle kraken
#

Yeah am just discussing what others have suggested before
That could be adjusted but timelimit still exists

#

Am not sure how NsJail works fully but I doesnt seem that you can dynamically change the max execution time depending on the context without losing the protection that it offers

#

I could be wrong of course so feel free to correct me

tawdry vapor
gritty wind
covert fog
#

any updates on sir-lancebot#1116?

dusky shoreBOT
cold island
covert fog
#

oh
thanks

elder belfry
#

Hey guys, been working on sir-lancebot#1060, and I'm going to work on this after a long time (exams :/), and I don't know for some reason the bot (on my test server) is not responding. (It shows, it's online and even sends the Connected! text #dev-log ). Could anyone point me in some direction so that I can get the bot running?

I use this command to start my bot:

docker-compose up --build

And I have the following fields in my .env

BOT_TOKEN=--------------------------
BOT_GUILD=884065843321925713
BOT_ADMIN_ROLE_ID=884072561724497953
ROLE_HELPERS=884073931168948234
CHANNEL_ANNOUNCEMENTS=884072300897521694
CHANNEL_DEVLOG=884072344488935504
CHANNEL_COMMUNITY_BOT_COMMANDS=884072410209456168

TMDB_API_KEY=--------------------------

TRASHCAN_EMOJI=πŸ‡½
dusky shoreBOT
cold island
elder belfry
cold island
#

enter the developer portal and see what's enabled for your bot

elder belfry
#

ok one sec..

elder belfry
cold island
#

yeah

elder belfry
vocal wolf
#

@outer oasis thanks

green oriole
#

lol

#

was the k8s repo recently made public?

#

I feel like that's quite old, isn't it

vale ibex
green oriole
#

yeah right

#

hmm

#

any special issue that'd need looking at?

cold island
austere hornet
full fractal
#

Probably just discord pulling a discord and breaking stuff 'cause discord is not discord without its "99 errors per minute" quota

austere hornet
#

!otn a discord-stop-with-the-errors

static canyon
#

@dim pelican re sir-lancebot#1125 it'd be nice to also add og_blurple since that's what pydis uses (if it's not already a thing)

dusky shoreBOT
dim pelican
static canyon
atomic ivy
#

.color hex 7289DA

dusky shoreBOT
#
7289DA

Color information for Hex 7289DA.

RGB

(114, 137, 218)

HSV

(227, 48, 85)

HSL

(227, 58, 65)

CMYK

(48, 37, 0, 15)

Hex

#7289DA

Name

No match found

clever wraith
#

Hello folks,

bot#2283 needs some love from contributors

dusky shoreBOT
dim pelican
static canyon
#

I'm quite busy today but if I'll remember I'll review it tonight

#

!remind 4h Am I free?

stable mountainBOT
#
No problem.

Your reminder will arrive on <t:1666026782:F>!

static canyon
#

!remind edit duration 5293 5h

stable mountainBOT
#
Yeah okay.

That reminder has been edited successfully!

stable mountainBOT
cold island
#

I don't get it, where's the blanket noqa?

subtle kraken
cold island
#

tnx

dim pelican
static canyon
#

I've noticed that the .colour command doesn't use the name lookup json for hsv/hsl/cmyk (works for name/rgb/hex). Is this intentional?

dim pelican
static canyon
#

Hmm, I see

dim pelican
#

It's a tricky one

static canyon
#

Is that something we want to address? Maybe look for a similar hex code?

#

Depends how far off it is I guess

#

Or we change the json structure

dim pelican
#

I have no idea how I'd start to tackle it to be fair

#

At one point I think someone mentioned having a named colorspace of coordinates, and then choosing the closest named point to default to, but there are issues with that too

static canyon
#

So not sure what you mean

dim pelican
#

Huh.

#

5865F2 vs 5A65F2

#

I feel like that should get matched

static canyon
#

What tool are you using to convert?

dim pelican
#

From what I remember it was all done manually

static canyon
#

Oh right, 5865f2 is what's stored 🀦

#

Now I understand lol

#

So yeah, we'd want to either change the json structure to include a hsv/hsl/cymk lookup, or allow for close matches (if we do anything)

static canyon
#
sir-lancebot          | Traceback (most recent call last):
sir-lancebot          |   File "/opt/poetry/cache/virtualenvs/sir-lancebot-TFcQMFAJ-py3.10/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 934, in _load_from_module_spec
sir-lancebot          |     spec.loader.exec_module(lib)  # type: ignore
sir-lancebot          |   File "<frozen importlib._bootstrap_external>", line 879, in exec_module
sir-lancebot          |   File "<frozen importlib._bootstrap_external>", line 1017, in get_code
sir-lancebot          |   File "<frozen importlib._bootstrap_external>", line 947, in source_to_code
sir-lancebot          |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
sir-lancebot          |   File "/bot/bot/exts/holidays/easter/egghead_quiz.py", line 68
sir-lancebot          |     total_no = sum([len([user async for user in r.users()]) for r in msg.reactions]) - len(valid_emojis)  # - bot's reactions
sir-lancebot          |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sir-lancebot          | SyntaxError: asynchronous comprehension outside of an asynchronous function```
> sir-lancebot          | SyntaxError: asynchronous comprehension outside of an asynchronous function
But... it's not? It's in a command, so `async def`
#
    @commands.command(aliases=("eggheadquiz", "easterquiz"))
    async def eggquiz(self, ctx: commands.Context) -> None:
        ...
        total_no = sum([len([user async for user in r.users()]) for r in msg.reactions]) - len(valid_emojis)```
covert fog
#

you nest the async for in a regular for which doesn't have an asynchronous scope

static canyon
#

I can't make the other one an async for since it's a list, which doesn't support that

covert fog
static canyon
#

So it can't be done as a comprehension?

covert fog
#

i guess so

static canyon
#

Fair enough

static canyon
#
    @commands.Cog.listener()
    async def on_reaction_add(self, reaction: discord.Reaction, user: Union[discord.Member, discord.User]) -> None:
        """Listener to listen specifically for reactions of quiz messages."""
        if user.bot:
            return
        print(user, user.bot)  # OUTPUTS TizzySaurus#9615 False
        if reaction.message.id not in self.quiz_messages:
            return
        if str(reaction.emoji) not in self.quiz_messages[reaction.message.id]:
            return await reaction.message.remove_reaction(reaction, user)
        if await self.already_reacted(reaction.message, user):
            return await reaction.message.remove_reaction(reaction, user)

    @staticmethod
    async def already_reacted(message: discord.Message, user: Union[discord.Member, discord.User]) -> bool:
        """Returns whether a given user has reacted more than once to a given message."""
        users = []
        for reaction in message.reactions:
            async for user in reaction.users():
                users.append(user.id)

        print(user)  # outputs TizzyBot (my bot)
        return users.count(user.id) > 1  # Old reaction plus new reaction```I'm so confused how `user` is changing here
#

In on_reaction_add it's me, and in already_reacted it's my bot

vale ibex
#

you're reusing the user var in your async loop

#

so user will be whatever user was in the last iteration

static canyon
#

Right, yeah 🀦

#

sir-lancebot#1126 is up; hopefully I did it correctly.

dusky shoreBOT
fossil veldt
#

can I get approval for bot#2294

timid sentinel
#

@dim pelican I am very sorry in the squash merging of your PR I accidentally changed the spelling in the commit message from color to colour, was very much a mistake and not on purpose at all ducky_devilducky_devilducky_devil

outer oasis
grand holly
#

it's just American Spelling vs British Spelling

#

When choosing between color and colour, keep in mind that both spellings are correct. The shorter one, color, is the preferred spelling in the United States. The rest of the English-speaking world uses the longer form, colour.
~ Grammarly

outer oasis
#

Please come with me sir

#

We'll get you help

#

(I was just playing into the existing joke)

grand holly
#

me: quickly runs and jumps out of the server

#

me: calls simulation services

#

rings...........

#

me: Hello, Simulation Services, you may have to update the grammar to 1e0

#

me: cuts and leaves the phone booth

#

also me: forgets and leaves the mobile phone in the server

static canyon
#

Hello @timid sentinel πŸ‘‹

I've hopefully resolved your comments on sir-lancebot#1126, and also left an implementation query on sir-lancebot#1121.

timber pelican
#

what is time/memory/output limits for snek?

stable mountainBOT
#

bot/exts/utils/snekbox.py line 69

MAX_PASTE_LENGTH = 10_000```
`bot/exts/utils/snekbox.py` line 296
```py
output = output[:11]  # Limiting to only 11 lines```
stable mountainBOT
#

config/snekbox.cfg line 8

time_limit: 6```
`config/snekbox.cfg` line 107
```cfg
cgroup_mem_max: 52428800```
timber pelican
#

6 seconds and 50mb
i will check it

#

i think you have a bug

#

!e

import time as t
t.sleep(6)
print('hi')
stable mountainBOT
#

@timber pelican :warning: Your 3.11 eval job timed out or ran out of memory.

[No output]
timber pelican
#

!e

import time as t
t.sleep(5)
print('hi')
stable mountainBOT
#

@timber pelican :white_check_mark: Your 3.11 eval job has completed with return code 0.

hi
timber pelican
vale ibex
timber pelican
#

eval job timed out or ran out of memory message when snek actually ran out of time

#

im blind, sorry
i didnt noticed timed out or part of message πŸ€¦β€β™‚οΈ

vale ibex
#

πŸ‘

#

fwiw, NsJail uses the same error code for both of those things, so we can't tell the difference without some custom stuff that we haven't seen the need to write

hoary haven
dusky shoreBOT
vale ibex
#

no idea then lol

hoary haven
#

hmmmmmmMMMMMM

outer oasis
subtle kraken
outer oasis
#

Yeah, that was my question

#

So snekbox does just throw a generic error, so the bot has no context when catching it
Cool
Maybe one day I'll be smart enough to understand snekbox and I'll work on that

#

How much of a PITA would it be to try and use botcore on a multi-server bot?

vale ibex
#

depends on your definition

#

@stable mountain is a multi server bot

#

botcore is also mostly opt-in funcitonality

#

so use as much or as little was you want

outer oasis
vale ibex
#

yea, you'd need to overwrite those functions in your subclass

#

because there's a few "correct" things to do there

#

do you wait for all guilds? Do you maintain a list of guilds that are available?

#

so yea that can be implemented in a subclass

outer oasis
#

Huh
My "fun weekend project" is already turning into an architecture problem
And it's only Thursday!

vale ibex
#

hah yea sounds fun

cold island
#

probably just feed wait_until_guild_available the context guild id

#

I hope for your sanity that you're not implementing a cross-guild functionality

fossil veldt
#

@static canyon were you able to look at the suggestion I left on sir-lancebot#1126 ? Other than that it looks good to approve.

dusky shoreBOT
static canyon
#

If I remember I'll do it tonight, otherwise over the weekend.

stable mountainBOT
#
Sure thing!

Your reminder will arrive on <t:1666444083:F>!

fallen patrol
#

at this point it might be worth reading the entire lib changelog since that's the third or fourth pr that fixes issues with removed or changed code

fossil veldt
static canyon
#

!remind delete 5309

stable mountainBOT
#
No problem.

Successfully deleted the following reminder(s): 5309

static canyon
#

RE bot-core#141, or more specifically, constants on bot-core (CC @gritty wind @cold island @timid sentinel as the commenters on the issue).

Has there been any kind of internal chatter about the next steps for this? There's other PRs stalled by it, and I'd like to avoid them not being implemented because we couldn't come to a conclusion on this (albeit important to not rush this decision).

As for my opinion on the matter, (as stated on the issue) I think a good option is a constants.py file on bot-core, that has all the constants that are required on both bot and lancebot (my understanding of bot-core is that it's supposed to unify "common assets" across projects, so this fits perfectly), with the option to leave other constants as-is within their own respective repo, since they're not "common across projects".

I believe this approach is akin to what @gritty wind suggested, and then @timid sentinel expanded on(?).

dusky shoreBOT
cold island
#

There was some conversation, I don't remember exactly where it ended

#

But my suggestion still works if you want to unblock this specific PR

#

If you're looking for something more long term then we'll need to come back to it later

clever wraith
timid sentinel
clever wraith
timid sentinel
#

I didn't write it so i'm not sure haha :P

vale ibex
#

it was created in May 2018

#

and has evolved over time

digital barn
#

Can i get help here ?

cold island
cold island
vale ibex
#

what part were you unsure about?

cold island
#

and how is it related to filtering

vale ibex
#

check_not_bot means no commands can be invoked by bots check_on_guild means commands can not be ran in DMs

vale ibex
cold island
#

So it just adds these two checks to every command?

vale ibex
#

as in filtering out commandds we don't care about

vale ibex
cold island
#

alright

#

give me a few minutes

cold island
#

Sorry for the big diff, it's not that bad I promise
@timid sentinel you stole my line for when the filters rewrite is out KEK

timid sentinel
#

Haha

clever wraith
#

Hello folks,

In BotCore's API client, I noticed that we use the request method for all HTTP methods except for the delete where we use the session's delete method instead of request("DELETE", ...

It got me curious, why is that ?

static canyon
cold island
#

The delete can potentially return None which the others can't, so it can't use the same generic method

clever wraith
cold island
clever wraith
vale ibex
#

just replacing the method

clever wraith
#

Understood, thank you both !

clever wraith
gritty wind
#

If it's in the readme, I assume so. However, that project is not managed by python discord, it's independent. There's a link to their discord there I believe

#

Yup, very top there's a sticker that says discord

clever wraith
#

I didn't pay attention to the fact that it was a fork, I'll notify them.
Thanks !

gritty wind
#

Yup yup, thanks for reporting anyway πŸ˜„

subtle kraken
#

this is absolutely irrelevant to this channel as well as the server.

fossil veldt
#

Where are we currently at for whether we want to move forward on snekbox#103?

dusky shoreBOT
fossil veldt
#

I'd be interesting in working on it if possible

vale ibex
#

Seems to be approved and ready to be worked on.

#

not sure if Mark wanted to do it himself though

tawdry vapor
#

As for where we are at: we know we want to do it, but how to do it is still a bit up in the air

#

Seems like the best proposal so far is b64 still. If you want to explore other options that'd be good.

fossil veldt
#

I was wondering how we should do the actual byte output

#

getting people to actually write bytes to stdin seems a bit complicated

#

I was thinking we can additionally patch some sort of display for libraries like matplotlib so plt.show() works

#

since there's no network connection I assume 99% of images are just matplotlib and maybe turtle?

tawdry vapor
#

This issue is only concerned with snekbox. Design only needs to consider that clients will be able to actually read the bytes. But what they do with them/how they use them is a separate issue that's out of scope.

fossil veldt
#

but yeah stdout bytes to base64 seems reasonable

tawdry vapor
#

For example, the bot will read the bytes from snekbox's response, and it will either guess (based on magic numbers or whatever) or know from context of the command execution what the actual file type is.

#

I don't think snekbox needs to return any more info than just the bytes and the normal stuff it currently returns.

fossil veldt
#

should we always return the encoded format, even with text? that might be easier than trying to have 2 modes and detection

timid sentinel
#

I think I played around with this a while ago and got stuck with matplotlib as it seemed to require write access to a temporary directory for some internal stuff. Not necessarily relevant to this issue but if that's the end aim it's something to keep in mind

tawdry vapor
#

Yes, that is what I was in favour of. From my issue description:

I think it makes sense to maintain a single endpoint and simply add a parameter to change from text to byte mode, but I'm still open to discussion on making it a separate endpoint.

tawdry vapor
#

Though we probably don't even need a parameter

cold island
#

Would it make sense for the bytestream itself to contain metadata about what is being returned? e.g start with a filename

timid sentinel
#

This was quite a while ago so I can't really remember, it's possible there might be a workaround or something or things have changed, idk

tawdry vapor
fossil veldt
timid sentinel
#

snekbox#114

dusky shoreBOT
cold island
#

well, we don't need to, but it would be useful to know whether we're getting text out, or an image etc.

fossil veldt
#

we don't necessarily have to do file io before byte io, but yeah that could be interlinked

tawdry vapor
cold island
#

hmmm

fossil veldt
#

but raw bytes not really

#

or if we patched an extension just for matplotlib obviously we can inject something

tawdry vapor
#

I am not a fan of having to maintain patches for external libs

cold island
#

is there a code example that would deliver a representation of an image?

#

With text you can just print it

#

but with images you.. imshow?

fossil veldt
tawdry vapor
#

I think the bot should be able to determine what the file type is from context e.g. by having separate commands to output different file types.

#

Trying to guess it sounds like it could be unreliable. I suppose some file types are easier to detect than others. Even then, the user may not always have the intention to actually render the file.

fossil veldt
#

then python bot can read that and decode/show

cold island
#

while the snekbox feature is independent, I think it would be useful to understand how exactly a user can output image/sound by evaluating code

tawdry vapor
#

When the bot receives those bytes, it'll be up to the bot to determine how they should be interpreted and presented.

cold island
#

I guess

#

seems a bit awkward though, since people will need to know how to convert it to bytes and output it

tawdry vapor
#

We can add some utility functions to make that easier, if that is a concern.

#

I believe the bot already wraps the user's input code for some timing stuff

cold island
#

That's true.. I guess it can come with a built-in imshow function

tawdry vapor
#

Though polluting global namespace is a bit yucky and unexpected

#

We can alternatively create a proper package and install it within the snekbox env as we do with other packages like numpy

#

But that has added maintenance burden so I dunno

cold island
#

Even if we do, the user would need to know to import it. At that point it might be easier to say in the help embed "use this magic function like a print"

tawdry vapor
#

How do notebooks do it? Anyone have experience with those?

cold island
#

that's what I'm reading on now. I did it a few times but don't remember anymore

tawdry vapor
#

Good find. So we should explore using those dunders.

cold island
#

yeah I'm just a bit unclear on how it sends it to jupyter

stable mountainBOT
#

IPython/core/display_functions.py lines 261 to 266

from IPython.core.interactiveshell import InteractiveShell

if not InteractiveShell.initialized():
    # Directly print objects.
    print(*objs)
    return```
cold island
#

aha

#

Well anyway, we can figure something out

#

is the conclusion here

fossil veldt
#

so it first resolves _ipython_display_ which completely offloads rendering to the object. or any of the format reprs

#

if we were to do that I suppose we'll need to stop running them with -c and need to setup our own ipython "interpreter" which evaluates objects line by line

#

or create a library method like show() which users can call on any object and we'll try to grab a displayable image via the ipython methods

cold island
#

I'm wondering if it's not easier to just have a method show() which will try to parse the object on its own. In 99% of cases it will be either a numpy array or a Pillow image

fossil veldt
#

though plt.show() probably won't work with that

#

since instead of objects we decided module globals are a better idea for plotting catderp

#

hm, I wonder what happens now

#

!e

import matplotlib.pyplot as plt

plt.plot([1, 2, 3, 4])
plt.ylabel('abc')
plt.show()
#

ah

stable mountainBOT
#

@fossil veldt :x: Your 3.10 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'matplotlib'
tawdry vapor
fossil veldt
tawdry vapor
#

Ah, sorry

stable mountainBOT
#

lib/matplotlib/pyplot.py lines 223 to 226

global _backend_mod
# make sure the init is pulled up so we can assign to it later
import matplotlib.backends
close("all")```
fossil veldt
#

tbh this stuff looks pretty cursed by normal standards πŸ₯΄

tawdry vapor
#

the mimebundle one looks interesting. But not all objects are guaranteed to have it?

#

Cause it would be nice to only worry about a single dunder

fossil veldt
#

or everything that can be displayed in jupyter / ipython

tawdry vapor
#

So are you saying they will all have that dunder?

#

On second thought the mimebundle may not be so useful anyway

fossil veldt
#

pillow only has these for example

#

I think mime is only for if the format is not one of the defined reprs?

fossil veldt
outer oasis
fossil veldt
fossil veldt
fossil veldt
tawdry vapor
#

The code snekbox executes could use these dunders to determine which data to send to stdout (via some custom function we expose somehow). However, I am unsure of how to communicate which representation it chose. Maybe it's easier to tell snekbox which type is desired, so the client knows how to interpret the bytes it receives. Snekbox could fail with an error if it cannot get the requested type.

#

I don't think this stuff has to be done on snekbox's side. It could be code injected via the bot

#

Which I would prefer. I like keeping snekbox simple.

fossil veldt
#

or I suppose only outputting to bytes stdout

#

and snekbox would just implement bytes to base 64

#

though if snekbox did encoding, we would need to put the mime format inside the bytes pithink

tawdry vapor
obsidian patio
#

Here’s a one word change PR if anyone’s keen on reviewing (site#785)

dusky shoreBOT
fossil veldt
#

site#785

dusky shoreBOT
fossil veldt
#

hm

#

why'd that not work just now

outer oasis
outer oasis
outer oasis
fossil veldt
#

how do you get access to sentry anyways

obsidian patio
fossil veldt
#

brb gonna request access to our patreon paypal

outer oasis
#

@stable mountain plz
Just breathe buddy

obsidian patio
#

!ping

stable mountainBOT
#
Pong!
Command processing time

65.841 ms

Python Discord website status

Healthy

Discord API latency

102.660 ms

fossil veldt
#

.ping

dusky shoreBOT
#
:ping_pong: Pong!

Gateway Latency: 103ms

fossil veldt
#

&ping

humble leafBOT
#
:ping_pong: Pong!

Gateway Latency: 117ms

fossil veldt
#

smh inconsistent ping format

obsidian patio
#

I like the lancebot colorful embed

fossil veldt
#

what do these things do πŸ‘€

tawdry vapor
fossil veldt
#

I mean like the repository package manager

tawdry vapor
tawdry vapor
obsidian patio
#

@stable mountain doesn’t seem to be feeling too well. I assume you’ve gotten some alerts already?

outer oasis
#

Yep

fossil veldt
#

!ping

stable mountainBOT
#
Pong!
Command processing time

68.052 ms

Python Discord website status

Healthy

Discord API latency

104.681 ms

outer oasis
gritty wind
#

@tawdry vapor @fossil veldt have you tried playing around with installing and importing matplotlib in snekbox (even without the support for output yet)?

#

When we were working on lance’s latex features, there was an insane flat memory cost just to import it, it might cause issues with the memory limits

fossil veldt
#

what was our memory limit for nsjail?

gritty wind
#

Uhhh

fallen patrol
#

oof i just noticed that 2310 wasn't even reported to the discord lib

gritty wind
#

Ye were planning on getting to that

#

Perhaps once we’re not vulnerable haha

gritty wind
#

cgroup_mem_max: 52428800

#

I could test installing it on prod for now

#

It seems to straight up error on import, it expects to have a user

tawdry vapor
#

very cool

gritty wind
#

We can set an env var for that, but it still requires a writable directory

#

What kinda library does so much on import

tawdry vapor
stable mountainBOT
#

lib/matplotlib/__init__.py lines 581 to 582

- Lastly, it looks in `​`​$MATPLOTLIBDATA/matplotlibrc`​`​, which should always
  exist.```
gritty wind
#

lmao

#

I think it just doesn't get to that point

#

lt doesn't expect Path.home to error

#

Hmmm, yeah this will only be resolved in a good manner with snekbox#114

dusky shoreBOT
tawdry vapor
#

We could try setting MATPLOTLIBRC env var to whatever os.path.join(get_data_path(), 'matplotlibrc') is supposed to resolve to, though we'd have to hard-code the path

gritty wind
#

#bot-commands message

fallen patrol
vale ibex
#

I just said, this works, and is more consistent with how we do this pattern

#

Rather than trying to patch something that's only used in this one place

fossil veldt
#

hm... I'm trying to use a locally built snekbox and bot isn't connecting to it

#
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8065 ssl:default [Connect call failed ('127.0.0.1', 8065)]
#

does seem to be up here though

#
# config.yml
snekbox_eval_api: "http://localhost:8060/eval"
snekbox_311_eval_api: "http://localhost:8065/eval"
  snekbox-311:
    << : *logging
    << : *restart_policy
    build:
      context: ../snekbox
      dockerfile: Dockerfile
    init: true
    ipc: none
    ports:
     - "127.0.0.1:8065:8060"
    privileged: true
vale ibex
#

are you running the bot in docker or locally?

fossil veldt
#

docker

vale ibex
#

Try changing localhost in your config to 127.0.0.1

#

Wait, are you running snekbox from the same compose?

#

Or have you built it separately?

fossil veldt
vale ibex
#

Then just use the service name

#

snekbox-311:8060

fossil veldt
#

πŸ‘€

vale ibex
#

It's 8060 if you're hitting the service directly

#

It's only 8065 if you're connecting from outside the container network

fossil veldt
#

ah I see pithink

fossil veldt
vale ibex
#

Cool cool

fossil veldt
#

what does the double port number here mean anyways?

#
"127.0.0.1:8065:8060"
vale ibex
#

External:internal

fossil veldt
#

so how does it route which one, hostname?

vale ibex
#

It means expose the internal port 8060 to the host network at 8065

#

It's only used if the bot is running on the host, outside docker, or if you want to hit snekbox from your machine outside of docker

#

For container to container networking on the same network its not needed

fossil veldt
#

oh hm.. so I guess I should just do the normal single port then for dev?

#

:8060 for snekbox and :8065 for snekbox-311?

vale ibex
#

If you're running the bot in docker, snekbox:8060 will hit snekbox, snekbox-311:8060 will hit 3-11

#

If you're running the bot on host you will need to do localhost:8060 for snekbox and localhost:8065 for 3-11

vale ibex
fossil veldt
#

also how does the 3.11 / 3.10 thing work?

#

the snekbox repo dockerfile seems to be only 3.10?

vale ibex
#

Yea 3.11 is something I manually built and pushed to the snekbox ghcr repo

#

If you remove -dev from the image name, you'll get the one used in prod

#

It's much bigger since it has all the deps

fossil veldt
#

also there's an image and a build in the snekbox compose?

#

is it using the image then or the local build? pithink

vale ibex
#

I haven't looked at snekboxes compose file much, so I'm not sure what it's doing

stable mountainBOT
#

docker-compose.yml line 55

snekbox:```
`docker-compose.yml` line 58
```yml
image: ghcr.io/python-discord/snekbox:latest```
`docker-compose.yml` line 67
```yml
snekbox-311:```
`docker-compose.yml` line 70
```yml
image: ghcr.io/python-discord/snekbox:3.11-dev```
fossil veldt
outer oasis
fossil veldt
#

yeah the snekbox compose for its repo

#

not the bot one

vale ibex
#

Likely to save you waiting for build deps to install

barren zodiac
#

i think somethings wrong pithink

outer oasis
gritty wind
#

Almost done :D

vocal wolf
#

postgres upgrade time

barren zodiac
vocal wolf
#

:D

barren zodiac
#

are y’all still hosting on linode?

#

i remember the netcup host stuff being talked about

gritty wind
#

We're mid migration yeah

barren zodiac
#

i see

#

cool stuff

vocal wolf
#

thanks

barren zodiac
#

xithrius currently on a triage spree

outer oasis
#

Earning that role

barren zodiac
#

rightfully so

timid sentinel
#

Re bot#1941, have we had issues with available help channels dissapearing recently? If we haven't I'm wondering if it's still worth doing.

dusky shoreBOT
gritty wind
#

Yes we have, I think twice within the last week

#

Just search for the reload command

timid sentinel
#

Oh alright, that's annoying

#

Have we narrowed down the cause of the issue? Do we believe it's just the discord API lying about moving the channels?

vocal wolf
#

sir lance now only has 1 pr, very nice

vale ibex
#

Personally I haven't bothered investigating, as I'm not sure it's worth time investment to fix

#

Since we're going to be using forum channels at some point

barren zodiac
vocal wolf
#

lol

barren zodiac
#

that was a joke for apparent reasons

#

0 PRs looks nicer

gritty wind
outer oasis
#

HUH
Lancebot has no PRs

@vale ibex is Lance dead?
Are we just using @stable mountain now?

vale ibex
#

Sorry, there is still 1 pr open

#

It's not a dead repo yet

outer oasis
#

I see
I'll go close it
Thanks

clever wraith
gritty wind
#

Visibility is questionable but it offers quite a few nice benefits

#

First is each question gets a channel which is nicer for history

#

It’s easier for users to find their channels, and it’s easier for them to claim since it’s a native feature

#

It’s much easier to archive and search through the archive

#

There isn’t a real limit to the number of channels, so we can stop running out

#

It’s a collection of smaller problems that have caused us a lot of pain

cold island
#

No two people trying to claim the same channel, can filter by tags, no need to restart the cog whenever some hiccup causes there to be less than three available channels

#

It won't stop functioning because of API issues

vale ibex
#

and we get to delete/disable a bunch of code

rapid swallow
#

and claimant gets an op tag which is a frequently requested feature for our help system.

vale ibex
#

yea, one day we might get forum channels in our test server

clever wraith
#

Sounds awesome,
Thanks folks!

#

Are we currently planning the migration?

vale ibex
#

yea we are, we just don't have a test server with them enabled so can't do much beyond planning

fossil veldt
#

lolwut

outer oasis
thorny obsidian
fossil veldt
vale ibex
fossil veldt
#

the rule fix pr

timid sentinel
#

i've noticed that before

vale ibex
#

guess web is different

timid sentinel
#

yeah it's the app on mobile

fossil veldt
#

GitHub mobile just broken I guess

#

someone must have forgotten a string format πŸ₯΄

vale ibex
#

Ah yea, i get the same

fossil veldt
stable mountainBOT
#

snekbox/nsjail.py lines 117 to 122

while nsjail.poll() is None:
    chars = nsjail.stdout.read(self.read_chunk_size)
    output_size += sys.getsizeof(chars)
    output.append(chars)

    if output_size > self.max_output_size:```
timid sentinel
#

Looks like it could be if .read takes a number of characters to limit to but the code wants to limit to a number of bytes?

#

But I think that wouldn't work to do that anyway

#

because iirc the number of bytes that each character in a string takes up is determined by the highest number of bytes needed by any character

#

So sys.getsizeof(''.join(output)) could be quite a bit bigger than output_size

tawdry vapor
fossil veldt
#

hm, okay

tawdry vapor
#

There should be tests for this already. Unless those are flawed, I think this code is fine

fossil veldt
#

Here's my idea so far for a transmission scheme for sending files over stdout to snekbox

// Fixed Header
[0]         01 "<SOH>"
[1]         1C "<FS>"
[2:5]       73 6E 65 6B "snek"
[6]         1D "<GS>"
// Version
[7]         00

// File name size (big endian uint32)
[8:12]      00 00 00 0C (12)
// File name (utf-8)
[13:A]      ..
[A+1]       1F "<US>"

// File size (big endian uint32)
[A+2:A+13]  00 00 17 D9 (6105)
// File bytes
[A+14:B]    ..
[B+1]       17 "<ETB>"
cold island
#

Is the idea to make the bot post the file in chat as part of the result?

tawdry vapor
#

Are you working on a separate issue?

tawdry vapor
cold island
#

@last patio wdym by authentication? it seems to work and the bot is able to connect, so I'm assuming it's fine

last patio
#

then its god

#

mega nette Berge

#

*merge merge merge

woeful yew
#

quick suggestion: make !rule hw an alias to !rule 8

austere hornet
#

Pretty sure that's already a thing

#

!rule hw

stable mountainBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

austere hornet
#

Oh, I guess not

#

I thought there was a PR for it...

plush birch
austere hornet
dusky shoreBOT
plush birch
thorny obsidian
austere hornet
#

Ahhh gotcha, mb

fossil veldt
#

and we'll also need a python instance side package to encode the file output and send it to stdout

vale ibex
#

The alternative is to delete the warning message itself after timeout

sharp crag
#

if it's only restricted to the mod who ran the ban command on a helper it might be overkill

vale ibex
#

Yea, it has two benefits, it both allows easy checks, but also it removes the button form the message on timeout

#

rather than leave the button there that doesn't work

sharp crag
#

sounds good, will do

#

should be a small PR

vocal wolf
#

@sharp crag awcCarpet

sharp crag
worldly gate
#

@static canyon hi

static canyon
#

So, have you already made the changes? @worldly gate

#

And if so, where did you do them?

worldly gate
#

i forked the repo and clone it to local system but the changes were small so I have changed the code in github itself but not saved yet

static canyon
#

I myself have made the mistake of thinking "it's small, so it won't matter" but it does definitely help doing it locally

#

I'd also say to keep spacing consistent with how it is now, so only one blank line above the self.add_reactions()

worldly gate
#

ok

worldly gate
#

is it okay now?

static canyon
#

Make sure that you're not on the main branch too

#

Before committing, you can do poetry run task precommit, which will install commit hooks that basically prevents you from committing code to the project that has lint errors (such as unused imports)

static canyon
#

It's saying it's going from your branch into the pydis main branch

#

Which is what you want

worldly gate
#

do I have link issue with pull request?

vocal prairie
#

just make "Closes #issuenumber." the first line of the PR

worldly gate
vocal prairie
#

you need a space there, and no link

#

github will autolink

worldly gate
#

ok thanks @static canyon and @vocal prairie

static canyon
fossil veldt
#

@sharp crag when a ban is actually applied the button seems to stay there forever? pithink

sharp crag
#

Ah shoot, does it? Let me check

fossil veldt
#

feel free to use not ionite as test subject :p

sharp crag
#

No need I think it should be a one line change

#

@fossil veldt fixed & pushed, ty for feedback

fossil veldt
#

banned myself again and crashed discord

sharp crag
#

oops

#

i broke discord

#

again

fossil veldt
#

I guess their codebase has even more problems πŸ₯΄

sharp crag
#

me when the crash exploit hacker

obsidian patio
#

I'm trying to run bot using docker, but get a ModuleNotFoundError: No module named 'botcore' error

#

Any ideas how to solve it?

static canyon
obsidian patio
#

I did that earlier, but how would that help when using docker?

static canyon
#

Right, I meant to say docker-compose run bot --build

thorny obsidian
#

When was the last time you pulled and rebuilt the image?

static canyon
obsidian patio
static canyon
obsidian patio
#

If there are no containers, it should build

atomic ivy
#

no, it just spins up a container from the existing image

thorny obsidian
#

So you might still have to rebuild a new image. Deleting the container is different

static canyon
obsidian patio
#

It's working in the background while we speak

atomic ivy
#

you might need docker compose build --no-cache --pull

#

for building the image from scratch

static canyon
atomic ivy
#

up --build doesn't invalidate the layer cache

static canyon
atomic ivy
#

the concept thanks to which you copying in requirements.txt and pip installing it doesn't need to be done again if you don't change it afterwards

static canyon
#

Right, but wouldn't that mean that doing what I sent wouldn't fix requirements then (when it has for me) if it doesn't invalidate the layer cache?

atomic ivy
#

if they do have the right poetry.lock, but still get that error, it wouldn't trigger the poetry install again

obsidian patio
#

Progress. There's a new error

static canyon
atomic ivy
#

hmmm, that's strange

static canyon
atomic ivy
#

if you do poetry install on the host, does it update the poetry.lock? if yes, then you have an outdated poetry lock

obsidian patio
#

It's giving me this now: ```
bot_1 | redis.exceptions.ConnectionError: Error -3 connecting to redis.default.svc.cluster.local:6379. -3.
bot_1 | 2022-10-30 17:29:04 | bot | CRITICAL | Unknown Startup Error Occurred.

#

I have a feeling that a faulty config might be to blame?

atomic ivy
atomic ivy
static canyon
atomic ivy
#

that's definitely weird to me

static canyon
#

I guess because PyCharm uses a venv? So poetry install is installing to the venv, and docker isn't using the venv?

#

But then each re-run does it, when theoretically only the first should because then the stuff is installed 🀷

atomic ivy
#

the docker image is now (since the poetry 1.2 upgrade) using a venv (not the same venv as the host)

obsidian patio
#

The one I got in #helpers is giving me this issue

static canyon
atomic ivy
#
<aside>
πŸ’‘ If the bot is running on docker, make sure to update these lines in the file below:

1. `site: &DOMAIN "localhost:8000"`β†’ `web:8000`

2. `snekbox_eval_api: "http://localhost:8060/eval"` β†’ `"http://snekbox:8060/eval"`

3. `host: "localhost"` β†’ `host: "redis"`

</aside>

<aside>
πŸ’‘ To persist Redis data, set `use_fakeredis` to `false`.

</aside>
#

this is what the Notion page says

obsidian patio
#

Done that now, but still getting the same error

static canyon
obsidian patio
timid sentinel
static canyon
atomic ivy
obsidian patio
#

No clue. I'll send my current config here

outer oasis
#

Change these two for docker compose

obsidian patio
outer oasis
#

FAKE_REDIS didn't seem to work for me

timid sentinel
obsidian patio
#

Yeah

#

And bot_1 keeps sending the same error over and over again

timid sentinel
#

still the redis.exceptions.ConnectionError: Error -3 connecting to redis.default.svc.cluster.local:6379. -3. error? Are you definitely editing the config.yml not default-config.yml, and saving the file?

barren zodiac
#

does anyone have an example of the flake8 action annotations

#

perhaps a screenshot

#

of when ci fails and it annotates it

timid sentinel
#

that's weird

#

is there a line in the logs saying Found `config.yml` file, loading constants from it.?

obsidian patio
timid sentinel
#

If it finds the config.yml it should print out that log line, not finding it would explain why you're getting a redis error.

#

I don't know why it wouldn't find it though

obsidian patio
#

No clue

trail cradle
#

Dang y’all killing children while working on nsjail?

outer oasis
#

You aren't?

gritty wind
#

Pip-tools throws the most random ass NoneType error if the python version is mismatched

#

Upgrading everything does resolve it tho so

tawdry vapor
#

@gritty wind I am aware of the coveralls action but my concern was that we will not control which version of coverage.py it uses, which may cause problems if there is a significant change between our version and theirs.

gritty wind
#

That's a fair concern, however I don't think it works like the python action

#

Under the hood it's javascript and it just uploads the lcov files as is which are processed by coveralls itself

#

I'm not sure why the coveralls package doesn't do that tbh

#

Oh I forgot to generate it lol

tawdry vapor
#

Hmm okay let's try it then

gritty wind
#

We still generate the lcov report with our own coverage fwiw

#

Force push now just upgraded the black version in the initial commit with all the other upgrades, and added the missing instructions to the workflow

#

Ah I need to bump black now

tawdry vapor
#

So it has its own coverage parser rather than relying on coverage.py for parsing?

gritty wind
#

Well, not really it doesn't parse it per-se

#

Rather we generate the lcov report that's normally expected by the website

#

Actually I think I understand the package now, it literally just calls coverage lcov and uploads the result

#

I unpacked that to explicitly call coverage now and upload using the action instead

#

The coveralls package would fail so frequently I guess because there isn't a good programmatic way to call the report generation function? That part I don't understand yet

#

this is a nice benefit

gritty wind
#

Seems black doesn't respect the configuration in pyproject, at least as far as the version stuff is concerned

#

Doesn't seem to respect it in the pre-commit file either

gritty wind
#

Github actions deprecated so much stuff, it's made the summary window basically useless

gritty wind
#

@tawdry vapor any idea why actions are failing?

The workflow is not valid. python-discord/snekbox/.github/workflows/lint.yaml@dfa6f9f667d896a23acf1ec7e832acf12f869134: While scanning a multi-line double-quoted scalar, found wrong indentation. Unexpected type '' encountered while reading 'root'. The type 'MappingToken' was expected.

#

But it doesn't touch anything related

tawdry vapor
#

No, I'm not sure

#

The lint workflow is identical to the main branch besides changing the python version

#

I don't see why changing 2 characters would make it fail to parse

gritty wind
#

I suspect it might be pointing to the wrong file, but I don't see why/how

#

I wish there was a good way to test action stuff, beside pushing and waiting for it to rhn

tawdry vapor
gritty wind
#

woah

#

Ah it does not support reusable workflows

#

I wonder if I can get it to use the specific workflow

#

Yeah it ran fine locally

#

Yeah I've dropped all commits and it's still failing, I think actions is just borked

#

Alright, managed to fix it

#

Here is the bug, clearly:

diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml
index b4b69ac..cccdb89 100644
--- a/.github/workflows/lint.yaml
+++ b/.github/workflows/lint.yaml
@@ -29,8 +29,8 @@ jobs:
         with:
           path: ${{ env.PRE_COMMIT_HOME }}
           key: "precommit-0-${{ runner.os }}-${{ env.PRE_COMMIT_HOME }}-\
-          ${{ steps.python.outputs.python-version }}-\
-          ${{ hashFiles('./.pre-commit-config.yaml') }}"
+            ${{ steps.python.outputs.python-version }}-\
+            ${{ hashFiles('./.pre-commit-config.yaml') }}"
 
       # Skip the flake8 hook because the following command will run it.
       - name: Run pre-commit hooks
#

Thanks github

last patio
#

Thank you Scaleios πŸ”₯πŸ”₯πŸ”₯πŸ”₯ You The Man

rapid swallow
#

to see if the config is updated

rapid swallow
#

or you could try running the with docker compose up --build --force-recreate

vale ibex
#

Not sure if anyone has asked yet, but are you sure the config.yml you are editing is in the project's root dir? (The same dir as config-default.yml)

#

it would be worth double checking that is the case, rather than assuming you've already checked that, just to be sure

vale ibex
fallen patrol
#

some internal change by github

#

probably means you'll have a lot of changes to make across a bunch of repos until tests pass again

thorny obsidian
#

Our test server, despite being community enabled, does not have forum channels.

green oriole
#

Don't forget to upgrade your control panel OpenSSL version

#

in most cases it is vulnerable to self signed segfaults

#

because certificate parsing is done without establishing a chain of trust

fallen patrol
#

its been 326 8h 6m 27s since joe glitched github, lmfao

vocal wolf
last patio
#

helo, on my way, thanks

timid sentinel
#

we did it

timid sentinel
dusky shoreBOT
timid sentinel
#

bookmark the moment to remember it forever

last patio
#

legend πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯

fallen patrol
#

what was the reason to get rid of the πŸ“Œ emoji from the button? this text seems verbose

timid sentinel
#

I guess it's a bit more clear, especially since discord already has the concept of "pins", which isn't what it does.

fallen patrol
#

fair, i suppose

#

this is my implementation

timid sentinel
#

yeah, that works quite nicely too

vocal wolf
sharp crag
#

i've wanted this forever

sharp crag
vocal wolf
#

n0

vocal prairie
vocal wolf
vocal prairie
#

wait no

#

i thought you were going to say no

#

now i have to do work

vocal wolf
#

lmfao

vocal prairie
#

i'll do it assuming docker actually works

vocal prairie
#

...i was wondering why docker wasn't appearing in wsl when it was enabled until i realized i didn't have it installed >.>

#

oh yes i remember now. i forgot to install it because i was trying to figure out why its website though i was on macos.

vocal prairie
#

i give up, docker doesn't want to play nice

#

i'll open an issue at some point

clever wraith
#

I was thinking of making a guide for how to add Python to Path on Windows, which I see come up a lot in help channels, and I can never find an article on google that mentions all the details fully.

thorny obsidian
# clever wraith Hey, is making more guides (https://www.pythondiscord.com/pages/guides/) somethi...

Yes, I think that would be both helpful and definitely worthwhile.

For the specific thing you mentioned, there is this open Pull Request, if you want to take a look and provide a review/comments/suggestions: https://github.com/python-discord/site/pull/773

GitHub

This is intended as a step towards closing these issues:

python-discord/meta#116
python-discord/meta#165
python-discord/meta#191
python-discord/meta#189
python-discord/bot#2239
python-discord/bot#...

clever wraith