#dev-contrib

1 messages Β· Page 18 of 1

eternal owl
#

ye, went to the link and clicked it

vale ibex
#

I know in the past people have tried using PyCharm's md preview, which doesn't behave the same way as our site does

eternal owl
#

no

vale ibex
#

if you remove the .md does it work?

eternal owl
#

it does not work in preview

#

but on site it works

eternal owl
#

comes like this

clever wraith
#

I remeber our talk last time

vale ibex
#

what's the code?

#

I mean, what's in the hyperlink on the md file

eternal owl
#

../discordpy-subclassing-context.md

vale ibex
#

Change it to ../discordpy-subclassing-context

eternal owl
eternal owl
#

in the url

clever wraith
#

πŸ€¦β€β™‚οΈ

clever wraith
stable mountainBOT
#

bot/exts/fun/latex.py lines 84 to 88

async with self.bot.http_session.post(LATEX_API_URL, data=payload, raise_for_status=True) as response:
    response_json = await response.json()
if response_json["status"] != "success":
    raise InvalidLatexError(logs=response_json.get("log"))
async with self.bot.http_session.get(```
timid sentinel
clever wraith
#

I'm assuming this is only possible because the API itself could return a response with status code < 400 but the response['status'] isn't a success ?

That's what I was trying to say by this. I see.

#

Alright, that's clear.

#

Thank you !

#

I would expect a 400, but hey 🀷

cobalt steppe
#

Hi mates, is this channel for conrtibutors?

clever wraith
#

Hello

#

Indeed it is !

cobalt steppe
#

I've project and looking for devs who interested in it

clever wraith
#

Ah, this channel is only for contributions to our projects only I'm afraid.

cobalt steppe
#

Nice, I have try to post and all users stay told me delete it

#

Oh

#

Ok got it

clever wraith
sharp crag
#

We could also have this PR (#1223) close Preocts issue (#1179) if that's something y'all want to do

vale ibex
#

DIdn't see there was an issue for it, just noticed while I was reviewing

#

It's a 2 line change, and bella has already given you a copy-paste code block diff

#

so might as well do it in this PR

#

since you need to push ruff fixes anyway

sharp crag
#

Yup thanks, hope Tizzy doesn't mind haha

#

Fixed. Requested a review from both of you. Thanks!

static canyon
sharp timber
#

!charinfo v

s

stable mountainBOT
sharp timber
#

!charinfo [](

stable mountainBOT
sharp timber
#

!embed v

s

stable mountainBOT
#

v

s

sharp timber
#

!charinfo v

s

stable mountainBOT
sharp timber
#

I am so very confused why this wasn't run into before

#

I suppose it has been, but never worked on

still comet
#

This channel is for discussion about python discord's open source projects. Unfortunately we don't have a channel for sharing your projects/recruitment, but you could try posting it in the r/python subreddit because it's better suited there.

clever wraith
#

Hi πŸ‘‹
We don't advertise projects or anything of that sort on our server, and this channel is, like noob told you, is for discussions related to our OSS projects.

sharp crag
#

Hello folks - so I'm trying to set up python-discord/bot, I've use_fakeredis set to true in my config.yml, yet it's still throwing an error:

Traceback (most recent call last):
  ...
redis.exceptions.ConnectionError: Error -2 connecting to redis.default.svc.cluster.local:6379. -2.

Full traceback: https://paste.pythondiscord.com/egoraquvar

#

I'm also up to date with the main branch

#

Looks like I had use_fakeredis set to False in constants.py BONK

#

Now I'm getting

Error response from daemon: Head "https://ghcr.io/v2/python-discord/site/manifests/latest": denied: denied

When I try to docker compose up web

#

I have made sure to do docker login

outer oasis
sharp crag
#

Yep, Login Succeeded

#

Still getting permission denied for web, though

outer oasis
sharp crag
#

Username & password

outer oasis
sharp crag
#

Yeah, just my normal password

outer oasis
#

🚨

sharp crag
#

Was I supposed to use a PAT or something?

outer oasis
sharp crag
#

Erm.. where do I obtain one of those PepeShy

sharp crag
#

Oh I just.. pass in my normal GitHub PAT into the password field?

#

Nevermind. I don't have that scope.

sharp crag
#

The one I use for cloning private repos and whatnot.

#

@outer oasis That's giving me

Error response from daemon: Get "https://registry-1.docker.io/v2/": unauthorized: incorrect username or password
#

Does it have something to do with the new fine-grained tokens vs classic?

sharp crag
#

I know. Username is correct, I'm 100% sure. Password came straight from copying it off GitHub

vale ibex
#

you're trying to login to dockerhub with github creds

#

you need to run docker login ghcr.io -u <USERNAME>

vale ibex
sharp crag
#

Thanks! Can pull web now.

vale ibex
#

we use pydantic now

sharp crag
#

Guess I am on an older version after all :P

vale ibex
#

bot#2618 just to remove the "Run in 3.10" button until we support multi-version again

dusky shoreBOT
vale ibex
#

@clever wraith I removed your approval since I decided to change the PR a bit more so that it's nicer to use in dev

#

(read actually possible to use in dev)

clever wraith
#

I have a one free approval per day policy

vale ibex
#

basically I just made it so that there is only ever 1 snekbox container that uses the latest tag

clever wraith
#

Alright, let me have a look

vale ibex
#

since the idea with supporting multiple versions is that that would bet the case

#

With a query param/body key would changing the version used

clever wraith
#

@gritty wind What happened to snekbox#175 ?

dusky shoreBOT
vale ibex
#

Also, site#988 to update the docs

dusky shoreBOT
clever wraith
vale ibex
#

lol

rapid swallow
#

will do free reviews in exchange for money

clever wraith
gritty wind
#

If someone wants to pick this up and figure it out go for it

stable mountainBOT
#
Available tags

β€’
Β» args-kwargs
Β» async-await
Β» blocking
Β» botvar
Β» class
Β» classmethod
Β» codeblock
Β» comparison
Β» contribute
Β» customchecks
Β» customcooldown
Β» customhelp
Β» dashmpip
Β» decorators

trim cradle
#

What channel does !cban traverse first (if it's not arbitrary), and can it be pygen? I just cbanned someone in pygen, and it took a moment before their messages disappeared.

royal prawn
#

!src cban

stable mountainBOT
#
Command: cleanban

Same as ban, but also cleans all their messages from the last hour.

Source Code
royal prawn
stable mountainBOT
#

bot/exts/moderation/clean.py lines 134 to 140

if channels == "*":
    channels = {
        channel for channel in itertools.chain(ctx.guild.channels, ctx.guild.threads)
        if isinstance(channel, TextChannel | Thread)
        # Assume that non-public channels are not needed to optimize for speed.
        and channel.permissions_for(ctx.guild.default_role).view_channel
    }```
royal prawn
#

a few lines later, after the else, is return channels

still comet
#

Can someone check sir-lancebot#1275? It's been up for a while and I would like to get started on it.

ivory hornet
#

Hello everyone, I was seeking collaboration on a android and web project, I there a channel where I can do that?

austere hornet
thorny obsidian
#

For staff that check this channel more frequently than the events planning channel, pls check #943526620940083220 for Trivia Night port stuff

vocal wolf
#

@clever wraith you saw nothing

#

please approve prs thank

#

very important that we get uhhhhhhhh

Added Indonesian and Simplified Chinese

and

Bug fixing

#

for emoji package

#

thanks

#

nevermind, I have merged

clever wraith
#

Sorry, i was busy getting hurt by running after the train

vocal wolf
vocal wolf
static canyon
#

I'm not familiar enough with asyncio to come up with an alternative

timid sentinel
#

Does the current code work?

static canyon
#

It's just whether we care about asyncio.run creating a new task loop (based on what Mark said)

#

Lemme find my laptop and run it to see

#

Actually, not sure how I'd test since bot-core doesn't have a bot

timid sentinel
#

I would have thought that asyncio.run would raise an error if there's an existing event loop

static canyon
#

I'm trying to figure out how to run it though πŸ€”

#

Guess I can create a dummy bot in the bot-core project locally that just imports stuff

vale ibex
vale ibex
static canyon
static canyon
static canyon
# vale ibex https://github.com/python-discord/bot-core/tree/main/dev

I did poetry run pip install ../bot-core but got an error:```
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
bot 1.0.0 requires pydis_core[async-rediscache]==9.5.1, but you have pydis-core 10.0.0 which is incompatible.

vale ibex
static canyon
#

Ah, right, so I just need to downgrade it for now?

vale ibex
#

either bring bot-core down or bump the version bot needs

static canyon
# vale ibex Mark's suggestion would work

One solution may be to wrap the task being scheduled with another coroutine that awaits the original coroutine and the error handler afterwards.
My brain is struggling to figure out how to do this πŸ˜…

vale ibex
#

then that new fucntion is what we create the task for

static canyon
#

Right

#

Think that makes sense

static canyon
vale ibex
#

πŸ‘

static canyon
#

I've been doing almost exclusively js/ts for the past few months, and it's made me forget how stuff works in python πŸ˜…

#

Hmm, that's not quite right since it needs to call _log_task_exception

vale ibex
#

Something like```py
def schedule(self, task_id: abc.Hashable, coroutine: abc.Coroutine) -> None:
...
task = asyncio.create_task(coro_wrapper(coroutine), name=f"{self.name}{task_id}")
task.add_done_callback(partial(self._task_done_callback, task_id))

async def _coro_wrapper(coroutine: abc.Coroutine):
try:
await coro
except Forbidden as e:
await handle_forbidden_from_block(e)

static canyon
#

Where does the **kwargs get passed into the corouritine?

vale ibex
#

what kwargs?

#

The coro is already created

static canyon
#

Nvm, the **kwargs is passed to asyncio.create_task, not the coro

#

def create_task(
    coro: abc.Coroutine[typing.Any, typing.Any, TASK_RETURN],
    *,
    suppressed_exceptions: tuple[type[Exception], ...] = (),
    event_loop: typing.Optional[asyncio.AbstractEventLoop] = None,
    **kwargs,
) -> asyncio.Task[TASK_RETURN]:```these `kwargs`
vale ibex
#

ahh right

#

I was looking at schedule not create_task, but yea same idea

static canyon
vale ibex
#

why does it need it?

#

we can still add that as a callback

static canyon
#

But _log_task_exception is now a coro

vale ibex
#

does it need to be?

static canyon
#

It calls await handle_forbidden_from_block, so yes

vale ibex
#

we call that inside the wrapper though

static canyon
#

But...

#

The wrapper should call _log_task_exception, not handle_forbidden_from_block

#

Unless πŸ€”

#

I guess that works

#

_coro_wrapper calls handle_forbidden_from_block, and then we add _log_task_exception as a done callback (and it won't call the forbidden handler so doesn't need to be async)

vale ibex
#

yea

static canyon
#

Yeah, sorry, my brain just isn't working properly πŸ˜…

#

Going to test it now

vale ibex
#

Wouldn't py task = event_loop.create_task(partial(_coro_wrapper, coro), **kwargs) be this instead? ```py
task = event_loop.create_task(_coro_wrapper(coro), **kwargs)

#

Also, this isn't breaking so can just be a minor version bump

#

Also, I think the module should be error_handler or something like that, rather than errors as the latter suggests that it contains exception/error classes

static canyon
static canyon
#

The incidents crawler still raises the 90001 forbidden error

#
bot-bot-1  | 2023-06-10 15:38:33 | pydis_core.utils.scheduling | ERROR | Error in task Task-87 275305148096!
bot-bot-1  | Traceback (most recent call last):
bot-bot-1  |   File "/bot/bot/exts/moderation/incidents.py", line 361, in crawl_incidents
bot-bot-1  |     await add_signals(message)
bot-bot-1  |   File "/bot/bot/exts/moderation/incidents.py", line 269, in add_signals
bot-bot-1  |     await incident.add_reaction(signal_emoji.value)
bot-bot-1  |   File "/opt/poetry/cache/virtualenvs/bot-TFcQMFAJ-py3.11/lib/python3.11/site-packages/discord/message.py", line 1098, in add_reaction
bot-bot-1  |     await self._state.http.add_reaction(self.channel.id, self.id, emoji)
bot-bot-1  |   File "/opt/poetry/cache/virtualenvs/bot-TFcQMFAJ-py3.11/lib/python3.11/site-packages/discord/http.py", line 738, in request
bot-bot-1  |     raise Forbidden(response, data)
bot-bot-1  | discord.errors.Forbidden: 403 Forbidden (error code: 90001): Reaction blocked```
vale ibex
#

Can you push your current changeset to the pr?

static canyon
#

(And I reinstalled bot-core on bot after making the changes)

vale ibex
#

Seems like it should work

#

could you add some logging and/or breakpoints in the new code to see if it actually gets ran?

static canyon
#

Hmm, can try

static canyon
vale ibex
#

Docker don't run your local bot core changes

#

Since you installed the module to your host venv

#

You'd need to mount the bot core folder inside the container and run pip install there

#

Or run the bot locally

#

Or you can use the basic bot within bot core

vale ibex
#

Copy the bot core folder into your bot folder, add an exception in dockerignore and update the docker file to install it

static canyon
#

Can I just add poetry run pip install ../bot-core to the docker file and then not copy the bot-core folder?

vale ibex
#

That path would be inside the container

static canyon
#

Right

#

So no

vale ibex
#

Unless you mount the bot core folder at that path

static canyon
#
 => ERROR [5/6] RUN poetry run pip install bot-core                                                                                              7.8s
------                                                                                                                                                
 > [5/6] RUN poetry run pip install bot-core:                                                                                                         
#0 7.046 ERROR: Could not find a version that satisfies the requirement bot-core (from versions: none)
#0 7.048 ERROR: No matching distribution found for bot-core
------
failed to solve: executor failed running [/bin/sh -c poetry run pip install bot-core]: exit code: 1```
#

I'm guessing I need to somehow add it to pyproject.toml or something?

vale ibex
#

Make it a relative path

#

Rather than just the name

static canyon
vale ibex
#

What change did you make to the dockerfile, and the dockerignore?

static canyon
#

dockerfile RUN poetry run pip install ./bot-core after the RUN poetry install -without dev and the ignore just bot-core

vale ibex
#

Does bot do the exclude everything and make exceptions in the dockerignore?

#

Or is that just lance?

static canyon
#

The full .dockerignore is```
bot-core
.venv
scripts
htmlcov
pycache
.vagrant
.pytest_cache
.github
.gitlab
.cache
Vagrantfile
.coverage
.coveragerc
.gitignore
.travis.yml
*.log
docker

vale ibex
#

Since if you do bot-core in the docker ignore, that's telling it to ignore it

#

Right, remove bot core from there then

static canyon
# vale ibex Right, remove bot core from there then
 => ERROR [5/6] RUN poetry run pip install ./bot-core                                                                                            7.2s
------                                                                                                                                                
 > [5/6] RUN poetry run pip install ./bot-core:                                                                                                       
#0 6.069 ERROR: Invalid requirement: './bot-core'
#0 6.069 Hint: It looks like a path. File './bot-core' does not exist.
------
failed to solve: executor failed running [/bin/sh -c poetry run pip install ./bot-core]: exit code: 1```
#

Should bot-core be in bot (the same folder as the pyproject.toml) or bot/bot?

vale ibex
#

The former

static canyon
#

Yeah, that's what I've got

#

So not sure what's going on Shrug

vale ibex
#

Can you link me to the dockerfile

static canyon
# vale ibex Can you link me to the dockerfile
FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:3.11-slim

# Define Git SHA build argument for sentry
ARG git_sha="development"
ENV GIT_SHA=$git_sha

# Install project dependencies
WORKDIR /bot
COPY pyproject.toml poetry.lock ./
RUN poetry install --without dev
RUN poetry run pip install ./bot-core

# Copy the source code in last to optimize rebuilding the image
COPY . .

ENTRYPOINT ["poetry"]
CMD ["run", "python", "-m", "bot"]
#

Maybe I need to do it before the WORKDIR /bot?

vale ibex
#

You'll need to move the pip install after the copy . .

#

Or copy bot-core before trying to install it

static canyon
#

It... seems to work :)

