#dev-contrib

1 messages Β· Page 179 of 1

vale ibex
#

add an /etc/docker/daemon.json with {"experimental": true}

frozen galleon
#

I don't think that's enabled on my server, and yet it built there

#

but ok

vale ibex
#

yea not sure if it will change anything

#

fwiw ```
chris@mercury:~/src/pixels$ sudo docker version
[sudo] password for chris:
Client: Docker Engine - Community
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:02:57 2022
OS/Arch: linux/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:01:03 2022
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit: v1.1.2-0-ga916309
docker-init:
Version: 0.19.0
GitCommit: de40ad0

#
chris@mercury:~/src/pixels$ docker-compose version
docker-compose version 1.25.0, build unknown
docker-py version: 4.1.0
CPython version: 3.8.10
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
frozen galleon
#

yeah, it's getting stuck with experimental too

frozen galleon
#

it also doesn't even show the other details, like docker-py version

#

with docker alone the versions do match exactly

vale ibex
#

sec, installing v2

frozen galleon
#

yeah, the server is on 1.26

#

where it did work, so it might actually be docker-compose issue

vale ibex
#
chris@mercury:~/src/pixels$ ~/.docker/cli-plugins/docker-compose version
Docker Compose version v2.6.1
#

built it fine

frozen galleon
#

that's so weird then

vale ibex
#
chris@mercury:~/src/pixels$ ~/.docker/cli-plugins/docker-compose version
Docker Compose version v2.6.1
chris@mercury:~/src/pixels$ ~/.docker/cli-plugins/docker-compose build
[+] Building 28.1s (12/12) FINISHED                                                                                                                                            
 => [internal] load build definition from Dockerfile                                                                                                                      0.0s
 => => transferring dockerfile: 921B                                                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                                                         0.0s
 => => transferring context: 176B                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/python:3.9-slim                                                                                                        0.0s
 => [1/7] FROM docker.io/library/python:3.9-slim                                                                                                                          0.1s
 => [internal] load build context                                                                                                                                         0.1s
 => => transferring context: 231.38kB                                                                                                                                     0.0s
 => [2/7] RUN pip install -U poetry                                                                                                                                      12.2s
 => [3/7] WORKDIR /pixels                                                                                                                                                 0.0s
 => [4/7] COPY pyproject.toml poetry.lock ./                                                                                                                              0.0s
 => [5/7] RUN poetry install --no-dev                                                                                                                                    14.8s 
 => [6/7] COPY ./gunicorn_conf.py /gunicorn_conf.py                                                                                                                       0.0s 
 => [7/7] COPY . .                                                                                                                                                        0.0s 
 => exporting to image                                                                                                                                                    0.8s 
 => => exporting layers                                                                                                                                                   0.7s 
 => => writing image sha256:e487c225216fc1a11379b3d924e7b0511e1e357f852752652ccc5e97b5a23e68                                                                              0.0s 
 => => naming to docker.io/library/pixels_pixels                                                                                                                          0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
frozen galleon
#

there were some weird retry issues with pip install -U poetry

vale ibex
#

could you remove --no-dev from the dockerfile and try to build again?

fallen patrol
#

what's the holdup of using forum channels here?

frozen galleon
thorny obsidian
#

We have no way of testing it without testing in prod re: forum channels

fallen patrol
#

there's no difference between normal threads and forum threads

thorny obsidian
frozen galleon
fallen patrol
#

ok

#

I'm just saying there's no difference between the two kinds of threads from an api perspective lol

#

code will work with both

thorny obsidian
frozen galleon
#

ok so, I managed to actually get past build when I did this: ```dockerfile

Install project dependencies

COPY pyproject.toml poetry.lock ./
RUN poetry export > requirements.txt
RUN pip install -r requirements.txt

#

when installing the dependencies through pip there are no problems, it only hangs when going through poetry install

hoary haven
#

machine/OS specs? which repo? (mostly just curious)

#

there are a few things that yeah, i'd just resort to pip installing

frozen galleon
#

it's python-discord/pixels, and I run arch linux with 5.18.10-arch1-1 kernel

hoary haven
#

oh this is in the docker build process..?

frozen galleon
#

yeah

#

there shouldn't be any reason why poetry install should be failing here

hoary haven
#

which was supposed to forever alleviate our "it works on my machine!" problems haha

frozen galleon
#

yeah lol

hoary haven
#

wild

fallen patrol
#

@frozen galleon build without cache

frozen galleon
#

I did

fallen patrol
#

you need poetry 1.1.14

#

all versions before that version are now not really useable

frozen galleon
#

the thing is, this should just pull in latest poetry

#

and it works on another machine with the same dockerfile

fallen patrol
#
frozen galleon
#
FROM --platform=linux/amd64 python:3.9-slim

# Set pip to have no saved cache
ENV PIP_NO_CACHE_DIR=false \
    POETRY_VIRTUALENVS_CREATE=false \
    MAX_WORKERS=10

# Install poetry
RUN pip install -U poetry

# Create the working directory
WORKDIR /pixels

# Install project dependencies
...
#

the dockerfile just installs poetry with pip install -U poetry that should pull in the newest version

frozen galleon
#

and yet it still hangs on sniffio

icy rain
#

create a program and inform if the number is in the alphabet, is alpha, is numeric or is alphanumeric

#

Im trying

#

But that progr is hard to create

#

program

#

help me

#

im learning phyton from youtube

atomic ivy
fossil veldt
#

@outer oasis um, should bot/exts/fun/fun.py -> _get_text_and_embed not have an underscore / be private?

stable mountainBOT
#

bot/exts/fun/uwu.py line 130

text, embed = await fun_cog._get_text_and_embed(ctx, text)```
fossil veldt
stable mountainBOT
#

bot/exts/fun/uwu.py line 63

def _word_replace(self, input_string: str) -> str:```
outer oasis
# fossil veldt also, is there a reason these aren't static methods? https://github.com/python-d...

So...
A guy that had never used Python decided he didn't like the way this command worked, so he learned just enough Python to rewrite it.
And... then he quit.... so I finished the review comments, and then we merged it.
_get_text_and_embed was already there, from the original implementation
I don't even know where it's from. I tried searching both python-discord/sir-lancebot and Rapptz/discord.py and I didn't get any results

fossil veldt
#

is there a reason for that at all? Can't fun.Fun(Cog) be directly imported and referenced?

#

like I don't know how much refactoring I'm allowed to do here πŸ˜…

outer oasis
#

I personally don't quite understand the repo at that scale yet
But I think that'll break it because it's loading the actual object in runtime [or something like that]

#

Hi Chris

#

The red names are here to save us

vale ibex
#
import typing as t

if t.TYPE_CHECKING:
    from bot.ext.fun import Fun

...

fun_cog: t.Optional[Fun] = bot.get_cog("Fun")
#

that fixes type hints

fossil veldt
#

can I add that in my fix?

stable mountainBOT
#

bot/exts/fun/fun.py line 154