#

No error in the incidents crawler πŸŽ‰

static canyon
#

I suppose it makes sense?

vale ibex
#

Yea sure

static canyon
#

I suppose it's just```diff

  • task = asyncio.create_task(coroutine, name=f"{self.name}_{task_id}")
  • task = asyncio.create_task(coro_wrapper(coroutine), name=f"{self.name}{task_id}")```?
#

Try to figure out how to test this, since I can't find a schedule that reacts to a message

#

Guess I can temporarily modify one of the schedules to react to a message

#

Tested and it works πŸŽ‰

#

bot-core#177 should now be ready for review :)

static canyon
#

Whilst I'm here, bot#2520 also needs another review

vale ibex
static canyon
static canyon
# dusky shore

If you get a chance, would appreciate a 2nd review on this

vale ibex
#

will do if I have time after looking at CJMS

crisp flare
#

what do you talk about her

#

e

austere hornet
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
static canyon
#

@vale ibex do I need to manually bump the bot-core version inside bot now that bot-core#177 is merged?

static canyon
# vale ibex yes

And is that just bumping the version in pyproject.toml and then poetry run pip install .?

vale ibex
#

bump version in pyproject and poetry lock

#

then you can poetry install --sync to update your local venv

static canyon
vale ibex
#

poetry lock will do that

static canyon
#

It... didn't seem to

vale ibex
#

did you save pyproject.toml before running poetry lock ?

static canyon
#

Yes

vale ibex
#

are you running poetry lock in the same folder as the pyproject.toml?

static canyon
#

Ohhhhh

#

poetry lock is an actual terminal command facepalm

vale ibex
#

yes

static canyon
#

I thought you meant editing the poetry.lock file facepalm

#
The current project's Python requirement (>=3.11.0,<3.12.0) is not compatible with some of the required packages Python requirement:
  - pydis-core requires Python >=3.10.dev0,<3.12.dev0, so it will not be satisfied for Python >=3.12.dev0,<3.12.0

Because bot depends on pydis-core (9.7.0) which requires Python >=3.10.dev0,<3.12.dev0, version solving failed.```
#

So I guess pydis-core needs to be bumped to py3.11.0?

vale ibex
#

pydis-core supports both 3.10 and 3.11

static canyon
#

Oh wait, yeah

#

It's the 3.12

vale ibex
#

what does poetry run python -V output?

#

in your bot folder

static canyon
vale ibex
#

alright, what about poetry --version?

static canyon
vale ibex
#

alright, you could poetry self update to get 1.5.1 but that's likely not the issue

#

what is your diff on pyproject.toml to main right now?

static canyon
#
# See https://bot-core.pythondiscord.com/ for docs.
-pydis_core = { version = "9.5.1", extras = ["async-rediscache"] }
+pydis_core = { version = "9.7.0", extras = ["async-rediscache"] }```
#

I didn't merge main into my branch before doing this, so the pydis_core was 9.5.1, not 9.6.0

vale ibex
#

I've just replaced 9.6.0 with 9.7.0 on my local bot repo and it worked fine

#

You might want to kill your branch and make a new one from main anyway, since you don't need any of the other changes

static canyon
#

Hmm, looks like poetry self update fixed it Shrug

vale ibex
#

fair enough

static canyon
#
(bot-py3.11) √ Sun 11 Jun 14:36 ~/Documents/personal/bot % poetry lock
Updating dependencies
Resolving dependencies... (2.1s)

Writing lock file```
#

So I add poetry.lock and pyproject.toml, then commit?

vale ibex
#

yea

static canyon
#

Cool, looks like it's worked, thanks πŸ˜„

static canyon
#

@vale ibex should I start on the equivalent PR for sir-lancebot?

#

Or do we want to wait for the error handling to all be migrated to bot-core?

vale ibex
#

Either seem fine to me

vale ibex
#

Small PR to stop the errors in #reddit sir-lancebot#1296

dusky shoreBOT
static canyon
vale ibex
#

replied

static canyon
#

Thanks, approved πŸ‘

static canyon
#

In the Github API is it possible to distinguish between a PR being closed vs merged? Would be nice for #dev-log

#

Oh wait, that's not using code, it's webhooks

still comet
#

Isn't @outer harbor a webhook? I don't think there's a way to customize that

#

yeah

static canyon
#

Yeah, just realised

static canyon
# static canyon In the Github API is it possible to distinguish between a PR being closed vs mer...

In fact, going back to this, it appears that it is possible to distinguish between "closed" and "merged" even within the webhook:

A pull request was closed. If merged is false in the webhook payload, the pull request was closed with unmerged commits. If merged is true in the webhook payload, the pull request was merged.
Src: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads?actionType=closed#pull_request,

Is it possible to "read" the payload at all?

clever wraith
#

I don't remember what the requirements are tbh

static canyon
#

Will take a look, thanks

static canyon
hardy gorge
#

Uh, yeah, context? The GitHub status embed thing?

#

If you want, I can transfer the repo to Python Discord. I don't use it myself anymore.

static canyon
#

Basically having a different message in #dev-log for "PR closed" vs "PR merged" (currently both state "closed")

hardy gorge
#

Ah, yes, that sounds like an easy change

#

I just don't have time to look into it myself

static canyon
#

I'm happy to PR myself :)

#

Either to your account or python-discord, whichever is better

static canyon
hardy gorge
#

I think it would be fine to transfer it to pydis, but it obviously has to be a core dev decision to take on another project, as it does come with a (small) maintanance burden

static canyon
#

Right, makes sense

vale ibex
#

I think there's some confusion here

#

The PR closed webhook is diretly form github, we don't touch it

#

Seb's project is for the status checks webhook

#

Look at the user, Github is directly form github Github Actions is seb's project

static canyon
#

So... could the "PR closed" thing be added to Seb's project? So that we could modify the message

vale ibex
#

No, as we don't trigger the webhook ourselves

static canyon
#

I see

vale ibex
#

the only way we could do what you're saying is to intercept the webhook from github and change it before it hits discord

rapid swallow
static canyon
vale ibex
#

(or a modification to this)

static canyon
#

Hmmmm

static canyon
#

It's not clear where the actual embed content is generated

vale ibex
static canyon
stable mountainBOT
#

github-filter/src/index.ts lines 86 to 90

const data: Data = {
  body: await request.text(),
  headers: request.headers,
  method: request.method,
}```
static canyon
#

Ah, yes, I missed that πŸ˜…

static canyon
vale ibex
#

The way we've tested this in the past is using our own cloudflare accounts

#

since the free tier comes with workers

static canyon
#

Hmm. I don't have a cloudflare account πŸ˜…

#

Guess I can try and create one Shrug

outer oasis
vale ibex
#

So can I work on a PR for this?
Sure, if it's something you're interested in. It's used quite a lot so we'd want to see that it's tested properly before merging.

static canyon
static canyon
vale ibex
static canyon
#

Unless the version of @cloudfare/workers-honeycomb-logger is somehow wrong, despite being installed from the package.json (via yarn install)

vale ibex
#

the way we use it is how it's documented in the readme of honeycomb

static canyon
#

@vale ibex so I've made some progress, but the main issue I'm having is honeycomb not showing logs for some reason. Cloudflare shows that the endpoint was called, but honeycomb doesn't. And honeycomb is the service with the detailed logs of what's going on (where the request.tracer.log() calls go to)

static canyon
#

I've spent about 2 hours solely on trying to figure out how to properly test this code, and am just not getting anywhere

#

I've got the wrangler publish ... which deploys the changes, and that's it

#

Tried closing a PR, and no webhook is sent to Discord, nor is there any logs I can read about what's going on (cloudfare tells me the endpoint was called though).

I get webhooks for some other stuff though, like opening a PR (but no logs again on honeycomb) Shrug

#

Sometimes I get logs on honeycomb and sometimes not, and I can't see what the determining factor is

vale ibex
# static canyon Sometimes I get logs on honeycomb and sometimes not, and I can't see what the de...

Looking at https://github.com/python-discord/workers/blob/main/github-filter/src/bindings.d.ts it's expected to have a variable HONEYCOMB_KEY and a labels key value namespace available to the worker, are both of those setup on your CF instance?

GitHub

:construction_worker: Cloudflare Workers . Contribute to python-discord/workers development by creating an account on GitHub.

static canyon
#

And for HONEYCOMB_KEY I just changed it to process.env.HONEYCOMB_KEY for ease

vale ibex
static canyon
#

The thing is, I do sometimes get honeycomb logs

#

Just can't figure out when/why

static canyon
vale ibex
#

with the aim to reduce noisy events

static canyon
#

Right, yes

vale ibex
static canyon
#

That might be the issue

static canyon
vale ibex
#

(it might auto-forward if you only have one)

static canyon
#

Does the ID look like a hash?

#

Yeah, think I've got it, thanks

vocal wolf
#

@rapid swallow I forgive you

static canyon
# vale ibex Looking at https://github.com/python-discord/workers/blob/main/github-filter/src...
✘ [ERROR] A request to the Cloudflare API (/accounts/{account_id}/workers/scripts/github-filter-worker) failed.

  Uncaught ReferenceError: HONEYCOMB_KEY is not defined
    at worker.js:909:13
    at worker.js:1017:3
   [code: 10021]

  
  If you think this is a bug, please open an issue at:
  https://github.com/cloudflare/workers-sdk/issues/new/choose```How do I make it point to the labels namespace?
#

I added it to the kv_namespaces in the config

vale ibex
#

that error seems to be complaining about the honeycomb key, rather than the labels kv

static canyon
static canyon
vale ibex
#

oh, we use a worker variable for this in prod, rather than a kv

static canyon
#

Ah, right

#

So what's the kv for?

vale ibex
#

it's a feature that we don't actually use anymore

#

There's a label kv that can have channels & webhooks to push all notifcations to

vocal wolf
vale ibex
#

if CI passes I am happy

vocal wolf
#

for these PRs?

#

bot already passed

vale ibex
#

Yea :)

vocal wolf
#

ono

#

site ded

vale ibex
#

coveralls internal error

vocal wolf
#

very interesting

#

but this doesn't look like a problem that the PR caused directly

#

unless I somehow made their servers go kaboom

vale ibex
#

yea, might be worth re-running

vocal wolf
#

am rerun

#

it pass

vale ibex
#

bot-core#181

dusky shoreBOT
spring hinge
static canyon
# vale ibex Looking at https://github.com/python-discord/workers/blob/main/github-filter/src...

Both of these are now setup, and I'm still not getting logs as I'd expect. The worker code is now```ts
export async function handleRequest(request: Request): Promise<Response> {
// Don't apply any logic to non-POSTs.
if (request.method !== 'POST') {
return new Response(
'Worker lives! Ignoring this request because it is not a POST.',
)
}

request.tracer.log('POST request received')```and I'm not getting the 'POST request received' logged, despite cloudflare showing that there was a POST request to that endpoint

vale ibex
#

might be worth turning on the logs websocket in the CF worker

static canyon
vale ibex
#

Ya, that's the one

static canyon
#

You can see that has logs: [] too Shrug

#

Despite the method: POST

vale ibex
#

Not entirely sure what's going on then

static canyon
#

You and me both

#

I've spent >2hrs on this

static canyon
vale ibex
#

console.log is my uneducated guess

static canyon
#

Let's see if I can use this instead of honeycomb

static canyon
#

So it's not like a discord embed payload where I could just adjust the .title or something

#

The body is so big that json.loads() just crashes the idle shell when I try to parse it πŸ˜…

#

From preliminary testing, it looks like discord sees body.action == "closed" and that's it. It doesn't look for body.pull_request.merged as well

#

Tl;Dr; it's Discord themselves that generate the webhook message content, so unless you can intercept Discord --> channel, this isn't possible
@vale ibex