async def _get_text_and_embed(ctx: Context, text: str) -> tuple[str, Optional[Embed]]:```
vale ibex
outer oasis
#

I was right!
I love it when that happens

vale ibex
vale ibex
#

Ah, so it would be from bot.ext.fun.fun import Fun

fossil veldt
#

well it would be exts? or

#
from bot.exts.fun.fun import Fun
atomic ivy
#

thrice the fun

atomic ivy
vale ibex
#

yea that's right

fossil veldt
#

the original usage was in a walrus, so added it here

fun_cog: t.Optional[Fun]
if fun_cog := ctx.bot.get_cog("Fun"):
#

is that fine? Or should it just be assigned on the first line, and if fun_cog: after

vale ibex
#

if you're doing that, then you might as well remove the walrus

#

Yea, just assign it on the line above

fossil veldt
#

the lines

[137] fun_cog._get_text_and_embed
[141] fun_cog._convert_embed

are still accessing protected members though

#

should the fun_cog functions be renamed? or...

vale ibex
#

probably shouldn't be marked as local like that if they're being used in other places

outer oasis
#

Hmm
According to my search, the function is only being used by the one command
Could it just be moved inside the uwu cog?

fossil veldt
fossil veldt
outer oasis
#

Oh I see

#

Welp

static canyon
#

Can I please get approval for bot-core#100

dusky shoreBOT
vocal wolf
#

I was just about to ping you about stuff lol

#

nice to see that you're back m8

static canyon
#

Thanks πŸ˜„

vocal wolf
#

Would you like to take a PR or two back from up for grabs?

vocal wolf
static canyon
vocal wolf
#

That's alright, I hope you enjoy your holiday!

#

so the ones that you've re-obtained are bot#2031, bot#2089

dusky shoreBOT
static canyon
#

Cool, thanks

vocal wolf
#

and also if you really want to go back in time, sir-lancebot#919 still exists

static canyon
#

Could you reassign me so that I'll get an email for reference (if you haven't already)

dusky shoreBOT
static canyon
vocal wolf
static canyon
static canyon
vocal wolf
#

it is done

static canyon
#

Thanks

vocal wolf
#

No, thank you

static canyon
#

To-Do: bot#2031 bot#2089 sir-lancebot#919 sir-lancebot#1074 bot-core#100

Edit: also bot#2168

vocal wolf
#

oh dear

#

lol

static canyon
#

lol

#

There's other PRs too but I think people took over them

vocal wolf
#

there's only 2 PRs that you have on bot rn

static canyon
#

Like I had an issue which I was helping on for being able to specify end time in reminders on @stable mountain

outer oasis
# dusky shore

...why aren't these in the same order as @static canyon' original message?

static canyon
outer oasis
#

y

static canyon
#

Because they get put in a set to ensure there's no duplicates

outer oasis
#

Fair enough

static canyon
#

Could be nice I guess

#

Feel free to write an issue if you'd like to @outer oasis

vale ibex
#

list(dict.fromkeys(some_list))

static canyon
stable mountainBOT
#
Sure.

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

outer oasis
dusky shoreBOT
static canyon
outer oasis
#

Do we need approvals for bug fixes too?

static canyon
#

I believe so

#

RE bot-core#100: Is there a preference as to whether the new converters.py file in bot-core should be at botcore/converters.py (following structure of bot) or botcore/utils/converters.py (following structure of sir-lancebot)?

dusky shoreBOT
outer oasis
#

Personally, I prefer the utls sub-package, if only for organizational purposes - I dislike having things in the roots of projects

static canyon
#

Yeah, I prefer /utils too

#

I'll go for that then πŸ‘

#

It's been a while since I did dpy and can't quite remember how the signature of converters works. I know it's async def convert(self, ctx: Context, argument: str): but would argument here actually be Optional[str] since the idea is that you do one thing or another depending on whether argument is actually provided?

#

Or would I need to do the logic in the command's argument typestring i.e. text: Union[str, RepliedMessageContent]?

outer oasis
dusky shoreBOT
outer oasis
#

I actually forgot that existed
I've only had someone mention it to me once... it might actually have been you

fossil veldt
#

it works :D

static canyon
#

Nice! Does it work with animated emojis too? (and still work with default) @fossil veldt

static canyon
#

Nice! Good job :)

#

Looks like we have another PR incoming πŸ˜‰

fossil veldt
#

so um, I had to use a class method

#

I wasn't sure if I should use futures annotations or a string representation?

static canyon
#

You shouldn't need either since the bot runs on 3.10?

#

Or am I getting confused

brazen charm
#

you need it on 3.10, and the bot doesn't run on 3.10

outer oasis
#

Lance made it to 3.10?

static canyon
#

Huh, wrong on both accounts

#

Good job from me lol

fossil veldt
brazen charm
#

if it's a file with commands future annotations can potentially break things, but I usually use those

stable mountainBOT
#

Dockerfile line 1

FROM --platform=linux/amd64 python:3.9-slim```
outer oasis
#

Yeah, 3.9 still

fossil veldt
#

like if you wanted to reference that class itself in a classmethod return result, even in 3.10 you need the future import

#

I guess I'll just use strings for now, since I don't see any other module use future.annotations

molten perch
#

Hey, I'd appreciate reviews on sir-robin#50 it's not top priority, but would be a nice to have feature.

dusky shoreBOT
outer oasis
molten perch
#

You just add it to the dependencies, via poetry add

#

The emojis package was added.

outer oasis
#

Nothing special, I just add it to the same PR?

molten perch
#

I believe so, yes.

#

As it strongly relates to your PR

wide elm
#

Hey, so I've forked and cloned lancebot, and when I try to run the bot with docker, I get ```
sir-lancebot | /usr/local/bin/python: No module named bot

fossil veldt
#

the python -m bot is failing I assume, somehow

wide elm
#

mhm

#

maybe I'll try running with poetry

#

yeah that seems to have worked

fossil veldt
#

so um, sir-lancebot#1078 should be ready for review. Not sure if there's anything else I have to do pithink

dusky shoreBOT
fossil veldt
stable mountainBOT
#

pyproject.toml line 10

"discord.py" = {url = "https://github.com/Rapptz/discord.py/archive/45d498c1b76deaf3b394d17ccf56112fa691d160.zip"}```
cold island
fossil veldt
#

could we possibly upgrade aiohttp without changing our pinned discord.py version?

cold island
#

Does a newer version of dpy use aiohttp >= 3.8.0?

stable mountainBOT
#

requirements.txt line 1

aiohttp>=3.7.4,<4```
cold island
#

Then we should upgrade the dpy version. We don't use slash commands yet so I don't think it'll be too bad

fossil veldt
#

what version of dpy is that archived version?

cold island
#

It's a specific commit, you can find it if you use the hash

fossil veldt
#

Ah okay. Should I create an issue for the dpy upgrade?

stable mountainBOT
#

pyproject.toml line 11

"discord.py" = {url = "https://github.com/Rapptz/discord.py/archive/0eb3d26343969a25ffc43ba72eca42538d2e7e7a.zip"}```
vale ibex
#

I've got a branch open and slowly chipping away at it

fossil veldt
#

ah okay cool, I understand πŸ‘Œ

hoary haven
#

bot#2168 is available @static canyon if you want, though I think I saw you already picked up some other work

dusky shoreBOT
static canyon
hoary haven
#

yup i think so

static canyon
gritty wind
#

@vale ibex I was looking into your PR. Currently compose up would start all the containers, including cloning the behemoth 3.11 image. Instead, I found this https://docs.docker.com/compose/profiles/, which allows you to specify that the 3.11 shouldn't be enabled by default. That way people will only clone it if they want the 3.11 eval

hoary haven
lusty phoenix
#

heyo i know some react and was an unlucky user that got bit by a form submission bug which i fixed by going incognito but i would like to take a stab at fixing it or getting some context around it?

gritty wind
#

Heyo

#

So the issue lies with our refresh logic. Right now we're using stateless JWTs, which are refreshed in certain scenarios (when a user submits a form, or every 7 days). Since this token is saved as a cookie on the backend, the frontend bases it's state on a cookie that's saved on the frontend. The bug is caused by the frontend token not being refreshed when the backend one is removed, so we end up in a state where the frontend thinks it's logged in, but the backend does not

#

To address this, there's a fix, and a rewrite. The fix is to update the frontend token whenever we update the backend one. Since the update on submit is done by the backend and is invisible to the frontend, the backend has to do this. The rewrite is to ditch the stateless tokens, and use an opaque auth system

#

If you want to work on this, let me know. I'll create a GitHub issue, and can help you get set up

lusty phoenix
#

let me try i have done a few react apps but havent really messed with auth in detail like this but if i get more acquainted with the process and make some headway i'll give it a good try

static canyon
fallen patrol
gritty wind
#

It does react by throwing up an error page

#

If you'd like to handle the case when the error is a login issue and prompt the user to log in, you're welcome to

#

I'm working on other issues atm

fossil veldt
#

@outer oasis um, do you know if I need to request a review for sir-lancebot#1078 or is it just good to leave there? I don't think I have permission to request reviews or assign myself to the PR pithink

dusky shoreBOT
outer oasis
#

I can assign you

fossil veldt
outer oasis
#

Specifically? I'm not too sure

#

I generally just go "can I get a review plz"

gritty wind
glad zinc
#

Do the bots run on 3.10?

atomic ivy
#

yep

dim pelican
#

I think sir lance is 3.9

#

.src

dusky shoreBOT
stable mountainBOT
#

pyproject.toml line 9

python = "^3.9"```
atomic ivy
#

oh. not all bots

dim pelican
#

But @stable mountain is

#

!src

stable mountainBOT
dim pelican
#

Oh wait

#

No

outer oasis
dim pelican
#

Just the eval

atomic ivy
outer oasis
dusky shoreBOT
dim pelican
atomic ivy
#

snekbox is 3.10

glad zinc
#

Just waiting for that final project to become active again then πŸ‘€

severe tangle
#

which one

brazen charm
# fallen patrol er how?

delaying the evaluation of an annotation complicates things as it has to go through the globals

glad zinc
atomic ivy
#

is it possible to alias the inventories in the docs command?

#

as in, !d numpy.save may be aliased as !d np.save

static canyon
#

I guess we'd just need to add the docs again but under the name of np

#

If that works

#

RE bot-core#100: It's been a while since I did dpy and can't quite remember how the signature of converters works.

I know it's async def convert(self, ctx: Context, argument: str): but would argument here actually be Optional[str] since the idea is that you do one thing or another depending on whether argument is actually provided?

Or would I need to do the logic in the command's argument typestring i.e. text: Union[str, RepliedMessageContent]? And if this, what would argument be?

dusky shoreBOT
cold island
cold island
#

You can switch around the order

static canyon
#

The idea here though is you do something when the argument isn't provided. So there's nothing to pass to the converter

brazen charm
#

Adding duplicate docs won't achieve aliases, and has already been done erroneously

#

Some kind of replacement of np to numpy on missing symbols would probably work

static canyon
#

But then that doesn't use a converter, and means bot-core#100 is actually redundant

cold island
#

I think I'm missing context here

static canyon
dusky shoreBOT
#

i think i'm missing c-context hewe

static canyon
dusky shoreBOT
#
Do you mind?

Your input was invalid: text is a required argument that is missing.

Usage:```
.randomcase <text>

cold island
#

I'd just make the text optional

#

And look for a reply if it's not provided

static canyon
#

uwu allows you to reply to messages instead of providing an argument
randomcase does not, but I'm writing a PR so that it does

In the issue for randomcase, @serene flare said about using a converter to save repeated code inside the commands that have this logic

cold island
#

mmm

static canyon
#

wrong chris

#

meant admin chris

#

Sorry for ping helper chris lemon_sweat

cold island
#

Too many chrises

#

we have a chris at every level of the establishment

static canyon
#

lol

static canyon
outer oasis
cold island
wild prism
cold island
outer oasis
wild prism
#

i will submit the proper documentation after being made owner

outer oasis
#

I'm 80% sure I know your GitHub and it starts with a "C"

static canyon
#

I think ephemeral should be fine?

outer oasis
cold island
static canyon
#

We can just rebrand bot-core#100 to be a util function then

dusky shoreBOT
static canyon
#

Instead of a converter

#

Since it'd still be useful for both bots to have access to this in my opinion

outer oasis
#

Is the clean_content we have now a converter or a utility function?

static canyon
#

Or from dpy and a function (not a converter)

outer oasis
#

I see
So we are already not using a converter

#

got it

static canyon
#

Correct

cold island
#

hmmm are you sure it's not a converter?

#

I think it is

#

functions can serve as converters

vale ibex
#

could make it a convertor and call it manually, but at that point you might as well just make it a helper func

cold island
#

yeah

atomic ivy
stable mountainBOT
#

discord/ext/commands/converter.py line 891

class clean_content(Converter[str]):```
static canyon
#

But I don't suppose that really matters?

cold island
#

ah so it's a class with snake case, of course lol

static canyon
cold island
static canyon
#

I'm assuming we want this new function to go in the /utils dir, but what should be the name of the file? messages.py, commands.py?

#

I think commands is more fitting personally

static canyon
#

Should this util function raise a BadArgument directly? Or is there some reason to leave that within the command itself?

#

Raising within the util function makes typing cleaner since it'll always be -> str

#

I suppose that's not a good idea actually

#
def convert_to_cleaned_text_or_reply(ctx: Context, text: Optional[str]=None) -> Optional[str]:
    """
    Attempts to retrieve a string argument from a command invocation runs `clean_content` on it.

    Returns cleaned content of `text` if given, otherwise content of referenced message.
    If neither are applicable, returns `None`.
    """
    clean_content_converter = clean_content(fix_channel_mentions=True)

    if text:
        return await clean_content_converter.convert(ctx, text)

    if (
        (replied_message := getattr(ctx.message.reference, "resolved", None))
        and
        isinstance(replied_message, Message)
    ):
        # `text` wasn't provided, but we have a referenced message with content we can access,
        # so return `clean_content` of it
        return await clean_content_converter.convert(ctx, ctx.message.reference.resolved.content)

    # No text provided, and either no message was referenced or we can't access the content, so return `None`
    return None
```Can anyone think of a better docstring / function name? I'm struggling a bit ![lemon_sweat](https://cdn.discordapp.com/emojis/754441881718620281.webp?size=128 "lemon_sweat")
atomic ivy
#

clean_text_or_reply?

static canyon
#

Yep, that's a better function name πŸ‘

#

What do you think of the docstring?

atomic ivy
#

since we aren't really following a format for docstrings, the two sentences seem redundant

static canyon
#

It's just been really explicit as to what happens

atomic ivy
#

as in, they both more or less say the same thing

static canyon
#

Yeah, I suppose

#

Attempts to retrieve a string argument from a command invocation
Not sure this is quite accurate to what's happening

atomic ivy
#
Returns cleaned content of `text`, if given, or the content of the referenced message, or None otherwise
#

perhaps this?

static canyon
#

Yeah, that seems better

atomic ivy
#

wait. is this lancebot? isn't that on 3.9?

static canyon
#

Yeah, it is

atomic ivy
#

IDR if walrus works on 3.9

static canyon
#

If you're thinking walrus that's 3.8

#

Yeah, 3.8

#

Returns cleaned version of text, if given, else referenced message, if found, else None.
Does this seem good?

atomic ivy
#

sounds good

static canyon
#

Cool, thanks πŸ˜„

static canyon
#

It's a util that's only ever gonna be used inside commands, so I think commands.py works

atomic ivy
#

hmm. not sure. I've yet to go through sir-lancebot's directory structure, but in general, yeah. commands.py sounds alright

static canyon
#

For what it's worth this is strictly speaking for bot-core

#

I.e. can end up being used in both sir-lancebot and bot

atomic ivy
#

I usually decide if a name is good from an import perspective

static canyon
#

bot-core#100

dusky shoreBOT
static canyon
#

from botcore.utils.commands import clean_text_or_reply

#

That's for the help πŸ˜„

atomic ivy
#

np. I'm still learning d.py tbh

static canyon
#

Can someone help me with all the failing checks on bot-core#101? I don't really understand them lemon_sweat

dusky shoreBOT
fossil veldt
exotic ember
fossil veldt
#

is netlify not making an authenticated call to the github api?

dusky shoreBOT
exotic ember
#

oh, I think you have to add to botcore/utils/__init__.py

static canyon
#

I'll do that tomorrow if I get round to it, thanks

stable mountainBOT
#
Yeah okay.

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

static canyon
#

!remind 20h bot-core#100 impact on !remind

stable mountainBOT
#
Affirmative!

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

dusky shoreBOT
fallen patrol
cold island
#

I'm so confused. I'm trying to merge main into an old branch on site, the pyproject.toml and poetry.lock contain httpx, I run the site through Docker

vale ibex
#

Did you rebuild the image? docker compose build / docker compose up --build

cold island
#

ah

#

derp

vale ibex
#

hah yea the dev volume gets me like that too

#

you get so used to your changes just appearing that you forget it doesn't cover deps

cold island
#

I started searching the start up sequence of the container looking where it's installing the deps πŸ₯΄

vale ibex
#

:P

brazen charm
green oriole
#

would it be possible to add me to the page, or send me a copy or something?

#

for some reason my backend assumes pydis is the guild it is configured for

#

so yeah, that doesn't really work out

#

okay I just read the source code lmao

#

although I do not remember how you get an admin token

#

does it check for a specific role on the server

#
        self.admin = await database.admins.find_one(
            {"_id": self.payload["id"]}
        ) is not None```