#

Looks like the best option is to do a PATCH request after the POST request, to update the message sent to Discord (meaning it would have "edited" next to it), if we want to do this.

Or, we parse the github event and send an embed payload to the webhook ourselves, instead of having Discord parse the github event.

vale ibex
#

Fair enough, I don't think it's worth the effort for the gain at this point then

static canyon
#

Yeah, agree

#

Unfortunately it wasn't as simple as I'd hoped

#

Another project down the drain

gritty wind
#

Honeycomb issue could be a matter of modifying the sample rate

spring hinge
vale ibex
#

if it's linux, what kernel version are you on?

#

Also, how are you running snekbox?

spring hinge
#

I'm running it on Debian Kernel 5.4.143-1-pve
I used to docker command in the snekbox repo, I also tried to sudo run the docker but the error persists.

vale ibex
#

could you add -e SNEKBOX_DEBUG=true to the docker command (before the image url) and put the entire output into a paste?

spring hinge
#

sure, give me a second

vale ibex
#

and then the error you posted above happens when you make a request to the snekbox api?

#

any chance you could include that in a new paste too?

spring hinge
#

yes, wait

vale ibex
#

So the warning line ```
Swap memory is available, but the swap memory controller is not enabled. This is probably due to the CONFIG_MEMCG_SWAP or CONFIG_MEMCG_SWAP_ENABLED kernel parameters not being set. NsJail will not be able to limit memory effectively. Please turn off swap memory on the system, or enable the swap memory controller.

#

not overly familiar with nsjail myself, so not sure if setting those kernel params will just work

spring hinge
#

okay, I will try to enable the swap memory controller and tell you if it worked

vale ibex
#

from the nsjail docs it says this ```
--cgroup_mem_memsw_max VALUE
Maximum number of memory+swap bytes to use (default: '0' - disabled)
--cgroup_mem_swap_max VALUE
Maximum number of swap bytes to use (default: '-1' - disabled)

#

and in your error, it shows that those are set to disabled

#

so not sure what's causing the issue without looking into it further

spring hinge
#

hm yeah, thanks for the help though.

vale ibex
#

Fixed the tests in bot#2642

There's likely room for a followup PR to use some of the new features added in d.py 2.3

dusky shoreBOT
dull swan
#

Not sure if there's an issue for this specifically, I found tizzy's removal of backticks issue, but you get whatever the character limit is to write an executable and have it embed in Discord from Python directly. Is that intended?

#

ref: #bot-commands message

gritty wind
dull swan
#

... Ah.

tawdry vapor
# spring hinge https://paste.pythondiscord.com/ivuhahawex

Does /sys/fs/cgroup/ exist on your system?
Which cgroup version is your system using: v1, v2, or hybdrid? Snekbox determined that your system uses v2, but there may be a bug and it got it wrong. There are commands to check which version your system uses, but I don't have them at hand.

Also check if the memory controller is enabled. I believe you can look at /sys/fs/cgroup/cgroup.subtree_control or /sys/fs/cgroup/cgroup.controllers to see which controllers are enabled, assuming your system uses cgroup v2

#

Also try passing the verbose option to nsjail and then share the logs here. Several ways to do this (choose one):

  1. Mount a custom nsjail config using a Docker volume or bind mount.
  2. Modify the default config at config/snekbox.cfg. Then rebuild the Docker image
  3. Modify the source code of nsjail.py to pass the option --verbose to the nsjail subprocess. Then build the Docker image.
#

I don't think the error you get from nsjail is directly related to the warning you get about swap memory. Snekbox will tell nsjail to disable swap memory limits in such case. The error you get from nsjail is about memory.max, which I believe is separate from the swap memory limit.

spring hinge
tawdry vapor
spring hinge
clever wraith
#

if bot#2646 gets approved we should find all replies where markdown could be used

dusky shoreBOT
buoyant adder
clever wraith
buoyant adder
#

no its not help i just pated that in the wrong room

green oriole
#

@patent pivot I would like to fill a formal complaint toward metricity not being kubenootes friendly

#

the config file is in the same folder as the app

#

would y'all accept a PR that make it also look into /config/config.toml?

#

or even better, use an env var to set the config location

#

yeah imma just PR that lmao

#

would appreciate a merge, as this is blocking my deployment πŸ’™

sharp crag
#

Scratch that, has fixed itself for other users too :P
Still might want to check logs to see what went wrong, if possible

hoary haven
#

i recall i think Scale had identified some bug with this but unsure whether this is the same or something new

clever wraith
#

I'll try to have a look at logs, if I find any, later on

#

Yeah, i can see something wrong in the logs happening with that view.

#

I'm on mobile so it's pretty impractical. I'll give more details later

#

It's failing upon sending the followup message (the one that says that a role has been added / removed).

We're getting a 404 unknown webhook.

It could be a discord api issue for all i know atm

vale ibex
vale ibex
dusky shoreBOT
vale ibex
green oriole
vale ibex
#

so depends on what "work" means in your context

green oriole
#

I can try that

vale ibex
#

Yea, mountPath is where to mount it subPath is a way to select a path within the volume to mount

#

it's also useful if you have a single volume with a few directories, but you only want to mount a certain directory into one container, and another in another container

vale ibex
#

I've also fixed an issue with the pride facts cog, where it was giving this error #sir-lancebot-playground message due to the facts being year-specific sir-lancebot#1302

dusky shoreBOT
green oriole
#

root[14] INFO Waiting for guild 267624335836053506 to be avialable before loading extensions.
nice one lmao

#

ah okay that's the pydis ID

#

yeah that ain't gonna work

vale ibex
#

what do your manifests look like?

green oriole
#

I just typo-ed the file name, it is my bad

vale ibex
green oriole
#

hm

#

I wonder what this is running then

vale ibex
#

newer version of bot-core I mean, and we haven't bumped metricity to use it

green oriole
#

oh right

#

I see

vale ibex
green oriole
#

I've used the env var as it is what I had yesterday

#

buuuut it ain't working

#

alright time to spawn a shell and look

#

hmmmmmmmmm it is reinserting all the users

#

that doesn't sound correct lmao

#

dooooooes it do that all the time on startup?

#

oh it seems like it

vale ibex
#

Yea, it'll resync all users on startup

green oriole
#

it appears to be working

vale ibex
#

Nice

#

with env var, or subPath mount?

green oriole
#

env var

#

I didn't bother changing it

#

thanks for the quick merge btw

vale ibex
#

No worries

#

I'm gonna bump some deps and migrate to ruff now

#

since I have the repo cloned :P

stable mountainBOT
#

bot/exts/info/subscribe.py line 149