#

hmmmm

atomic ivy
#

Mongo πŸ‘€

atomic ivy
#

weren't you staff?

green oriole
#

some time ago, yeah

#

but still forbbiden

#

auth is still done through the token cookie?

outer oasis
#

πŸ‘€

green oriole
#

actually, that contained a refresh token

#

this is very annoying

atomic ivy
#

Scaleios can probably help

green oriole
#
    @requires(["authenticated", "Helpers"])```
#

do I need a helper role?

atomic ivy
#

that seems like you do need it

green oriole
#

gah, that was it

#

admin should bypass that ngl

#

it would make testing much easier

#

hmm, snekbox is refusing to run, which is sadge

#
forms-backend-snekbox-1  | 2022-07-15 13:58:50,071 |     8 |     snekbox.api.resources.eval |    ERROR | An exception occurred while trying to process the request
forms-backend-snekbox-1  | Traceback (most recent call last):
forms-backend-snekbox-1  |   File "/snekbox/snekbox/api/resources/eval.py", line 87, in on_post
forms-backend-snekbox-1  |     result = self.nsjail.python3(code, py_args=args)
forms-backend-snekbox-1  |   File "/snekbox/snekbox/nsjail.py", line 190, in python3
forms-backend-snekbox-1  |     cgroup = self._create_dynamic_cgroups()
forms-backend-snekbox-1  |   File "/snekbox/snekbox/nsjail.py", line 96, in _create_dynamic_cgroups
forms-backend-snekbox-1  |     (mem / "memory.limit_in_bytes").write_text(mem_max, encoding="utf-8")
forms-backend-snekbox-1  |   File "/usr/local/lib/python3.10/pathlib.py", line 1152, in write_text
forms-backend-snekbox-1  |     with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
forms-backend-snekbox-1  |   File "/usr/local/lib/python3.10/pathlib.py", line 1117, in open
forms-backend-snekbox-1  |     return self._accessor.open(self, mode, buffering, encoding, errors,
forms-backend-snekbox-1  | PermissionError: [Errno 13] Permission denied: '/sys/fs/cgroup/memory/snekbox-7280839d-efd8-419f-af5c-12e999653e06/memory.limit_in_bytes'
#

okay

#

the unittest behavior doesn't match what I would expect though

#

did the schema change

#

soooooooooooo

#

I bypassed the unittest again? lgbeet

patent pivot
#

open a modmail for it

#

I'm not overly concerned because we are doing a manual review of submissions, and any bypass does stick out like a sore thumb

#

but hey if we can protect against it why not

#

but yeah it's not critical

green oriole
#

I don't think it can be fixed, but hey, sure

gritty wind
#

Coincidentally I did come up with something this morning

whole forge
#

Is there a reason the Python bot does github snippet embed and Sir Lancebot does issue/PR embed? those seem like very similar features and having 2 different bots respond seems kinda wierd.

thorny obsidian
#

Wasn't done intentionally, someone PRd the github embed snippet and we didn't really remember about the Lancebot issue/PR feature, so they got split even though they're related. @vocal wolf is this something we want to unite?

outer oasis
#

plus1 for uniting

thorny obsidian
atomic ivy
#

let's do a poll!

outer oasis
#

Utility functions not required for the server don't go in @stable mountain

#

Ask me a hard question

thorny obsidian
#

!poll "This poll may not matter, because Xith is our overlord, but let's vote anyway! Which should the github related stuff belong?" "Sir Lancebot" "Python" "other???"

stable mountainBOT
#
This poll may not matter, because Xith is our overlord, but let's vote anyway! Which should the github related stuff belong?

πŸ‡¦ - Sir Lancebot
πŸ‡§ - Python
πŸ‡¨ - other???

outer oasis
#

I'd also vote for !charinfo being on @dusky shore

thorny obsidian
outer oasis
#

accepted

#

It also stores reminder data in site

atomic ivy
#

who's the contrarian πŸ‘€

thorny obsidian
outer oasis
wild prism
#

charinfo occasionally comes up in moderation

outer oasis
atomic ivy
#

datas pithink

vale ibex
#

thanks

outer oasis
vale ibex
#

Nono, it only doees those two things

#

and we write it in erlang for better concurrency

atomic ivy
#

sounds like a plan

outer oasis
mellow hare
outer oasis
whole forge
#

about 2 or 3

outer oasis
#

What do we rewrite into after that?

placid ermine
#

cobol, then it lasts forever

atomic ivy
fallen patrol
brazen charm
#

the globals at definition time and when it's called may differ, it has already caused problems on the bot

vocal wolf
whole forge
#

the blessing has arrived!

outer oasis
dusky shoreBOT
outer oasis
#

thanks

stable mountainBOT
stable mountainBOT
green oriole
#

Haha

static canyon
#

bot#2031, bot#2220 and bot-core#101 are all needing reviews if anyone is free πŸ˜„

There's also sir-lancebot#1077 and sir-lancebot#1078 that were done by other members.

static canyon
static canyon
elder belfry
#

A teeny-tiny PR, sir-lancebot#1060 requires review, if anyone is willing pithink

dusky shoreBOT
exotic ember
static canyon
#

@outer oasis were you wanting to implement sir-lancebot#1079? If not I'd like to claim it

dusky shoreBOT
cold island
outer oasis
static canyon
outer oasis
#

I'll just hover around it for now to see how you do it; I'm still learning about these bots

static canyon
static canyon
static canyon
#

Ah yes

#

Thanks

#

Fyi I think only core-devs are supposed to assign people to issues @outer oasis

#

That could be wrong though

outer oasis
#

Ah

#

Fair enough

#

πŸͺ§ @outer oasis for core dev

static canyon
#

I don't think it matters in this case, but certain issues require certain access etc. to properly implement

outer oasis
#

right, right

static canyon
#

Just to be safe, can a core-dev please confirm I can work on sir-lancebot#1079?

dusky shoreBOT
hoary haven
outer oasis
thorny obsidian
hoary haven
green oriole
#

Hmm, I should do some contribs again

#

Unless there is still a large review backlog?

#

Reviews are a nice change of pace

#

Anything worth looking at in priority?

gritty wind
#

If you’d like, I’ve got a PR up on site to fix the static preview issues

#

It’s pretty chonky

molten perch
#

I have a simple-ish Sir Robin PR as well, it's mostly components and API reqs..

cold island
#

ideas? the file literally doesn't exist. I'm trying to create it

#

nvm

static canyon
#

But they should all be okay since there wasn't any big changes

I'll get that done tonight/tomorrow hopefully

#

3 of my assigned ones just need testing and reviews, 1 I'm needing some help (someone requested something I'm not sure how to do), and another one I'm working on in the background

timber meadow
#

the !paste command says "... typing ctrl + S ...", i think it should say "... pressing ctrl + S ..." instead since you dont "type" key combos. i know this is an extremely minute issue but i thought id bring it up anyway

atomic ivy
#

Could anyone assign/confirm that I can work on bot#2222?

dusky shoreBOT
atomic ivy
#

(also, let me know if I should add anything else to the issue description)

gritty wind
#

Ideally please add content to the body so it’s clear what’s going to be happening. Something like:

Allow adding embedable media to tags as per meta#…

I’m not sure what it is you’re going to be doing here

atomic ivy
#

of the two approaches to make meta#187 possible, I thought adding support to embed media in the tag responses would be good idea.

dusky shoreBOT
gritty wind
#

But i don’t know what you’re actually suggesting here πŸ™‚

For instance, how will a tag with a video look like?

#

Look like in the code base*

atomic ivy
#

I kinda don't understand what you're asking there πŸ˜…

gritty wind
#

I get that you’re trying to add videos and images to tags, but how are we actually going to go about doing that

#

Will the tags have text and videos, or will it be the tag system with just videos

#

If it’s the former, will the code read the MD tag, find links, and embed them, or is this going to be a meta field

atomic ivy
#

ah. okay

#

tbh I actually haven't thought about that πŸ˜…

#

I'll explore the possibilities and add them in the issue

gritty wind
#

Please do, I’ll happily go over what you come up with when it’s ready

vale ibex
stable mountainBOT
#

bot/exts/utils/snekbox.py lines 371 to 376

if ctx.author.id in self.jobs:
    await ctx.send(
        f"{ctx.author.mention} You've already got a job running - "
        "please wait for it to finish!"
    )
    return```
brazen charm
#

That should work fine, but I'm not sure if the command is a good fit for the decorator, at least with its current structure where it waits for the job to be reevaluated

vale ibex
#

That's a good point, only the send_job should have a lock really

#

hmmmm, even the logs within the lock module aren't being output to console

brazen charm
#

tried it locally and it seems to work fine here

vale ibex
#

i am dumb

#

&int e vs &e

atomic ivy
#

perhaps, an embed with the content as description plus a media link?

gritty wind
#

Do you know who created the gif?

#

I vaguely remember first seeing it from fix

atomic ivy
#

not really. it's also an mp4

#

also, which one do you prefer a link instead of an embed or an embed + link?

gritty wind
#

I’m trying to figure out the logistics of sending it. If we just have it as media, with no copyright and no info, I don’t think I can recommend using it in good conscience

vale ibex
gritty wind
# atomic ivy also, which one do you prefer a link instead of an embed or an embed + link?

Alright, in that case I think we should ask them for input on the matter before making a decision on ^. If they allow us to just send it as is, I think it’s best to just send the video directly. If they ask us to credit them in some form, I think we should add an authors meta field, and have the bot send the video as well as text under it saying By: …

#

I don’t think we should send just a link. That would it make it pretty easy for this to break

atomic ivy
#

sounds good

vale ibex
#

we could also just convert the mp4 to a gif

atomic ivy
#

I'm actually trying just that, but IM is taking some time with it

#

but the attribution issue still remains

atomic ivy
whole forge
#

im like, severely lacking context. whats the topic?

thorny obsidian
#

The gif/video that illustrates functions and returns that you helped with, we want to embed it into a tag

whole forge
#

ahhh, okay

vale ibex
#

We just want an ok from both of you, since it's your content :)

whole forge
placid ermine
#

im fine too

atomic ivy
#

sorry for the lack of context 😬

#

thanks both for the quick reply!

gritty wind
#

Cool, cool. The approaches mentioned so far sound fine, I’ll leave the approach and media format up to you. The more I think about it, it’s probably good to add the authors field either way, if we end up using it for future media, but you don’t have to add it in this PR

atomic ivy
#

yep. yep. was just typing that out

#

I'll check on the GIF embedding

outer oasis
#

How does @stable mountain generate a command for each tag?

gritty wind
#

It doesn’t necessarily generate a command

#

But the error handler for CommandNotFound

#

Checks if any tag names match

outer oasis
#

oh

#

That's smart

atomic ivy
#

btw is there a faster way to test changes than reloading the cog everytime you make a change?

thorny obsidian
#

not really, but !c r tags is about the shortest you can do

atomic ivy
#

cool cool cool

gritty wind
brazen charm
#

!int e the tag in, should just take a path

vale ibex
#

moved the delete emoji to a button

#

so it takes up less vertical space

surreal veldt
#

Like how the src command displays bot source, is it possible for a command that shows the python source code of input be made?

gritty wind
#

The reason we can show our source code is because it’s, a. all in python, and b. its location at run time is it’s actual location. This means that we can easily convert a class or variable or function to a location

#

That isn’t easy to do with python. We might be able to get some of the symbols that are implemented in python to work, which would include most of the stdlib, but a lot of python is C. The version of python we run is also not going to match the latest python version on GitHub, because we aren’t building from source, so we’d realistically only be able to link things we currently can see

vale ibex
gritty wind
#

Ultimately I think you’re better off just searching the python code base

#

GitHub has a new tool for searching code. I’ve tried it with cpython and it’s pretty good. That still in beta though

vale ibex
#
Warning, treated as error:
C:\Users\chris\src\bot-core\botcore\utils\interactions.py:docstring of botcore.utils.interactions.DeleteMessageButton:7:py:class reference target not found: discord.enums.ButtonStyle
#

this is annoying

#

I'm guessing this isn't part of their objects.inv

#

I forget, was there a way to manually link to docs?

#

Ah style (:literal-url:`ButtonStyle <https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.ButtonStyle>`): The style of the button. seems to have done it

atomic ivy
#

does just discord.ButtonStyle not work? instead of discord.enums.ButtonStyle

vale ibex
#

Nope, sphinx always auto resolves to the verbose name

atomic ivy
#

oh

vale ibex
#

at least with the setup we currently have

#

not sure if that can be changeed

#

bot-core#103

dusky shoreBOT
vale ibex
#

Included screenshot of changelog and docs in PR, in case netlify doesn't build

molten perch
#

Will review later today.

gritty wind
atomic ivy
#

welp. the GIF is > 2 MB even when optimized with gifsicle 😬

gritty wind
#

Alright thanks for trying

#

Feel free to go ahead with the video approach

vale ibex
#

actually, use this one, it has the first 2s skipped

#

ffmpeg -i .\printreturn.mp4 -ss 2 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif fwiw

thorny obsidian
#

ffmpeg πŸ™

vale ibex
#

The ancient magicks

#

@gritty wind Did I mess up the changelog? πŸ˜…

#

I'm missing the joke here I think lol

gritty wind
#

Lol just meant that if the review was 30 minutes later it would be out of date

vale ibex
#

nah dude we use UTC around these parts

#

well, we use whatever tz is the most convenient to back up our points

gritty wind
#

Just don’t go looking

gritty wind
#

We are in all time zones

vale ibex
#

rekt

vale ibex
gritty wind
#

Lmfao

#

We don’t use screaming case round these parts

#

This is fake

#

Fake news