await interaction.response.edit_message(view=self.view)```
`bot/exts/info/subscribe.py` line 139
```py
await interaction.followup.send(```
clever wraith
#

Unless the update_view throws, but we then stop the view so it shouldn't be visible.

vale ibex
#

it just stops listening for interactions

clever wraith
#

🀦

vale ibex
#

I'll add a fix onto my pr

dusky shoreBOT
timid sentinel
#

I'm getting an error when trying to run that PR, although it doesn't seem to be related to the PR afaict, happens when clicking the subscribe buttons

Traceback (most recent call last):
  File "C:\Users\wookie\AppData\Local\pypoetry\Cache\virtualenvs\bot-hu2rt1Uv-py3.11\Lib\site-packages\discord\ui\view.py", line 427, in _scheduled_task     
    await item.callback(interaction)
  File "C:\Users\wookie\Documents\GitHub\bot\bot\exts\info\subscribe.py", line 101, in callback
    await self.update_view(interaction)
  File "C:\Users\wookie\Documents\GitHub\bot\bot\exts\info\subscribe.py", line 108, in update_view
    await interaction.followup.edit_message(view=self.view)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Webhook.edit_message() missing 1 required positional argument: 'message_id'

any ideas?

clever wraith
#

Are you running that in a container?

vale ibex
#

interaction.followup is a webhook, so you can't use it to edit arbitrary messages, only ones sent by webhooks with the same token

clever wraith
#

But how come it will hit a message that wasn't sent by the original view? Isn't that the message trigger?

vale ibex
#

Since the message can be sent by the bot, rather than a webhook

#

If you use the command

clever wraith
#

Do we still want to keep the command?

#

I feel like (from a quick search) that it isn't use much

#

Used *

#

The view has been there for a while, and I think people have gotten used to its existence

#

We can cleanup the cog even further

timid sentinel
# vale ibex <https://github.com/python-discord/bot/compare/4f56b6112b598625288cd6d573e64b920...

I still seem to be getting an error when clicking the buttons

2023-06-21 15:36:55 | discord.ui.view | ERROR | Ignoring exception in view <RoleButtonView timeout=300 children=6> for item <SingleRoleButton style=<ButtonStyle.danger: 4> url=None disabled=False label='Remove role Advent of Code' emoji=None row=0>
Traceback (most recent call last):
  File "C:\Users\wookie\AppData\Local\pypoetry\Cache\virtualenvs\bot-hu2rt1Uv-py3.11\Lib\site-packages\discord\ui\view.py", line 427, in _scheduled_task
    await item.callback(interaction)
  File "C:\Users\wookie\Documents\GitHub\bot\bot\exts\info\subscribe.py", line 105, in callback
    await send_function.send_message(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Webhook' object has no attribute 'send_message'
cold island
#

Is the command what's causing the complication? I don't mind getting rid of it

vale ibex
#

Yea, the command adds quite a bit of complexity, since the command and the button share the same view

fallen patrol
#

tfw discord breaks your bot

still comet
#

I'm trying to get my own instance of @stable mountain working, but it's throwing this error: ```
/usr/local/bin/docker-compose -f /Users/danielgu/Repositories/python-bot/docker-compose.yml -p python-bot up
[+] Running 1/5
✘ metricity Error 0.8s
β ‡ web Pulling 0.8s
β ‡ postgres 8 layers [β €β €β €β €β €β €β €β €] 0B/0B Pulling 0.8s
β ‡ redis 6 layers [β €β €β €β €β €β €] 0B/0B Pulling 0.8s
β ‡ snekbox-311 14 layers [β €β €β €β €β €β €β €β €β €β €β €β €β €β €] 0B/0B Pulling 0.8s
no matching manifest for linux/arm64/v8 in the manifest list entries
docker-compose process finished with exit code 18


Run configuration (Docker-compose):
#

Am I missing something here?

#

(same error when trying to run through terminal with poetry run docker-compose up)

vale ibex
#

keep in mind docker-compose is deprecated, it's docker compose now (no hyphen)

still comet
vale ibex
#

you might find this happens a lot on other repos, since we don't build for apple silicone

#

adding that env var at the start tells docker to use the amd64 image instead

still comet
#

Oh I see

clever wraith
#

im trying to spin up an instance of snekbox but each time i execute code i get greeted with

2023-06-26 18:55:04,689 |     9 |                 snekbox.nsjail |     INFO | Executing code...
2023-06-26 18:55:04,778 |     9 |                 snekbox.nsjail |     INFO | Found 0 files.
2023-06-26 18:55:04,779 |     9 |                 snekbox.nsjail |    ERROR | Couldn't open '/sys/fs/cgroup/NSJAIL.11/memory.swap.max' for writing: No such file or directory
2023-06-26 18:55:04,780 |     9 |                 snekbox.nsjail |  WARNING | Could not update memory.swap.max
2023-06-26 18:55:04,780 |     9 |                 snekbox.nsjail |    ERROR | Couldn't initialize cgroup 2 user namespace for pid=11
2023-06-26 18:55:04,780 |     9 |                 snekbox.nsjail |    ERROR | Launching child process failed
2023-06-26 18:55:04,782 |     9 |                 snekbox.nsjail |     INFO | nsjail return code: 255``` im building it from source, locally on my rpi i checked the makefile of nsjail there isnt any cross compiling so it is being compiled for arm64, but it doesnt work, could anyone help me with this at all? the file `/sys/fs/cgroup/NSJAIL.11/memory.swap.max` never gets created after executing code, just the `NSJAIL.11` directory
static canyon
clever wraith
#

i git cloned it and built the docker image that way

static canyon
#

I'm not familiar enough with how this stuff works tbh

clever wraith
#

nvm, re ran it and now it seems to have booted fine

#
2023-06-26 19:15:47,932 |     1 |                 gunicorn.error |     INFO | Starting gunicorn 20.1.0
2023-06-26 19:15:47,934 |     1 |                 gunicorn.error |     INFO | Listening at: http://0.0.0.0:8060 (1)
2023-06-26 19:15:47,934 |     1 |                 gunicorn.error |     INFO | Using worker: sync
2023-06-26 19:15:47,943 |     8 |                 gunicorn.error |     INFO | Booting worker with pid: 8
2023-06-26 19:15:47,994 |     8 |                 snekbox.nsjail |     INFO | Assuming cgroup version 2.
2023-06-26 19:15:48,011 |     9 |                 gunicorn.error |     INFO | Booting worker with pid: 9
2023-06-26 19:15:48,033 |     9 |                 snekbox.nsjail |     INFO | Assuming cgroup version 2.``` and no errors yet
atomic ivy
#

try sending it some code

clever wraith
#

yep about to do that

#

and once again

2023-06-26 19:16:41,463 |     8 |                 snekbox.nsjail |     INFO | Executing code...
2023-06-26 19:16:41,554 |     8 |                 snekbox.nsjail |     INFO | Found 0 files.
2023-06-26 19:16:41,555 |     8 |                 snekbox.nsjail |    ERROR | Couldn't open '/sys/fs/cgroup/NSJAIL.11/memory.swap.max' for writing: No such file or directory
2023-06-26 19:16:41,556 |     8 |                 snekbox.nsjail |  WARNING | Could not update memory.swap.max
2023-06-26 19:16:41,556 |     8 |                 snekbox.nsjail |    ERROR | Couldn't initialize cgroup 2 user namespace for pid=11
2023-06-26 19:16:41,557 |     8 |                 snekbox.nsjail |    ERROR | Launching child process failed
2023-06-26 19:16:41,558 |     8 |                 snekbox.nsjail |     INFO | nsjail return code: 255```
#

memory.swap.max isnt being created

clever wraith
#

i set it to a high number, low number, zeros too

vale ibex
#

@spring hinge you had a very similar issue recently, did you ever come up with a fix?

#

Couldn't open '/sys/fs/cgroup/NSJAIL.11/memory.swap.max' for writing: No such file or directory

vale ibex
clever wraith
#

in my case both /sys/fs/cgroup/cgroup.subtree_control and /sys/fs/cgroup/cgroup.controllers output cpuset cpu io pids and /sys/fs/cgroup exists

#

@tawdry vapor have you got any more tricks up your sleeve?

tawdry vapor
#

Looks like your system does not have the memory controller enabled

#

I have not personally encountered this so I don't know how to enable it. Maybe it's as simple as writing +memory into the file?

clever wraith
#

what file?

clever wraith
#

ill try that out

tawdry vapor
#

I believe the controller has to be enabled in cgroup.controllers in order for it to be enabled in subtree_control

#

If that's the case I'm not sure if there's something special to be done to enable the controller for the root cgroup

clever wraith
#
jan@raspberrypi:~/snekbox $ sudo echo "+cpu +memory -io" > /sys/fs/cgroup/cgroup.subtree_control
-bash: /sys/fs/cgroup/cgroup.subtree_control: Permission denied``` eh
tawdry vapor
#

Iirc you cannot change it if the cgroup already has child processes in it

clever wraith
#

and how do i disable the child process? i dont even know what it could be

tawdry vapor
#

This is new territory so I think you'll have to do some research to find how to enable the memory controller for the root cgroup

#

If you figure it out please let us know and I'll add it to a faq on snekbox

clever wraith
#

doubt ill figure it out on my own but ill try

spring hinge
clever wraith
#

could try reinstalling ubuntu server on my pi

clever wraith
#

@tawdry vapor re installed ubuntu

2023-06-26 20:33:28,835 |     9 |                 snekbox.nsjail |     INFO | Executing code...
2023-06-26 20:33:28,886 |     9 |                 snekbox.nsjail |     INFO | Found 0 files.
2023-06-26 20:33:28,887 |     9 |                 snekbox.nsjail |  WARNING | 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
2023-06-26 20:33:28,888 |     9 |                 snekbox.nsjail |    ERROR | Launching child process failed
2023-06-26 20:33:28,888 |     9 |                 snekbox.nsjail |  WARNING | Received error message from the child process before it has been executed
2023-06-26 20:33:28,889 |     9 |                 snekbox.nsjail |    ERROR | Couldn't launch the child process
2023-06-26 20:33:28,890 |     9 |                 snekbox.nsjail |     INFO | nsjail return code: 255``` new error
#

this one seems a bit more fixable haha

#

@atomic ivy seems like u had something similar..

#

and i am on a 64-bit operating system, yes

atomic ivy
#

looks vaguely familiar
but unfortunately I didn't investigate further and kinda gave up running snekbox on the Mac

clever wraith
#

dang it

#

@tawdry vapor any ideas? ur pretty smart

tawdry vapor
#

I don't know what ubuntus directory structure is like, but the point of mounting lib64 is so that python has access to the shared libraries it needs to run.

Just figure out where those are stored on ubuntu and mount that directory.

gritty wind
#

I don’t think this is necessarily an OS issue, I’ve tested snekbox on all the popular ones

#

But that advice probably holds either way

#

Doing this on a pi is brave for sure haha

clever wraith
#

i really dont know why it doesnt work anymore

clever wraith
gritty wind
#

Could you do ls /

clever wraith
gritty wind
#

Just double checking, are you on a 32-bit system?

clever wraith
#

pretty sure its 64 but how can i check

gritty wind
#

Either way, if your system doesn't have it, you can probably just remove it from snekbox completely

#

Try deleting these lines and rebuilding

stable mountainBOT
#

config/snekbox.cfg lines 60 to 65

mount {
    src: "/lib64"
    dst: "/lib64"
    is_bind: true
    rw: false
}```
clever wraith
#

it wont cause it to be unsafe right

gritty wind
#

The possible side-effect of this change is completely breaking python

#

So if it doesn't break, it doesn't affect safety

clever wraith
#

ah okay

gritty wind
#

(It won't break python fwiw)

clever wraith
#

idk how docker works really, do i need to rebuild it with --no-cache?

gritty wind
#

Shouldn't be necessary

clever wraith
#

IT WORKS

gritty wind
#

Oh that's good news

clever wraith
#

although i think ill have to re install it again.. i think i broke my pip with upgrading python

gritty wind
#

That is an interesting color pallete

clever wraith
#

im in powershell

gritty wind
#

Did you figure out if it's 64 or 32 bit

#

This could be helpful for solving the problem in a more permanent way

clever wraith
#

uname -m says aarch64, so 64 bit i assume

gritty wind
#

Alright, good to know

#

Thanks

clever wraith
#

running python2 outputs this

jan@raspberrypi:~/MatrixBot/src$ python2
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 28, in <module>
    from CommandNotFound import CommandNotFound
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in <module>
    from CommandNotFound.db.db import SqliteDatabase
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'``` so i think i broke the installation or something
gritty wind
#

Haven't seen this error before but the general recommendation seems to be reinstalling python3-apt with your package manager (apt)

#

In this case it'd probably be python2-apt

clever wraith
#

ill try, thanks so much for snekbox, i spent all day on that thing, turns out i had to use non-debian distro after all

gritty wind
#

@tawdry vapor for this issue, perhaps we should look into making some of the mounts non-mandatory. I imagine if they don't exist and the system python doesn't fail then they aren't necessary to mount

clever wraith
#

How does removing those mounts influence the cgroups Scale?
Why are we mounting those already?

gritty wind
#

Try seeing what's in your lib64 folders, but as Mark pointed out they are shared libraries which can be used by your applications, including python

#

However if your OS doesn't have those to begin, and python still runs on your OS, then they aren't necessary when mounting in snekbox

#

The cgroups issue is independent, seems to have been more about the OS being used (it was switched half way through the help session)

#

A large factor for these issues is also the hardware (rpi)

#

OSes are just built different

clever wraith
#

Alright, i see

clever wraith
#

seems like its an issue with debian

tawdry vapor
#

It's also just not as nice when we need to have config in code instead of in the config file.

gritty wind
#

Mandatory is part of the config file, it just ignores it instead of erroring if the directory doesn’t exist

#

Nsjail handles any complexity

#

I get the slippery slope argument, but there are only like 5 mounts, and I’m pretty sure one of them is python itself

tawdry vapor
#

Mandatory is part of the config file, it just ignores it instead of erroring if the directory doesn’t exis
Oh I didn't know that. Yeah let's just do that then

#

IDK why I quoted that I forgot I can reply

sharp crag
#

Hello - could I get a review on python-discord/sir-lancebot#1223 and python-discord/bot#2316 ? I believe I've commited the requested changes. Thanks!

dusky shoreBOT
clever wraith
gritty wind
tawdry vapor
#

For some things the container relies on the host. Like cgroups for example. Maybe that applies to root directories as well. I'm not sure

gritty wind
#

Thank you, I’ll keep looking

royal prawn
#

i suppose #reddit should be re-enabled given python hasn't been private for several days now

royal prawn
#

ah, i see, all the posts are by the mods, with comments allowed. fair fair

outer oasis
thorny obsidian
#

The webhook still won't function, no new posts are being allowed besides the automated ones and moderator ones.

warm wren
#

lol

#

hi guys

#

i have a budget of $2500

#

what best i can have for gaming

rapid swallow
#

!ot

stable mountainBOT
rapid swallow
warm wren
#

oh i am so sorry i actually was writing on that only but accidently written on this lol

#

my bad

sharp crag
#

Hi! Do you have a question about one of Python Discord's repositories/projects?

clever wraith
#

recovery action successful

clever wraith
#
❯ docker compose up
[+] Running 0/2
 β Ή web Pulling                                                                                                                                         1.1s 
 β Ή metricity Pulling                                                                                                                                   1.1s 
no matching manifest for linux/arm64/v8 in the manifest list entries
``` so thats what i get when i try to run `docker compose up` in the main `bot` project any ideas?
atomic ivy
#

add

platform: linux/amd64

in web, metricity, and snekbox

clever wraith
clever wraith
#

updated bot#2646 with example look

dusky shoreBOT
timid sentinel
#

Huh, I did not realise that discord.ext.tasks.loop automatically reruns tasks by default on some errors. The implementation doesn't seem great though because:

  • The error is never logged.
  • There is no limit on the number of times it will retry afaict.
  • The error may not be something that will be fixed by retrying.

Caught me out testing bot#2662 as for python_news the loop was running but nothing was being output. Turns out there was an SSL error that was being suppressed and causing the function to keep looping and failing without any log output.

IMO this feature does not seem helpful. If we want rerun logic I think it should be explicit, more localised than a whole loop function, only handle errors that are expected, and include logging + limits.

There is a reconnect parameter you can set to false, although it could be worth having a botcore wrapper for loops that makes it default to false, or could reimplement the rerunning logic but better...

clever wraith
#

What happens when you set reconnect to False ? Does the exception flow ?

timid sentinel
clever wraith
#

I'll look it up after lunch

timid sentinel
#

It should be possible, I guess that would be an argument for having a utility in botcore, since it gives us more flexibility.

clever wraith
timid sentinel
outer oasis
#

Ruff is trying to change these two lines
AFAICT, this should be fine
Is there a specific reason they were like this?

gritty wind
#

The first one looked stupid in the left version

#

The second one is for better diffs

bleak temple
clever wraith
static canyon
static canyon
#

It wasn't a bot restart, so that's the next most likely thing

clever wraith
rapid swallow
#

@clever wraith they're talking about this

clever wraith
#

Yeah I wasn't quite sure to be honest, that's why I asked the question.

#

@clever wraith Is that what you were asking ?

#

yeah thats what i was asking if you can select range of lines

clever wraith
#

Yeah that'll be the CodeSnippet cog

#

!source CodeSnippets

stable mountainBOT
#
Cog: CodeSnippets

Cog that parses and sends code snippets to Discord.

Source Code
clever wraith
#

I'm not sure it's worth having for the paste service though

clever wraith
clever wraith
#

but its 1 line only for now at least

crisp lily
#

I was trying to contribute to an open source project by forking it, then cloning it remotely and then when I did git clone ... I got this error message, I don't know what happened, if I should be alarmed, or what I should do.

I tried turning on VPN and then clone again to protect against man-in-middle attacks, but I still got it

Cloning into 'mkdocs-material'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:123456abcd.
Please contact your system administrator.
Add correct host key in /c/Users/username/.ssh/known_hosts to get rid of this message.
Offending RSA key in /c/Users/username/.ssh/known_hosts:1
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
clever wraith
#

@sharp crag sir-lancebot#1223 Is ready for you to update it, then one of us will merge it!

dusky shoreBOT
static canyon
#

Also @sharp crag, if your PR ^ does fix sir-lancebot#1179 (I seem to remember you saying it does), can you please add "Closes #1179" to the top of your PR so that it'll close both issues

clever wraith
#

ah

#

thanks to @stark crypt now it will be possible

stark crypt
#

i am not sure where to bump the version for deployment, i doubt i have the necessary perms anyway
i am sure the dev(o)ops team will get on it when they have bandwidth πŸ˜‰

clever wraith
#

Thanks ! I've raised it internally, and we'll deploy the new version

#

what about the bot#2679 tho THINKING

dusky shoreBOT
stark crypt
stark crypt
#

sweet πŸŽ‰

vale ibex
#

annoyingly, clicking the dropdown no longer shows you the Python at the top of the list though

#

it shows you where Python is in the "normal" list

#

so you don't get to see the preferred lexers easily

stark crypt
#

oh? is this not what you are seeing?

vale ibex
#

I see this

#

hmmmm, clearing cache and reloading seems to have fixed it

#

probably had some old js in there

stark crypt
#

potentially, the regular "Python" option is still buried down there even there is one at the top, feel like that's a bug πŸ€·β€β™‚οΈ imo same option should not be shown twice
but hey if it works ain't broke don't fix it heh

sharp crag
clever wraith
#

Nothing, i just wanted you to do it (update the branch)

sharp crag
#

Oh right, done as well βœ…

pine needle
#

Hi everyone, I've been doing a commit here (this is a first for me). I read about these protected branches and didn't understand anything. Do I need to do something or will everything be fine?

rapid swallow
#

After your Pr gets two approvals from staff, a core dev will merge your branch to main

pine needle
#

Got it. thnx.

clever wraith
# pine needle Hi everyone, I've been doing a commit here (this is a first for me). I read abou...

Protected branches are usually a concept in applications that allow code hosting and version control.

It's just a set of rules that allow/disallow things for specific users when they're trying to do specific actions into branches. Like merging code, or pushing straight to it, etc.

We do this so that, obviously, not everyone will be able to introduce code we haven't reviewed to our repositories.

atomic ivy
#

!rule 6 Remove your advertisement

stable mountainBOT
#

6. Do not post unapproved advertising.

arctic marten
#

Hi

clever wraith
#

bot#2460 is this accepted? if so i can work on this

dusky shoreBOT
drowsy ravine
#

Hey all,
Can I give praise to the people / person who worked on the new !pastebin.
It looks great and now also works on mobile with lining up line numbers.
Nice to see the "multiple file" upload as well, although I havent used it myself yet, seen it shared by others, looks great!
Thanks for doing that ❀️

clever wraith
#

That'd be the great Chris man @vale ibex

cold island
cold island
clever wraith
#

hi, i know this isnt much python related but i love the snekbox, is there a way to sort of make it work with node or something?

vale ibex
tawdry vapor
#

Oh I was scrolled up..I guess we have two different interpretations of your question

#

My answer is for if you meant you want to make snekbox evaluate JS code

vale ibex
#

Hah yea we both read that quesiton differently, but both work :P

clever wraith
clever wraith
clever wraith
tawdry vapor
#

I don't think nsjail cares where the binary is, as long as it's accessible

tawdry vapor
clever wraith
#
exec_bin_py {
    path: "/usr/local/bin/python"
    arg: "-BSqu"
}

exec_bin_node {
    path: "/usr/local/bin/node"
    arg: ""
}
``` ive tried to do it like this but seems like that wont work as its expecting just exec_bin
tawdry vapor
#

You want it to support both python and js?

clever wraith
#

yeah i want it to evaluate both python and js

clever wraith
#

but config.proto expects just exec_bin in there

#

and i suppose i cant have 2 exec_bins

tawdry vapor
#

You need to have separate configs then. And you'll need another instance of this https://github.com/python-discord/snekbox/blob/main/snekbox/api/snekapi.py#L30 that uses the different config path..the easiest way then would be to have a separate api route for the 2nd language but that likely results in some copy pasting. You could be clever and re-use one route but I haven't thought about what that would look like exactly

stable mountainBOT
#

snekbox/api/snekapi.py line 30

nsjail = NsJail(*args, **kwargs)```
clever wraith
tawdry vapor
stable mountainBOT
#

snekbox/nsjail.py line 52

config_path: str = "./config/snekbox.cfg",```
clever wraith
tawdry vapor
#

The config is directly for nsjail. It is not our config schema. Nsjail does not support configuring multiple binaries cause it wouldn't make sense.

clever wraith
#

so there isnt a way to merge the 2 configs into 1 api then?

#

i could make my own config.proto

tawdry vapor
#

We pass the config to NsJail. If you change config.proto then you need to make your own build of NsJail that understands that new config schema. In any case, that is approach is not necessary.

#

You can just create two NsJail() objects and pass a different config to each. You can modify the EvalRoute to accept two NsJail objects (one for JS and one for Python). Or something along those lines.

#

I'm not saying that's the nicest way to architect the code for supporting multiple languages, but it will at least get you going.

clever wraith
#

so there isnt a way to make the endpoint accept 2 languages?

tawdry vapor
#

Doing it in a nicer way would require more thought - the code was not designed with multiple languages in mind so it's gonna be a bit awkward without some redesigns

clever wraith
#

theres no EvalRoute? u meant this?

    def __init__(self, *args, **kwargs):
        super().__init__()

        nsjail = NsJail(*args, **kwargs)
        self.add_route("/eval", EvalResource(nsjail))
tawdry vapor
#

Yes, sorry, EvalResource

#

So something like

#
nsjail_py = NsJail(*args, config_path='...', **kwargs)
nsjail_js = NsJail(*args, config_path='...', **kwargs)
self.add_route("/eval", EvalResource(nsjail_py, nsjail_js))

And then EvalResource has something like

if request is for python:
    self.nsjail_py.python3()
else if request is for js:
    # The function is still called python3 which is a little weird
    # but it's just a name - the config dictates which interpreter is executed
    self.nsjail_js.python3()
clever wraith
#

i've added a parameter language so i can just do if language == "python": as well no?

tawdry vapor
#

yes, that was just pseudocode

clever wraith
#

do i need to chmod anything or something

tawdry vapor
#

What's the full error?

clever wraith
tawdry vapor
#

That doesn't look like the full error - it got cut off?

clever wraith
#

no, thats all thats the entire thing

#

hmm oh wait

#
    def __init__(self, nsjail: NsJail):
        self.nsjail = nsjail``` probably need to change this too right @tawdry vapor but to what? do i just do nsjail_py = nsjail and then nsjail_js = nsjail or what
tawdry vapor
#

Change the function signature to accept two NsJail arguments and then you need to assign each to its own instance field

clever wraith
#

ah right thought there would be a little bit more dynamic way to do this but i guess its fine for now

#

nvm

#

my bad

clever wraith
#

okay @tawdry vapor ive done it
but

execve('/usr/bin/node') failed: No such file or directory

root@493731395b15:/snekbox# /usr/bin/node -e "console.log('hi')"
hi
#

so i don't know whats going on here

clever wraith
#

uhhh ```
{"stdout": "node[1]: pthread_create: Resource temporarily unavailable\n", "returncode": 139, "files": []}⏎

tawdry vapor
#

How did you add node to the container?

#

You are most likely missing some mounts in the nsjail config

#

Oh I see the other error now

#

I don't knew what that means exactly

#

Try increasing the memory limit in nsjail

#

Or in general playing with the limits until it works

clever wraith
#

oh so both configs must match eachother i just change the exec_bin right

#

and u mean this? cgroup_pids_max: 6 or what

tawdry vapor
#

I meant the memory limit but you can also try increasing pids

clever wraith
#

wont this make it less secure by anything or make it slow down anything?

tawdry vapor
#

And no the config won't exactly match, they likely need different mounts

#

It doesn't make it less secure it just lets the process use more resources

clever wraith
#

apparently i can limit the threads in node itself

#

set the threads to 6 and nsjail return code: 137 amazing

#
2023-07-21 00:48:01,880 |     9 |                   nsbox.nsjail |     INFO | Executing code...
2023-07-21 00:48:02,457 |     9 |                   nsbox.nsjail |     INFO | Found 0 files.
2023-07-21 00:48:02,457 |     9 |                   nsbox.nsjail |     INFO | pid=11 ([STANDALONE MODE]) terminated with signal: SIGSEGV (11), (PIDs left: 0)
2023-07-21 00:48:02,457 |     9 |                   nsbox.nsjail |     INFO | nsjail return code: 139```

and it returns this 
`{"stdout": "", "returncode": 139, "files": []}`
clever wraith
tawdry vapor
#

If you fixed the pthread issue already then never mind

#

If you have a segmentation fault then I'd guess you're missing some mount for a shared library or something along those lines

clever wraith
#

oh hmm what could nodejs be using

clever wraith
tawdry vapor
#

No

#

If you can run node in the container, outside of nsjail, then you already have everything you need. You just need to give nsjail access via mounts

clever wraith
#

but access to what

tawdry vapor
#

Shared libraries

#

Use ldd

#

I think the python config already mounts then all but maybe not

#

If it's not a mount issue then I have no idea why you get a seg fault

clever wraith
tawdry vapor
#

Ldd tells you which libs a binary uses

clever wraith
#
    linux-vdso.so.1 (0x00007ffe02fa9000)
    libnode.so.64 => /usr/lib/x86_64-linux-gnu/libnode.so.64 (0x00007fd726a5a000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd726a3c000)
    libuv.so.1 => /usr/lib/x86_64-linux-gnu/libuv.so.1 (0x00007fd726a0f000)
    libbrotlidec.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fd726a00000)
    libbrotlienc.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlienc.so.1 (0x00007fd726972000)
    libcares.so.2 => /usr/lib/x86_64-linux-gnu/libcares.so.2 (0x00007fd72695e000)
    libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fd726670000)
    libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007fd7265dd000)
    libicui18n.so.63 => /usr/lib/x86_64-linux-gnu/libicui18n.so.63 (0x00007fd726302000)
    libicuuc.so.63 => /usr/lib/x86_64-linux-gnu/libicuuc.so.63 (0x00007fd726133000)
    libicudata.so.63 => /usr/lib/x86_64-linux-gnu/libicudata.so.63 (0x00007fd724743000)
    libatomic.so.1 => /usr/lib/x86_64-linux-gnu/libatomic.so.1 (0x00007fd724739000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd724732000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd724728000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd7245a4000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd724421000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd724407000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd7243e6000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd724224000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fd728017000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fd72420b000)
    libbrotlicommon.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fd7241e8000)
#

there dont seem to be any that are not found?

tawdry vapor
#

Make sure those directories are mounted in nsjail

clever wraith
#

i have mounted /usr/lib, /lib64, /lib

tawdry vapor
#

I dunno what the problem is then

clever wraith
#

do they need to be rw set to true maybe?

tawdry vapor
#

Doubtful but you can try

clever wraith
#

what does rw do anyways

tawdry vapor
#

It means read/write

#

If it's false then it's a read only mount

#

You can experiment with running node directly through nsjail command line until you find settings that work

#

There are a lot of settings to mess with

clever wraith
#

could it be that?

tawdry vapor
#

That's a different error than the segmentation fault isn't it?

clever wraith
#

yeah thats when i run nsjail --config config.cfg /bin/bash through the docker container

#
curl -X POST -H "Content-Type: application/json" -d '{"language":"python","input":"print(\'hi\')"}' http://localhost:8060/eval

{"stdout": "hi\n", "returncode": 0, "files": []}``` python works just fine
#
curl -X POST -H "Content-Type: application/json" -d '{"language":"nodejs","input":"console.log(\'hi\')"}' http://localhost:8060/eval

{"stdout": "", "returncode": 139, "files": []}``` nodejs doesnt return aything
tawdry vapor
#

Yeah that won't work because nsjail will not automatically create the cgroup directory it needs. It has to be created manually beforehand. This is part of the work snekbox does. You can do it manually or you can just disable the cgroup limits for now while youre debugging

clever wraith
#

mkdir('/sys/fs/cgroup/pids/NSJAIL/NSJAIL.17', 0700) so i run the mkdir file on that yeah

tawdry vapor
#

I think the parent dir is what you need

#

So remove nsjail17

clever wraith
#
[E][2023-07-21T01:51:33+0000][49] bool util::writeBufToFile(const char*, const void*, size_t, int)():95 Couldn't open '/sys/fs/cgroup/pids/NSJAIL/NSJAIL.50/pids.max' for writing: No such file or directory
``` now i get this and i cant make files in that directory so
#

i dont understand why its not working

tawdry vapor
#

Hmm maybe the pids controller is not enabled. I suggest you just remove the cgroup stuff from the config for now..I doubt it's the reason for the segfault

clever wraith
#

should i remove memory too or not

tawdry vapor
#

All cgroup stuff

clever wraith
#

now i get this

[E][2023-07-21T01:59:08+0000][1] bool mnt::initNsInternal(nsjconf_t*)():487 chdir('/home'): No such file or directory
#

but /home exists

#

@tawdry vapor 2023-07-21 02:02:24,027 | 9 | nsbox.nsjail | INFO | Executing code... 2023-07-21 02:02:24,381 | 9 | nsbox.nsjail | INFO | Found 0 files. 2023-07-21 02:02:24,382 | 9 | nsbox.nsjail | INFO | pid=24 ([STANDALONE MODE]) exited with status: 0, (PIDs left: 0) 2023-07-21 02:02:24,382 | 9 | nsbox.nsjail | INFO | nsjail return code: 0 i think i found the issue, but it still doesn't output anything

#

oh now were getting somewhere

#

changed the cwd to /snekbox instead of /home now it works

#

oh nvm im dumb okay lets see

#

root@eb66b59ed0c8:/nsbox# nsjail --config /config/nsbox_js.cfg /usr/bin/node sc.js

outputs:
[Function: Object]

sc.js:

console.log(this.constructor)``` so it seems to execute, now why dont i get any output when i use curl
trim cradle
#

Is it possible to have a command that deletes a thread given its snowflake, without having to iterate through any history?

cold island
#

and what's the use case

trim cradle
#

But I don't want to waste API calls iterating through the history of python-help to find the thread they want to delete (it might have been months ago)

clever wraith
#

sick, i got it working! nodejs on snekbox

#

now i just need to limit the vram

clever wraith
#

perfect, thank you @tawdry vapor so much for your help

vale ibex
#
post = await pydis_core.utils.channel.get_or_fetch_channel(post_id)
await post.delete()
#

obviously with validation in there to make sure the ctx.author is the post's owner and whatever else would be needed

tawdry vapor
clever wraith
# tawdry vapor Np glad you figured it out

haha, back at it again

ERROR | execve('/usr/bin/csharp') failed: No such file or directory
``` does this mean i forgot to mount something? Cus if i bash into the docker container i can run that executable just fine, also ldd outputs that its not a dynamic library
clever wraith
# tawdry vapor Np glad you figured it out

so since its not dynamic, it shouldnt need any special mounts, and should just run the app right? if i exec into the container i can run the executable no problem in the nsjail config i mount the src usr bin csharp to dst usr bin csharp so thats not an issue either i dont know

tawdry vapor
#

It's vague what they mean by a "script"

#

Mounting /usr/bin/csharp should be enough

#

Try mounting that chsarp binary in another language's config (one that you know works), and then evaluate some code in that language that checks if the csharp binary exists

#

As a sanity check

clever wraith
tawdry vapor
#

yeah

clever wraith
#

ill try in a sec, and if it does exist then what and if it doesnt then what

tawdry vapor
#

not sure. maybe the debug logs for nsjail will reveal something useful

clever wraith
clever wraith
# tawdry vapor yeah

idk if it might be helpful but its a bash script running exec /usr/bin/mono/ which i have mounted ran ldd on that says lib64 and /usr/lib should be there and ive mounted those also

tawdry vapor
#

So /usr/bin/csharp is a bash script?

#

If so, don't you need bash mounted? And shouldn't the command be something like /usr/bin/bash /usr/bin/csharp?

clever wraith
tawdry vapor
#

I don't understand why you even need a shell script to execute mono

#

Just execute mono directly

tough hull
#

YYY

thorny obsidian
#

@clever wraith r/Python was inaccessible because the subreddit went private for a period of time.

clever wraith
#

Is there some place where they talk about why it went private ? (I'm just curious, that's all)

thorny obsidian
clever wraith
#

Alright, understood.
Thank you ! (you too @outer oasis )

dull swan
#

https://www.pythondiscord.com/pages/guides/pydis-guides/how-to-contribute-a-page/#having-the-category-also-be-a-page
In the above guide, it lists the following hierarchy to define having a category also be a page.

guides
β”œβ”€β”€ contributing.md
β”œβ”€β”€ contributing
β”‚   β”œβ”€β”€ _info.yml
β”‚   └── bot.md
└── _info.yml``` I have replicated this....

guides
β”œβ”€β”€ venv-troubleshooting.md
β”œβ”€β”€ venv-troubleshooting
β”‚ β”œβ”€β”€ _info.yml
β”‚ └── os-selection.md
└── _info.yml```
However I'm getting some strange results, such as os-selection being rendered instead of venv-troubleshooting.md, and further, venv-troubleshooting.md not being present at all.

vale ibex
#

should os-selection.md be one-level higher, so that it's in the same dir as the folder?

#

since it looks like you have a category inside another category

dull swan
#

Figured it out, as is tradition, directly after I posted. Was missing an _info.yml

static canyon
#

@vale ibex / @clever wraith RE bot#2692 would it also be worth doing the same if the author is muted (especially if the mute is 1hr+, since the channel will be closed by the time they can message again)?

dusky shoreBOT
vale ibex
#

Not imo, since we'd also need to check if the mute was did to a false positive filter

#

I'd rather we keep it to bans for now and talk about mutes in another issue

static canyon
clever wraith
#

Mutes have a min value of one hour IIRC

#

!source mute

stable mountainBOT
#
Command: timeout

Timeout a user for the given reason and duration.

Source Code
clever wraith
#

I meant default*

static canyon
#

But the automutes are 5-15 mins, aren't they?

static canyon
atomic ivy
#

the ones given by bot are 10 minutes I think

static canyon
#

It shouldn't be that hard to add this logic to the mute & ban commands

vale ibex
#

I'd want to post to be closed even if the ban was from a filter

#

lets keep this issue for bans and we can talk about doing mutes in another issue.

#

If we're auto-closing based on ban, we should include that the post was closed due to the OP being banned in the close message

#

so that we don't get people coming in here saying the bot is bugged since it closed a post early

#

@clever wraith I've updated that bot-core PR

#

since app commands don't pass through process_commands anyway, there's no point in waiting for those to be sync'd

#

So I've just re-used the existing task

#

Think I'm just going to squash the fixups, since the diff is so small anyway

clever wraith
#

yeah go ahead & squash

#

In that case @vale ibex

#

Do you even need the extra wait_until_extensions_loaded method ?

vale ibex
#

I'd rather keep it yea

#

since it's consistent with wait_until_guild_available

clever wraith
#

Alright

#

Sounds good

#

Weird, I don't get why is pycharm still showing me the old code, even though I pulled then reloaded from disk.
The commit hash is the correct one (the latest one you force pushed)

#

I have both bot and bot-core projects attached, but when I open bot-core separately, it displays the correct code. XD

vale ibex
#

lol

#

Maybe pycharm is the problem

clever wraith
#

Yeah

vale ibex
#

Time to switch to gedit

clever wraith
#

best text editor

#

I have just one thing worrying me, let me verify first

vale ibex
#

actually, there's a problem

clever wraith
#

is it

vale ibex
#

if a 3rd party is using BotBase, but not using load_extensions() this won't work

clever wraith
#

re awaiting the task ?

vale ibex
#

nah that task is fine

clever wraith
#

Yeah

clever wraith
#

It's a usage issue

outer oasis
vale ibex
#

It's an easy fix, I've pushed a fixup

#

now it's entirely transparent

clever wraith
#

I mixed them up

slim sluice
clever wraith
#

Or gedit ?

slim sluice
#

Pycharm, the code might not work bc pycharm could be ood

#

(Out of date)

clever wraith
#

Alright, update in progress

#

Thanks !

#

Restarting my laptop did the trick earlier

slim sluice
#

Np

clever wraith
#

Don't know why the issue was happening

slim sluice
#

(I didn't know that would even work) 😳

clever wraith
#

It's surprising how often that could work ahahhaa

slim sluice
#

I didn't think u would ACTUALLY have an update lol

clever wraith
#

Which also didn't solve it ahahha

slim sluice
#

Lol u make that in html (I can identify html)

#

@zig WHADIDATNAMEEEE

pure plinth
#

I hope this is the correct place to ask about this! I'm wondering if there's a good way to find issues with the "Easy" label that aren't being worked on yet. I've tried using the "no:assignee" filter, but it seems like all or nearly all of the remaining issues have no assignee but do have linked PRs fixing them. How should I approach this differently?

Thanks for your help!

clever wraith
#

Hi, Yes it indeed the right channel.

We do have the: good first issue label, which is the equivalent of the: easy one you're looking for.

However, it's not present on all of our projects unfortunately

#

You can find it in bot, site and sir-lancebot especially (which are the projects that people contribute to the most)

#

!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
clever wraith
#

You can have a read at this for our contribution process/guidelines