vale ibex
#

@last patio does

#

he's the only one here who follows pep8 for constants

gritty wind
#

Hah

last patio
#

!!!!!!!!!

gritty wind
#

This is a code review

#

Just 4 years late

#

Plz fix

vale ibex
gritty wind
#

As long as we agree it’s volcy’s problem

vale ibex
#

agree agree

vale ibex
#

@tawdry vapor await interaction.response.defer() is a thing that means we don't need to use a task for run_job

#

very cool

tawdry vapor
#

indeed

vale ibex
#

Found another fun error if the user edits code, click the re-run emoji and then very quickly clicks the Run in X button before the message is deleted

#

solved with a suppress on the interaction.message.delete()

#

The lock arg covers stops actual job from running

cold island
#

Why do you need to defer?

vale ibex
#

because there are wait_fors listening for message_edits to re-run code

#

and those block the run_job call from returning until the timeout

#

So the callback on the button doesn't return until the timeouts on those are finished

#

the interaction is only ACKd by d.py after the callback returns

cold island
#

mmm the view should be a separate task no?

vale ibex
#

it doesn't break anything, it just means user's get the interaction failed error since d.py didn't responsne in time

#

not sure what you mean

cold island
#

I think I'm not following you

vale ibex
#

when you click the button to Run in X version the button callback calls Snekbox.run_job

#

which starts a new job "session"

#

that session doesn't end until all the wait_fors are done

cold island
#

why not?

vale ibex
#

because bot.wait_for blocks that thread

#

so the run_job call doesn't return until those are done

cold island
#

Oh the callback leads to a call that does wait_for because of the option to edit, and that means the interaction doesn't end so it doesn't show the result or something?

vale ibex
#

The interaction never "ends" until all those wait_fors finish yea

#

of course it outputs the actual code output etc

#

so the code is output and the timers start for editing code

#

but we never ack to discord, since the run_job call doesn't return

#

so discord thinks the interaction failed

cold island
#

i see

vale ibex
#

So everything still "works" regardless, there's just an "Interaction failed" error shown to the user under the button

#

We initially got around that by putting the run_job call in a task

#

but by using defer we don't need to

cold island
#

what is the actual interaction result though? sending a new message?

vale ibex
#

Yea

cold island
#

And it still fails despite there being a result because it takes too long?

vale ibex
#

that's done via the original context though, rather than through interaction.response

cold island
#

oh well

#

why?

vale ibex
#

because it was easier to make the interaction pass the context than change all the output to use ctx.send or interaction.response

#

depending on the source of the call

cold island
#

ok. I won't nit pick because it's only until 3.11 becomes stable, but it sounds like it deserves some refactoring

vale ibex
#

yea, the issue atm is that a "sessions" can be started via a command, an edit or an interaction

#

and after a session is started, a new job can be spawned from both and edit or an interaction

#

an it can swap between them

#

so the interaction would still need to pass the context, otherwise it wouldn't be able to listen for edits, at least afaik

#

I guess we could pass the whole Interaction object from the interaction to run_job

#

then it has access to original_message()

#

but yea it needs refactoring to support that, or else it'll be messy

gritty wind
#

Ya know, we could keep this for future versions we add too

vale ibex
#

Yea, it would be nice to do this each release

gritty wind
#

If you want to make it clean, I don’t see why we couldn’t even make it a permanent thing

vale ibex
#

so it likely could do with a nice refactor

gritty wind
#

Carry some prominent versions

vale ibex
#

"Run in 2.7"

gritty wind
#

3.7,3.9,latest

gritty wind
#

πŸ—ž

vale ibex
#

lol

cold island
#

The way the code works right now with the re-eval is pretty neat, but if you're doing something like that I would dismantle it.

vale ibex
#

Thinking about it, even in the refactor we likely still want to defer, since we can't respond until after the code is eval'd, which could take long enough for the interaction to timeout

cold island
#

How long does it take an interaction to timeout?

vale ibex
#

Not sure exactly, all I can see in the api docs is it said you should respond "promptly"

atomic ivy
#

dunno how feasible this is, but can't you respond right away but lock the interaction until after the eval is done?

vale ibex
#

that's essentially what defer does

cold island
vale ibex
#

it tells Discord "I acknowledge your interaction and will followup later"

atomic ivy
#

ah. okay

vale ibex
#

guess I missed that part :P

#

It's no big deal though, we can still to interaction.followup.send

cold island
#

It doesn't really matter in that case

vale ibex
#

yea, it's just an extra api call to defer

cold island
#

Then your current solution is the simplest probably

whole forge
vale ibex
#

pretty cool, down to 63KB

#

just depends on whether it goes nicely into an embed like gifs

whole forge
#

aye webm is how people are able to post full length movies within discords 50mb limit

vale ibex
#

lol

brazen charm
#

gifs have the (dis?)advantage of being auto play

vale ibex
#

Ah yea true, I always forget that since I have autoplay off

whole forge
vale ibex
#

I think we had 1 or 2 people post morbius when that was going around, but nothing since

desert vessel
#

!contribute

stable mountainBOT
#

Contribute to Python Discord's Open Source Projects
Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!

Projects to Contribute to
β€’ Sir Lancebot - our fun, beginner-friendly bot
β€’ Python - our utility & moderation bot
β€’ Site - resources, guides, and more

Where to start

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
atomic ivy
#

I feel like the the eval job response should indicate with which version it was run.
rn it's not a big deal because there's just 3.11b4 and 3.10 as the choices, but if we want this for testing newer versions later, it will be needed anyway.

tawdry vapor
#

The version can be deduced from the button text

#

I don't foresee it supporting more than 2 versions

placid ermine
#

(fwiw my first guess was that it was run in 3.9, before i tested w sys.version)

#

maybe the "Your eval job has completed..." message could be changed to "Your Python 3.10 job has completed..."

cold island
#

I had the same suggestion

vale ibex
#

We should also delete the buttons when the interaction times out

#

(we can extend the timeout too)

atomic ivy
#

the compressed GIF works just fine though

cold island
#

We can also make the result reply to the invocation though

vale ibex
#

Yea, the timeout of the view will be shared between the delete and the rerun too

atomic ivy
#

bot#2224 ended up being a tiny PR, but I learned stuff about d.py
I think the tag's focus should be on the animation itself, since !tags return already explains the difference between print and return, but lemme know if the tag description needs more elaboration.

dusky shoreBOT
atomic ivy
hoary haven
#

i think it might eventually stop working

brazen charm
#

And I don't think discord makes any assurances with its urls

cold island
#

As long as the original message exists I don't think it will

brazen charm
#

If it's uploaded somewhere reliable, discord should still be handling it with its cdn, but in the way it was designed to

vale ibex
atomic ivy
#

fair points. I'll create a subdirectory under the resources directory named media and add it there

thorny obsidian
#

@vale ibex did you want to do an announcement for the "hey, we're running 3.11 beta to help test this beta version!" thing?

vale ibex
#

Yea I think we should, maybe after bot#2225 is merged

dusky shoreBOT
vale ibex
#

We're planning a larger announcement around 3.11 in admins

hoary haven
#
2022-07-17 22:28:34    
2022-07-17 22:28:34 | botcore.utils.scheduling.HelpChannels | WARNING | Failed to unschedule 776184661902491678 (no task found).
2022-07-17 22:28:33    
2022-07-17 22:28:33 | bot.exts.help_channels._cog | INFO | Moving #help-lemon (776184661902491678) to the Dormant category.
2022-07-17 16:22:16    
2022-07-17 16:22:16 | botcore.utils.scheduling.HelpChannels | ERROR | Error in task #776184661902491678 140677048063888!
Log labels

app    bot

container    bot

filename    /var/log/pods/default_bot-85b7fb85cb-4mrpn_0b988acf-6b05-45ad-a863-b23eea8b8371/bot/0.log

job    default/bot

namespace    default

pod    bot-85b7fb85cb-4mrpn

pod_template_hash    85b7fb85cb

stream    stdout
Detected fields

ts    2022-07-17T16:22:16.718Z

tsNs    1658074936718796669

i don't know if this helps but i pulled the logs@brazen charm

gritty wind
#

How’d you even get kube logs lol

patent pivot
#

the bottom of that code block is the loki metadata

gritty wind
#

Right

brazen charm
#

is the error traceback there?

hoary haven
#

uhh not that i know of, i've only see tracebacks in sentry errors

gritty wind
#

We do get tracebacks in grafana too, but I’m pretty sure the help channel issues don’t have tracebacks most of the time

#

Part of why it’s so damn difficult to debug

hoary haven
#

ah right

hoary haven
#

i know we probably don't want to drop the logging level bc then our current service logs will be hard to sift thru, but is there a way to send lower level logging to.. a separate log?

gritty wind
#

We can already set logging level per cog, but I don’t think there’s anything interesting

hoary haven
#

herm was looking to test bot#2225 but hitting errors when running !eval
so far i've tried docker-compose pull which worked fine, and

➀ docker-compose up --build
ERROR: Service "snekbox" was pulled in as a dependency of service "bot" but is not enabled by the active profiles. You may fix this by adding a common profile to "snekbox" and "bot".```
dusky shoreBOT
hoary haven
#

the error i got on my test server before attempting this:
Sorry, an unexpected error occurred. Please let us know!
ClientConnectorError: Cannot connect to host snekbox-311.default.svc.cluster.local:80 ssl:default [nodename nor servname provided, or not known]
i'm just gonna delete it all and restart

tawdry vapor
#

You gotta change that config URL to the service name if the bot itself runs in Docker, or to localhost:8065 otherwise

#

I think 8065 is the port. You can check docker compose yaml for the exact value

hoary haven
#

i typically just run site in docker and run bot locally, but atm running the whole thing in docker gives me the above

tawdry vapor
#

Then use the docker compose service's name as the host for the url

#

it's probably called snekbox-311 or something

#

And then add the port at the end

hoary haven
#

mk idk if i'm doing this right
in my config.yaml

    snekbox_eval_api: "http://localhost:8060/eval"
    snekbox_311_eval_api: "http://localhost:8065/eval"

then docker-compose up web snekbox snekbox-311 and python -m bot

tawdry vapor
#

Yeah that looks right

#

the snekbox container would have more logs on what the error is

hoary haven
tawdry vapor
#

Does that error mean the clone syscall was given an invalid argument? That would be weird.

#

Maybe your image is out of date? Try docker compose down and then docker compose pull

tawdry vapor
hoary haven
#

i'm on mac

hoary haven
tawdry vapor
#

The newer version of docker compose lacks a hyphen for the command

#

if you don't have it available then you can use the hyphen for the old version it shouldnt really matter in this case

hoary haven
#

same error, same logs

tawdry vapor
#

Do both 3.11 and 3.10 have the same problem

hoary haven
tawdry vapor
#

Thats identical to your previous screenshot

hoary haven
#

yeah my earlier was a 3.10 screenshot too ig

tawdry vapor
#

Do you know how to open a shell in a running container

#

I want you to run uname -a to figure out what kernel version is being used

hoary haven
#

yeah i would have to look it up

tawdry vapor
#

docker compose exec -it snekbox /bin/bash

hoary haven
#
➀ docker compose exec -it snekbox /bin/bash
root@95648ad171ec:/snekbox# uname -a
Linux 95648ad171ec 5.10.104-linuxkit #1 SMP PREEMPT Thu Mar 17 17:05:54 UTC 2022 x86_64 GNU/Linux
tawdry vapor
#

All the flags being passed seem to be supported by clone on that version

#

Maybe some other arg is invalid

hoary haven
#

i can try again tomorrow on a windows machine. you suspect it could have something to do with my machine?

tawdry vapor
#

It's a weird error so I'm not sure. Would be nice if someone else on a mac could test

tawdry vapor
#

Most of them don't seem relevant given the flags being passed, but it could be one of these ```

   EINVAL CLONE_NEWIPC was specified in the flags mask, but the
          kernel was not configured with the CONFIG_SYSVIPC and
          CONFIG_IPC_NS options.

   EINVAL CLONE_NEWNET was specified in the flags mask, but the
          kernel was not configured with the CONFIG_NET_NS option.

   EINVAL CLONE_NEWPID was specified in the flags mask, but the
          kernel was not configured with the CONFIG_PID_NS option.

   EINVAL CLONE_NEWUSER was specified in the flags mask, but the
          kernel was not configured with the CONFIG_USER_NS option.

   EINVAL CLONE_NEWUTS was specified in the flags mask, but the
          kernel was not configured with the CONFIG_UTS_NS option.
hoary haven
#

tested on windows machine and it works perfectly

tawdry vapor
#

I see. So it could be one of those errors above. But I don't know of a way to check kernel flags within a container, nor how to check it when using Docker Desktop.

hoary haven
#

that satisfies my curiosities for the night lol. i imagine not being able to test this on mac shouldn't be a blocker though right?

tawdry vapor
#

Correct.

hoary haven
#

i've also just tried again after updating to Docker Desktop 4.10.1 (82475), same behavior

tawdry vapor
#

We can actually control which flags are used but since these flags work in production we shouldn't disable them I think.

#

However it does mean if you really wanted to know you could do a bisect to figure out which flag is the culprit

hoary haven
#

sure i can try that
tomorrow (for real tomorrow)

edit: maybe tomorrow tomorrow dv_pandaYawnOwO

gritty wind
#

Developers not having macs, and broken Mac apps. Name a more iconic duo

outer oasis
patent pivot
#

answered there πŸ‘

atomic ivy
# tawdry vapor It's a weird error so I'm not sure. Would be nice if someone else on a mac could...

FWIW snekbox eval errors with this in debug mode

2022-07-19 06:41:13,508 |     9 |                 snekbox.nsjail |  WARNING | [1] bool mnt::mountPt(mount_t*, const char*, const char*)():209 mount(''/lib64' -> '/lib64' flags:MS_RDONLY|MS_BIND|MS_REC|MS_PRIVATE type:'' options:'' dir:false') src:'/lib64' dstpath:'/tmp/nsjail.0.root//lib64' failed: No such file or directory
2022-07-19 06:41:13,508 |     9 |                 snekbox.nsjail |    ERROR | [1] pid_t subproc::runChild(nsjconf_t*, int, int, int, int)():466 Launching child process failed
2022-07-19 06:41:13,508 |     9 |                 snekbox.nsjail |  WARNING | [11] pid_t subproc::runChild(nsjconf_t*, int, int, int, int)():486 Received error message from the child process before it has been executed
2022-07-19 06:41:13,508 |     9 |                 snekbox.nsjail |    ERROR | [11] int nsjail::standaloneMode(nsjconf_t*)():272 Couldn't launch the child process
2022-07-19 06:41:13,508 |     9 |                 snekbox.nsjail |     INFO | nsjail return code: 255
tawdry vapor
#

Looks like an unrelated error

#

Why would lib64 not exist

#

Are you on a 32 bit system

atomic ivy
#

nope

#

that's on a M1 mac

patent pivot
#

uhh that's possibly still related

#

are you running with the compat flag

atomic ivy
#

what's the compat flag pithink

patent pivot
#

--platform linux/amd64 alongside your docker run

atomic ivy
#

I just did docker-compose up -d

#

and it doesn't look like that has a platform specified

patent pivot
#

you can edit the compose to add it as well

#

under the service add platform: linux/amd64

atomic ivy
#

yea. trying

#

nope. same error

patent pivot
#

interesting

atomic ivy
#

btw this was just to confirm that it breaks in Docker for Mac. it works just fine on my Linux box

patent pivot
#

yea doesn't surprise me, it'll definitely be something ARM related, not super sure what we can do about it

atomic ivy
#

without the platform option, it does build a linux/arm64/v8 image

clever wraith
#

Hi

#

L

#

Here

atomic ivy
#

hello! small PR adding a tag. no blockers AFAIK 😬. bot#2224

dusky shoreBOT
wind ruin
#

(for context: <#bot-commands message>)
it looks like the .challenge Lancebot command is not working.
the command uses bs4 to scrape codewars's search results, so a change to the website may have broken it
should we at least disable it for now?

gritty wind
#

It’s fine to keep it loaded for now (it’ll load again when lance restarts anyways)

#

If someone wants to raise an issue, we can start working on a fix

tawdry vapor
outer oasis
#

Can I get a review on code-jam-template#6

dusky shoreBOT
molten perch
outer oasis
gritty wind
#

We generally don’t update our licenses no

#

License law is vague, but our in house lawyer has said we shouldn’t

outer oasis
#

I don't have any actual specifics

gritty wind
#

That being joe

outer oasis
#

Oh, okay then

#

PR closed

#

thanks

molten perch
gritty wind
#

It passes linting, merge βœ…

molten perch
vale ibex
#

Yea, the date in a license is generally the date of publication

#
In the case of work which is continually updated, (for example a web site), the year of publication may be shown as a period from first publication until the most recent update, (i.e. 2000-2020)
#

we just choose not to, as that's a lot of things to update each year

gritty wind
#

Some people go for 2000- but as with all things licensing YMMV

outer oasis
thorny obsidian
#

For the CJ template, since we had two events team members work on it, I took a look and joe reviewed, that should be fine. This isn't a high stakes thing so it's fine

cold island
#

wellll

#

We do need to be careful since people will be using it in their project

#

iirc we had to announce to people how to fix something that didn't work last year

thorny obsidian
#

Yeah, I'm not saying we don't need to be. We just don't need to go hunt down core dev reviews or things like that.

cold island
#

Since joe already reviewed it doesn't matter either way, but maybe we should have some policy if we're gonna use it in future jams

cold island
#

So

#

do we maybe want to make the poll command use buttons

#

we'll be able to let everyone use it then

vale ibex
#

Yea, we could move it to a channel lock, rather than a role lock in that case

outer oasis
cold island
#

Will need to engineer it a bit to make it have the same level of freedom as with reactions, but it should be possible

cold island
vale ibex
#

Yea, I'd see a button on there that can only be use by the invocker/mods to end the poll

#

which will remove the buttons and tally the score

cold island
#

That same rate limit is shared with other commands that use reactions such as anything with pagination

outer oasis
vale ibex
#

Yes

outer oasis
#

I see

cold island
#

I recall @thorny obsidian wanted to make it a slash command

vale ibex
#

I pretty sure Kat had a PoC for it

cold island
#

But making it use buttons should be relatively simple

vale ibex
#

Yea

#

the only non-trivial part will be having separate interaction checks for the end poll button to the option buttons

#

I imagine it will just be getting the button being pressed in the interaction check

vale ibex
#

how were you seeing the votes being totalled?

brazen charm
#

Not directly related, but can the buttons be made not so huge compared to reactions? I've though that it'd be better for the ux to have buttons everywhere for things like deletion, but they also take quite a bit of space

vale ibex
#

buttons are chunky and there's nothing we can do about it

cold island
#

Or is that not something we want

vale ibex
brazen charm
#

I've disabled reactions a while back and the bot became a bit more difficult to use. A command for the reaction interactions also came to mind, but that's not very discoverable and takes up even more space when actually used

cold island
#

They're pretty cheap

#

But yeah we could have a button to end it and then display the result

vale ibex
#

I do also wonder if we'd get into a problem with idempotency if we were to edit on every button press

#

if many came in quickly

#

depending on how the coros fall

#

it would be correct eventually though IG

#

since the internal total would be atomically incremented

cold island
#

yeah we can just not do that if there's worry

#

But it should just be slower

#

Do edits and sends share the same rate limit?

vale ibex
#

No clue

#

I imagine even if they do we don't need to worry about them

cold island
#

But you're right, there's no need replace one rate limited set up with another

vale ibex
#

we could implement some debouncing on updating the message

#

shouldn't be to difficult

#

if we really wanted a live update

cold island
#

debouncing?

#

like chunking updates?

vale ibex
#

yea, not sending an edit for every press, but delaying if there are many at a time

#

Yea

cold island
#

yeah that's possible

vale ibex
#

it would mean one less button too

#

since we don't need the end poll button

cold island
#

I'm not sure how great it is for responsiveness though

vale ibex
#

and the timeout on the view would control how long the poll stays up for

cold island
#

Might not be the best UX if you press the button and it takes a bit to update

vale ibex
#

I was thinking like 0.5s debouncing

#

it doesn't need to be crazy

#

just a standard timing on when the message updates, rather than updating based on presses

#

to avoid two triggers conflicting

cold island
vale ibex
#

the timeout could be a command arg

timid sentinel
#

Reactions have the advantage of the user being easily able to see their current vote(s), imo they're better than buttons for our current internal use.

cold island
vale ibex
#

persistent views don't add any code :D

#

it's just a case of setting the timeout to be high

cold island
vale ibex
#

just need to give a good customID on the button

molten perch
cold island
vale ibex
#

it's just 1 LoC on bot startup to add a listener

cold island
#

ok I guess I don't know how they work at all

timid sentinel
cold island
#

&src cj announce

humble leafBOT
#
Command: codejam announce

A command to send an announcement embed to the CJ announcement channel.

Source Code
vale ibex
#

the only thing I can see causing a problem with not persisting is as wookie said we'd lose what each user voted for across bot reboots

#

which could cause double votes for long-standing polls

molten perch
#

It seems like custom ids are not compulsory.

vale ibex
#

I think d.py does a good job at generating them

stable mountainBOT
#

bot/bot.py line 59

self.add_view(JamTeamInfoView(self))```
timid sentinel
#

So I'm not really feeling it's worth the change currently

vale ibex
#

it does allow for anonymous voting, I'm not sure if that's a use case we have atm though

molten perch
vale ibex
#

The biggest downside for me though is that buttons are very big compared to emoji, especially if we want >5 options

cold island
molten perch
vale ibex
#

so d.py knows where to throw the interaction to

#

the IDs being unique across all views and buttons

cold island
#

But why does adding this view make the button use it

#

You created a new button object

vale ibex
#

yea, it'll have the same id as the previous one though

#

it doesn't use the literal id func

#

it's an id generated by discord.py to be the same across restarts

cold island
#

oh it has custom_id

#

ok

vale ibex
#

yea

#

you can specify your own as needed, but d.py does a good job at generating them itself

molten perch
#

I'm not sure then why the examples on github recommends to set it to be custom then.

cold island
#

Would be very weird to me to let it generate it itself

#

If I have several views for example

timid sentinel
#

Could we port the poll command to sir-robin and put on usage limits to prevent running into rate limits?

molten perch
cold island
cold island
molten perch
cold island
#

I... would?

molten perch
#

Yeah, I registered the announcement view once.

#

Then sent like 5 of them to the announcement channel

#

and worked pretty well

cold island
#

but

#

but

hoary haven
#

but

cold island
#

What if you wanted each to have different attributes

molten perch
#

Well? They do? πŸ˜„

cold island
#

How? you supplied only one view object

molten perch