#dev-contrib

1 messages ยท Page 72 of 1

late wolf
#

hey could someone take a look at meta/issues/65

green oriole
#

.issue 65 meta

green oriole
#

Iโ€™ll add the meeting tag anyway

cold moon
#

How to set Bulma variables what is in extension?

#

(tooltip)

sweet comet
#

im new and have no idea what to do

#

any tips

obsidian patio
#

Feel free to claim a help channel or ask in #python-discussion @sweet comet. This channel is for the development of PyDis repos

short snow
#

also you don't need to put that in every chanel ๐Ÿ˜„

brazen charm
#

Any ideas for https://github.com/python-discord/bot/issues/447? Matching the dot separated names as mark suggested sounds like the best idea to me but not sure how viable that'd be with the amount of items to look into, then there's also the matter of not displaying all the various attributes of the name that's looked up

#

Was thinking of doing it in 1014 first but couldn't really think of an implementation I'd be satisfied with and it's starting to feel like it'd be better of in an another pr anyway

tawdry vapor
#

Can you have access to all valid symbols names without having to scrape individual pages?

#

Regarding not showing attributes, I'm not sure how the names are stored. It's not as simple as matching a term against the symbol's suffix, is it?

brazen charm
#

We do have all the symbol names available after the inventories are fetched, the current way the wip pr stores them are symbol names that are used by users here pointing at tuples containing the URL, package it belongs to and its documentation group.
I'll have to think of the attributes more tomorrow, what exactly do you mean with matching the suffixes?

tawdry vapor
#

The important thing is that you can't rely on a cache for this. You have to have all pool of valid names available from the start

#

I mean if symbol = "module.Class.attribute", then if symbol.endswith(search_term") would fail given search_term = "Class", but it would pass if symbol = "module.Class"

short snow
hardy gorge
#

It's mostly a convenience feature, as you can poll for any GH username anyway

#

It does not have any other meaning than being able to see your stats more easily

green oriole
#

Well, we can't easily verify the ownership of the account anyway

hardy gorge
#

We could, using GitHub OAuth

#

but it's tedious and it would probably require someone to click on a link to open up a webpage

short snow
#

hmmmm, but wouldn't that require web?

#

ah yes like you mentioned

green oriole
#

Yeah, that wouldn't be easy

cold moon
#

Is this possible that bot take GH account from discord connected accounts?

hardy gorge
#

Linking your GH account for hacktoberfest does not have any meaning, though

#

It only uses publicly available data and it's more a convenience for you

#

If you link yourself to another user's account, you're mainly just making it harder for yourself

#

And gain nothing, as you can already use the command to poll any GH account you like

short snow
#

that's true, but ppl can always do that, lemme see if there can be a way to do that

hardy gorge
#

Why would you consider what you linked a bug in that case?

#

It does not grant you any sort of permissions, we don't take it as a proof of ownership for anything

#

It's just a way to let people poll their stats more easily; if they deliberately don't use it right, they only make things harder for themselves

#

You can now see joe's stats more easily than your own

short snow
#

yes, i get the point

surreal venture
#

Can someone review my pull request?

#

.pr 509

dusky shoreBOT
nocturne hare
#

^The code should be good here, but someone else with a seasonbot environment should do a test run of it

cold moon
#

I will test it.

#

@nocturne hare When I look this this PR code, I find that this doesn't persist anything. All data will be overwritten after redeploy, but SeasonalBot already allows persisting JSON. What do you think, should this persist data? Also one thing I found that this run this task once per 24 hours, but when bot is redeployed multiple times per day, this may send multiple announcements.

cold island
#

Hey @neon garnet, gave your PR a review. Looks mostly good, but I found some bugs.

nocturne hare
#

@nocturne hare When I look this this PR code, I find that this doesn't persist anything. All data will be overwritten after redeploy, but SeasonalBot already allows persisting JSON. What do you think, should this persist data? Also one thing I found that this run this task once per 24 hours, but when bot is redeployed multiple times per day, this may send multiple announcements.
@cold moon @surreal venture They raise valid points. Might be worth storing when the task was last run for when it should requeue the job on startup, and storing names from previous sessions.

neon garnet
#

@cold island Thanks, will address those once I have some free time

cold moon
#

@nocturne hare @surreal venture I think better way should be running task in specific time every day, like Reddit in @stable mountain does.

cold moon
#

I hope I can finish Dewikification resources app in this weekend

hardy gorge
#

Sounds good. Thanks for the update. I'll tag appy so he sees this: @wild ridge

wild ridge
#

๐ŸŽ‰

#

@cold moon I should be free this weekend, can give it another look through whenever you'd like

cold moon
#

I will soon finish migrating all resources YAMLs. I had to make some restructurings.

#

I also had to do things again and again differently because when I migrate some resources group, then current way just doesn't fit.

patent pivot
#

This channel is for discussing the servers open source projects, not really for recruitment, if you have an open source project feel free to discuss it in python general or our off topic channels, but remember recruitment is not allowed

chilly wind
#

Oh, I'm so sorry

patent pivot
#

all good!

chilly wind
#

Alr thx

#

Is recruitment not allowed as a whole

#

If you don't respond I'll assume it isn't to be safe

patent pivot
#

generally not

cold island
#

If you don't respond I'll assume it is to be safe
@chilly wind that's not how it works

chilly wind
#

WOAH I MEAN NOT

#

I MEANT NOT

#

THAT IS NOT WHAT I MEANT TO TYPE

#
userRamen = "STUPID"
if userRamen == "STUPID"
  apologize()
cold island
#

all good ๐Ÿ™‚

chilly wind
#

At some point I practiced typing so much, I ended up with muscle memory of certain words, and I think that's what happened

#

Like when I was paying attention to it, I realized how much longer it took me to type something like muscle compared to something like that's

#

Anyways apologies and I'm going to go code python more

#

I was going to recruit because I have a WHOLE lot of boring work to do

#

I'm converting a dead project from bash into python

#

TL;DR cya

cold island
#

good luck ๐Ÿ‘

patent pivot
#

might go live in dev-voice

#

doing some insights stuff

thorny obsidian
#

what kind of insights stuff?

patent pivot
#

hmmmm, well I want to handle form submission

#

so probably form submission

thorny obsidian
#

that makes sense

patent pivot
#

right now I think it'll just be the anti-spam stuff

#

and then storing a json object

#

schema validation can come slightly later

brazen charm
#

Is there a way to safely delete a bunch of redis keys? I was thinking of allowing manual deletion for the doc objects from 1014 in case of a lib update to force their refresh, but it doesn't look like there is a way to do it without iterating over them which could be interrupted by a redeploy

trim cradle
#

Tonight I was planning on trying to implement something Zig proposed in the staff repo

#

but now that I'm sitting here, I realize

#

that would be work.

cold island
#

Lol

tawdry vapor
#

@brazen charm You could do it with one redis command, but I don't know if a redeploy would cancel an ongoing operation in redis

#

It's HDEL

#

If you store all the fields you want to delete under the same key, then using DEL will clear all the fields

#

And you wouldn't even have to specify which fields to delete

brazen charm
#

Yeah, they are all separate keys and I couldn't find anything that'd just do it in one step (without a lua script) instead of scanning through all of them

eternal owl
#
cold moon
#

@eternal owl Reviewed both PRs.

cold moon
eternal owl
#

you don't sound well @patent pivot, are you sick?

patent pivot
#

hahaha yes, I just got up so I have a low voice

eternal owl
#

ahh okay

patent pivot
obsidian patio
#

What are you discussing in voice?

patent pivot
#

devops

green oriole
#

What are you discussing in voice?
@obsidian patio k8s migration

obsidian patio
#

Ah, okay. About dewikification?

glass pecan
#

no

#

hosting changes

obsidian patio
#

Okayy

glass pecan
#

we're moving away from saltstack as our orchistration toolkit

#

and moving to kubernetes

obsidian patio
#

Ohh righty

glass pecan
#

it'll manage and deploy all our services for us

green oriole
#

@patent pivot don't we have an env var for ALLOWED_HOSTS?

#

Nice, my internet dropped

glass pecan
#
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-redirectregex
spec:
  redirectRegex:
    regex: ^https://github.com/pythondiscord/(.*)
    replacement: https://github.pythondiscord.com/${1}
#

as example roughly

cold moon
#

I try to understand something about it, but Kubernetes looks so complex to me.

vocal wolf
cold moon
#

Thanks

vocal wolf
#

np

green oriole
#

Very cool

vocal wolf
#

It's very interesting how all these things in devops just work together (I can't remember the word)

#

things = microservices, I think?

green oriole
#

If we use helmfiles, we are mostly relying on community content, right?

#

individual repos can be scary though

#

Contribs aren't gated by the maintainers

patent pivot
cold moon
#

Oh, now I understand

green oriole
#

Yeah, I guess we will use popular enough charts

#

Fair

patent pivot
#

smh scragly not sharing to dev contrib or dev ops

green oriole
#

lol

crude gyro
#

more like sms. shaking my scragly.

patent pivot
green oriole
#

I'll have to go, cya guys o/

#

k8s looks really good

late wolf
#

I want to join, but sadly i can't

clever wraith
#

Is there any places that I can deploy my api free

obsidian patio
#

!ot @clever wraith This channel if for discussing the development of PyDis repos. Feel free to ask in off-topic if you need somewhere to deploy your api

stable mountainBOT
clever wraith
#

Which one

cold moon
#

@clever wraith Choose one of them where is not active talk about something currently.

cold moon
#

About what devs are currently talking in dev voice?

patent pivot
#

devops

#

you can join

cold moon
#

One moment, I'll bring my AirPods and I'll join

brazen charm
#

Redis ops should be fairly cheap, right?

tawdry vapor
#

@brazen charm do they have to be separate keys? Do they each have their own fields?

#

Needs a review

brazen charm
#

They're separate keys so expires can be set on them

tawdry vapor
#

So that's not possible with fields?

brazen charm
#

No, those can only store values without being full redis objects

#

could technically move them to a hset with handling the expires in python now that idletime is not checked if a single redis op would be ensured to run completely

tawdry vapor
#

Currently we aren't sure if that an ongoing operation will complete

#

We're also moving stuff to kubernetes so the behaviour may change ๐Ÿคท

brazen charm
rapid swallow
#

May I ask why the migration to kubernetes was done and what was previously used? lemon_pika

#

what was previously used
"where was it migrated from"

obsidian patio
#

We previously used (currently use?) SaltStack. From what Iโ€™ve heard, thatโ€™s just a nightmare in a lot of ways, so weโ€™re trying to move away from it

rapid swallow
#

Oh, alright. Thank you for the response. Now I guess I have to look up what SaltStack is.

obsidian patio
#

Hahah yeah. Iโ€™m not that involved in the CI/CD here, so there may be someone else who could give you a better answer

cold moon
#

Can I submit PR that changes @stable mountain docker-compose.yml site image to GHCR or this is already planned?

cold moon
#

This doesn't redirect to HTTPS

#

When I try to access to this with HTTPS then I can see it

short snow
#

works for me

cold moon
#

Huh, looks like some weird Safari thing

short snow
#

it redirects me to https on chrome

cold moon
#

I know, in Firefox this is working too, but not in Safari

late wolf
#

oh u are right

cold moon
#

One thing that is currently broken on site: OAuth. I know that this will be removed, but should be fixed until that. In Discord login I get Invalid OAuth2 redirect_uri.

sharp timber
#

I... can reproduce

#

And I can reproduce in firefox if I strip the https to http manually

#

it seems the https redirect isn't working, but a lot of browsers start with https

crude gyro
#

thanks for the reports. I'll add it to the migration kanban

#

we'll look into it

sharp timber
#

๐Ÿ‘

crude gyro
#

it seems the https redirect isn't working, but a lot of browsers start with https
@sharp timber

fixed.

sharp timber
#

๐Ÿ‘ is working

patent pivot
#

Can I submit PR that changes @stable mountain docker-compose.yml site image to GHCR or this is already planned?
@cold moon comment on the open PR I think

cold moon
#

@patent pivot Python bot doesn't have PR yet

patent pivot
#

yes there is @cold moon

cold moon
#

Oh

#

Looks like my browser used cache from previous session

#

Change is already made there

cold moon
#

@wild ridge Will you have time today to review dewikification PRs?

wild ridge
#

Can do @cold moon

cold moon
#

Thanks

brazen charm
cold moon
#

Why @stable mountain docker-compose have such low Redis version? Can I use higher for @dusky shore ?

hardy gorge
#

I'd use the same version as we're using in production to avoid problems

#

There's no reason to test things locally with a different version of Redis that's not actually being used

cold moon
#

No plan to push production from 5 to 6?

hardy gorge
#

I'm checking what we're currently using

#

redis:latest as a container

cold moon
#

@stable mountain use redis:5.0.9

#

Latest is 6.0.9

hardy gorge
#

That's just docker-compose

#

that's not used in production

#

Our production deploys with redis:latest

#

I think that we should indeed have that same version in the compose then

#

Unless @patent pivot knows of reasons why we shouldn't

crude gyro
#

yeah just update the compose with :latest

#

it's fine

cold moon
#

Okay, I will use latest then for @dusky shore

hardy gorge
#

I have to say, the kubernetes thing makes checking this easy

crude gyro
#

yeees

hardy gorge
#

Everything is in one place

crude gyro
#

kubernetes is so smooth

#

I want to take it out for a drink

#

buy it dinner

#

make it my wife

cold moon
#

Where you check this stuff? Some dashboard?

crude gyro
#

probably just in the manifest files in our k8 repo

cold moon
#

Oh

crude gyro
#

(which is private right now)

cold moon
#

Some Kubernetes users use some sort of dashboard

hardy gorge
#

Yes, although we're going to control access based on a need-to-know basis

#

joe was looking into access control groups and such

crude gyro
#

well, maybe. I'm not 100% sure the kubernetes repo can't be public.

hardy gorge
#

yeah, that's true, I was talking about the dashboard thing joe discussed

crude gyro
#

right right

#

well that's a traefik dashboard, I think?

hardy gorge
#

I think so

#

But, anyway, we're indeed running 6.0.9 in the cluster

#

1:C 15 Nov 2020 14:19:45.099 # Redis version=6.0.9, bits=64,

#

kubectl is neat

cold moon
#

What I should use for Redis host?

#

For local development, it's easy: redis, but what for production?

hardy gorge
#

These are the configurations we use for bot:

    redis:
        host:  "redis"
        port:  6379
        password: !ENV "REDIS_PASSWORD"
        use_fakeredis: false
cold moon
#

But redis is container name

#

Kubernetes have same?

hardy gorge
#

right

#

we haven't actually migrated bot yet

#

you're right

crude gyro
#

I'll find the host, sec

#

redis.default.svc.cluster.local

cold moon
#

Okay, thanks

hardy gorge
#

How did you find that?

hardy gorge
#

ah, it's also in the readme

crude gyro
#

but default.svc.cluster.local is basically always gonna be in every host inside our cluster

#

and the first bit is the hostname we've set in the manifest

hardy gorge
#

I'm looking for the kubectl way of getting the info

#

I'm not that familiar yet with navigating the vast ocean of information you can fetch

crude gyro
#

well you could do kubectl describe service/redis

#

and it'll give you the name and the namespace

#

not the whole host, though

hardy gorge
#

yeah, I got that far

crude gyro
#

but it's gonna be <name>.<namespace>.svc.cluster.local

hardy gorge
#

cool

#

That's good to know

crude gyro
#

as long as it's local, I mean

#

like internal

hardy gorge
#

yeah

crude gyro
#

if it was exposed to the world it would have a domain in the end or something like that I think

#

I'm not sure how that would look

#

but that's not really a thing for us

#

because we're not using services like that

#

actually disregard all of that, I don't know what I'm talking about

#

but at least the local bit, it's possible that this can be something else in other contexts

#

just not inside the context of how we're using services.

patent pivot
#

I have a bot PR open

#

the dashboard isn't the traefik one, there is a Kubernetes one, but I need to see how that will play into Teleport

green oriole
#

"I approve!"
"but I haven't start-"
"I approve!"

patent pivot
#

blocked by snekbox right now

hardy gorge
#

yeah, I'm working on that too

#

it'll take a bit

patent pivot
#

๐Ÿ‘

hardy gorge
#

Maybe I can strip down on the custom build options that are there to speed up the build for now

#

And just get it running

#

We can tinker with manually caching containers/layers later, if we want

patent pivot
#

that sounds reasonable

#

once we have auto-deploy and everything setup we are free to tinker

hardy gorge
#

Maybe teh --cache-from will work as well in the future

green oriole
#

Most of our dockerfiles can be optimized to be honest

hardy gorge
#

Because that should do (about) the same

patent pivot
#

to be honest going by the auto-deploy on site right now things do seem faster

#

but maybe it's a fallacy because I proposed k8s and hate salt lol

hardy gorge
#

haha

#

We have runtimes we can compare

#

There are still some azure runs up

#

but you need to be quick; they're auto-deleted in x days

#

because we don't pay monies

patent pivot
#

4m 41s on site for last azure build to add notion to sponsors

#

2m 55s on github actions

hardy gorge
#

can't complain about that

#

a linting + pre-commit run without dependency changes is also lightning fast

#

caching works very well

green oriole
#

Actions is reaaaally fast

cold moon
#
docker.errors.APIError: 500 Server Error: Internal Server Error ("b'Mounts denied: \nThe path /opt/pythondiscord/seasonalbot/log is not shared from the host and is not known to Docker.\nYou can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.\nSee https://docs.docker.com/docker-for-mac for more info.'")

get this when trying to run SeasonalBot in Docker.

patent pivot
#

hmmmmmmm

#

from ghcr?

cold moon
#

Looks like that Docker don't like /opt/

green oriole
#

Seems like youโ€™re using docker-compose to use the bot, but we donโ€™t really seem to use this method

cold moon
#

I think after adding Redis, docker-compose may be easier way

green oriole
#

Yeah

cold moon
#

Added /opt to file sharing

green oriole
#

What are you working on?

cold moon
#

Docker is now restarting

#

@dusky shore Redis persist

green oriole
#

Alright, how are you running redis for now?

cold moon
#

I added it to docker-compose.yml

green oriole
#

Alright

brazen charm
#

What does it need redis for?

green oriole
#

It seems like this compose setup needs to be redone

#

What does it need redis for?
@brazen charm persistence

cold moon
#

JSON doesn't work with Kubernetes anymore

green oriole
#

We are stripping out the json files because of the migration to k8s

patent pivot
#

it works

#

but like

brazen charm
#

Wouldn't a normal db be more suited for proper persistence?

patent pivot
#

if we want to provision storage we have to provision a minimum 10 GB volume

#

Redis is setup in a safely persistent manner

green oriole
#

I donโ€™t think we need a fully featured db for seasonal

patent pivot
#

Well, we could use PostgreSQL, but that's much more work

#

we use both RDB and AOF persistence

#
root@redis-b9c7d96f8-qqrj6:/data# du -ah
4.5M    ./appendonly.aof
16K    ./lost+found
4.5M    ./dump.rdb
8.9M    .
brazen charm
#

It works, but it's not really what it's intended for, is it? I'm not familiar with the devops but why aren't the json files feasible anymore?

patent pivot
#

well, we don't want to provision a 10GB volume for 3 or 4 JSON files

brazen charm
#

And redis avoids that with sharing the service with the bot?

mellow hare
#

What if the JSON files were that large

patent pivot
#

Yeah, with Redis we can provision one volume that bot, seasonalbot and hastebin can all use

#

What if the JSON files were that large
we shouldn't be using JSON anymore then ๐Ÿ‘ฝ

mellow hare
#

Well sure, but what IF

patent pivot
#

I doubt they could

#

I don't have the figures of how large they were on salt

green oriole
#

We would run into OOMs lol

patent pivot
#

wait yeah I do

green oriole
#

I wonder how many users thatโ€™d be to fill 10Gb in github handles haha

patent pivot
#

lol

#

well, that 20K is uhhh

#

186 users

green oriole
#

Only 9,300,000 users

tough imp
#

Afaik the Hacktoberstats cog persists somewhat tabular data

#

but I guess it can still be done with Redis ๐Ÿคท

patent pivot
#

hmmmm

#

I think branding is a boolean for whether the daemon is enabled. Candy collection I thought was now a uid => candies mapping an github links can be uid => github name

tough imp
#

yea it's probably fine

#

I was initially planning to persist more than just the bool for Branding, but eventually decided not to because of no good persistence options

#

but I don't remember what it was

crude gyro
#

I never really liked JSON file persistance anyway

#

redis seems far cleaner

#

especially now that we have the async-rediscache package

tough imp
#

yes, but I think only having the ability to map to simple values can promote bad designs where you rely on multiple caches to represent the same "object"

#

and they can go out of sync if it's not done properly

#

so it may not be the most beginner-friendly setup

#

you can always serialize more complex types, but you have to (de)serialize them yourself

crude gyro
#

I just don't see us running into that problem a lot

tough imp
#

yea it's fine, just trying to think ahead

crude gyro
#

I appreciate that

tough imp
#

it's definitely cool that seasonalbot gets redis

crude gyro
#

if there really was a need, I guess we could grant seasonalbot access to postgres or even mongodb

#

but I'd really rather not

brazen charm
#

So, why not postgres? The setup complexity through docker should be pretty much the same

green oriole
#

I wouldnโ€™t think that this is a good idea (to add a db), since seasonal is supposly our entry level project

#

We already try to not except contribs to know docker

brazen charm
#

Not going to be much different with redis

crude gyro
#

sure it is

green oriole
#

Knowing how to setup a database locally and use it seems harder

crude gyro
#

async-rediscache supports fakeredis so you don't actually have to set up redis

#

it just won't persist the data while using fakeredis

#

but it'll work

#

@hardy gorge you wrote the fakeredis implementation into async-rediscache, how easy is that to set up so that our contribs can have it using fakeredis locally but we can use real redis in production?

hardy gorge
#

trivial

#

It's a kwarg you pass to session

#

Just make sure to include the fakeredis install option

crude gyro
#

so, we'd hook that up to an environment variable or something

hardy gorge
#

Yeah

crude gyro
#

cool

#

@cold moon please take note

green oriole
#

We can even use fakeredis if no env var for the redis address is provided

hardy gorge
#

Look at bot

#

It does the same, but with the config file

crude gyro
#

yeah

#

that's what we want for seasonalbot too, fakeredis for local dev and real redis only in production

#

that way there's no added complexity at all

hardy gorge
#

@green oriole Yeah, we can. The only downside for bot was the hierarchical nature of the configs, meaning that there was always a host available

#

In seasonalbot, we can solve it that way

#

WEll

#

maybe

#

It may hide configuration mistakes in production

#

Let's not do that

cold moon
#

This already allow fakeredis

#

Using environment variable

hardy gorge
#

Let's make the option explicit

#

i.e., we don't want production to fall back to fakeredis if we somehow mess up configurations and don't set a host

crude gyro
#

yeah exactly

#

it should fail if that happens

green oriole
#

We couuuuld print a warning if we fallback to fakeredis, this will create a sentry issue if something is misconfigured

crude gyro
#

no, we should just fail

hardy gorge
#

Yeah

crude gyro
#

hard

cold moon
#

use_fakeredis = environ.get("USE_FAKEREDIS", "false").lower() == "true"

crude gyro
#

if (no host configured AND not USE_FAKEREDIS), just crash the bot.

#

it's the safest way

cold moon
#

Where this check should be done?

#

And what way this should crash?

rapid swallow
#

sys.nope()

crude gyro
#

basically that

#

check it at bot startup and crash hard. sys exit or something

#

with a clear reason

#

log critical errors

#

basically agooglebomb

cold moon
#

So in __main__.py?

crude gyro
#

I'll leave the implementation details to you, you can figure it out

#

just don't let it run in that state

hardy gorge
#

It'll probably come crashing down during start-up if the redis session can't connect, but we should not rely on that I think

#

I'm never exactly sure when discord.py starts hiding errors (this is during the bot's start up)

green oriole
#

@cold moon donโ€™t forget to mention on your PR that you added a config entry, so the merger will add it to the contrib guide

cold moon
#

Quick question: What I need to do in docker-compose.yml to automatically sync files?

#

I don't want rebuild every time

green oriole
#

Add a .:/app mount, I think

#

Lemme check the path

#

Nope, it is .:/bot

cold moon
#

And to where?

green oriole
#

Thatโ€™s it

cold moon
#

Oh

green oriole
#

the . means current folder

cold moon
#

Okay, thanks

#

I will make changes in docker compose too to make development easier

#

One thing is like relaying environment variables from .env

crude gyro
#

yeah that's nice

brazen charm
#

Ah, redis can be made optional easily, guess it's worth the tradeoff then. Just make sure to clearly note it in the contrib guide as there have been a few people here asking for help with redis setup for the bot while they didn't need it at all for the features they were developing

cold moon
#

Question about AsyncCache increment: Does this create key when key don't exist?

brazen charm
#

No

cold moon
#

Okay

crude gyro
#

hmm, quick thought <@&587606783669829632>

Why should the branding manager even be in seasonalbot? maybe we take this opportunity to move it into Python?

#

it's core community functionality, not some fun entry level toy

#

it doesn't really fit seasonalbot anymore.

#

and then we wouldn't need to introduce rediscache in seasonalbot yet.

glass pecan
#

branding manager?

obsidian patio
#

The โ€œswitch logo every 3 daysโ€ thing, I assume

cold moon
#

But I'm already doing this. Basic setup is ready, now migrating extensions...

glass pecan
#

ah right. yeah it's not a "fun" thing anymore, and seasonalbot isn't primary for events management anymore

#

i don't think we're in a rush to move it though

#

we could probably better plan things later in the future

obsidian patio
#

I may not be a core developer, but I think that sounds smart. In some sense, it would be nice to leave the more permission heavy things like that in @stable mountain. SeasonalBot is more of a fun learning bot nowadays, so it doesnโ€™t really make sense to keep it there. I also agree that the functionality of changing the icon every 3 days isnโ€™t some quick and fun thing anymore, but actually a more central part of the server setup. Those things should be handlers in @stable mountain

crude gyro
#

we could probably better plan things later in the future
@glass pecan

@ks123 is rewriting the branding manager right now. perfect time to move it.

hardy gorge
#

I say move it

patent pivot
#

How will we (will we?) change SeasonalBot icon?

obsidian patio
#

Default? For now

cold moon
#

Why hackstats is storing date_added for linked names?

hardy gorge
#

I say don't change it for now

#

We're planning to rename seasonalbot anyway

#

Have the branding manager do community branding

rapid swallow
#

How will we (will we?) change SeasonalBot icon?
Think y'all can make @stable mountain talk to @dusky shore ?
Maybe add a change_pfp command to seasonal bot and make @stable mountain invoke it (janky, I know)

#

there must be some way for @stable mountain to talk to @dusky shore

crude gyro
#

no thanks.

rapid swallow
#

lol ok

cold moon
#

Looks like hackstats command doesn't even use date_added for links. I will remove it, as this will make storing it in Redis easier.

crude gyro
#

let's not add even tighter coupling between our services.

#

the seasonalbot avatar does not need changing.

#

not its nickname either

rapid swallow
#

oh, btw
@dusky shore still has the Diwali icon

hardy gorge
#

We'll rename seasonalbot soon anyway

#

More definitively

crude gyro
#

yes.

#

@cold moon do you mind moving the code over to Python and stripping it from SB then?

green oriole
#

If we are going to use a static pfp for seasonal, yeah, letโ€™s move it

crude gyro
#

shouldn't affect the code you already wrote much.

cold moon
#

Okay, I need to find all places then where things take place, as they are not all together.

crude gyro
#

very good.

hardy gorge
#

.uptime

dusky shoreBOT
#

I started up a day ago.

hardy gorge
#

Just wanted to get a feel for it

cold moon
#

Let name it FunBot

green oriole
#

We are going to use snake name iirc

cold moon
#

Oh

#

Python

#

lol

obsidian patio
#

Why did SeasonalBotjust get the name @dusky shore?

glass pecan
#

bots get snake names

#

it's something that was discussed a fair while back, seems ves has finally actioned seasonalbots at least

obsidian patio
#

Discussed where?

green oriole
obsidian patio
#

Hmm, ok

tough imp
#

Branding has ties to the seasonal system that Seasonalbot has, although its less prevalent now

#

It used to make more sense

#

Should be detachable now

#

You may want to check out the month override env var, it may or may not need to be duplicated

#

Im not sure if Branding uses it or not

crude gyro
#

yeah it made sense once.

#

just not today.

cold moon
#

Can I currently leave MonsterSurvey not migrated, as this have static data and votes in same file?

#

This need major refactor

tawdry vapor
crude gyro
#

!remind 1H review that

stable mountainBOT
#
Of course!

Your reminder will arrive in 1 hour!

crude gyro
#

i got you

cold moon
tawdry vapor
#

I don't think that will be adequate

#

It lumps all subdomains into one attribute

#

I think you need to split by a . and compare the tuples from right to left

#

For example, if a filter is on foo.bar.com then www.foo.bar.com needs to be matched

#

multi-level subdomains seem rare but I believe they do exist

glass pecan
#

they defs exist ๐Ÿ™‚

stable mountainBOT
#

@crude gyro

It has arrived!

Here's your reminder: review that.
[Jump back to when you created the reminder](#dev-contrib message)

crude gyro
#

and you can merge it

brazen charm
#

Any opinions on the name @crude gyro ? It was the main reason I avoided giving it a more thorough look and approving, and the other reviewers seem to prefer bot_instance

crude gyro
#

I don't have a strong opinion.

#

doesn't really matter to me what it's called

#

getting the PR merged seems more important than bikeshedding a variable name

green oriole
#

As long as the instance isn't stored as bot.bot.bot haha

tawdry vapor
#

Why isn't CI running

#

Never mind, it did

#

But there's one expected check that didn't run

#

Is it the old Azure check?

cold moon
#

Adding branding manager to @stable mountain is almost ready, only few small things left. Tomorrow I'm gonna remove all branding stuff from @dusky shore

green oriole
#

Nice!

crude gyro
#

nice work, @cold moon

#

I really appreciate all the work you've been putting into our services recently

#

it's been noticed.

cold moon
#

Thanks

crude gyro
#

you're making a very positive impact on Python Discord.

#

and I genuinely appreciate that.

cold moon
#

๐Ÿฅฐ

short snow
#

(haven't added a thumbnail)

surreal venture
#

looks cool!

surreal venture
#

Can I use pickle to serialize and deserialize data (for the seasonalbot)? I need to store the Member object to make the data persist. ks123 suggested only storing the ID, but then I will need to change wherever I reference the member to bot.fetch_member the Member object every time.

tough imp
#

what kind of information about the user do you want to persist?

#

pickling the object sounds like a bad idea

#

if you're working with a Member instance, you want to be using the one from the bot's cache

#

that way it's an accurate representation of the Member at the current time

surreal venture
#

and how can I access the cache? (and I just need to store the Member instance to ping the person later-on)

tough imp
#

you can construct the ping from the ID

surreal venture
#

from the user's id?

tough imp
#

@tough imp -> @tough imp

#

that's my user ID yeah

surreal venture
#

ah okay thanks for your help!

tough imp
#

no worry

obsidian patio
#

Iโ€™m looking to access an emoji by a URL to the GitHub repo. Where should I store this? I assume it should be in a variable/config file

tough imp
#

I think both Python and Seasonal have an Emoji config class

#

though if it's a URL then maybe that wouldn't be the best place to put it

obsidian patio
#

Hmm, yeah

tough imp
#

Python also has Icons, that sounds like a better place for it

#

it's currently full of CDN URLs

obsidian patio
#

Are they referenced by URLs their?

tough imp
#

yes

obsidian patio
#

Ah, perfect

tough imp
#

like this

#

sounds like what you're looking for

obsidian patio
#

Lovely. Thatโ€™s exactly what Iโ€™m looking for

tough imp
obsidian patio
#

Iโ€™ll be using the GitHub link if thatโ€™s fine?

tough imp
#

I don't see why not, although you could just upload it to Discord and use the CDN link

obsidian patio
#

Yeah. The issue with Discord is that they may change to require discord.com in the future, they compress it and itโ€™ll be hard to modify

tough imp
#

hmm yea

#

I'm fine with GH ๐Ÿคท

obsidian patio
#

Perfect. Thanks

cold moon
#

Okay, branding moving and Redis for @dusky shore is ready.

#

I will open PRs soon

sullen phoenix
#

we might be thinking of just moving it to @stable mountain, but i'm not 100% sure on that

#

i think you said something about this @crude gyro

hardy gorge
#

I think that is what they mean with "branding moving"

short snow
obsidian patio
#

Whatโ€™s up with the navigation?

surreal venture
#

I think it is for the data

obsidian patio
#

Yes, I assumed that. I meant why there was a thing in the middle

surreal venture
#

the stop symbol? โน๏ธ ๐Ÿคทโ€โ™‚๏ธ

obsidian patio
#

@short snow

short snow
#

ah yes, i had made my own paginator, i am almost done shifting to the utils one

obsidian patio
#

Oh? You made a pagination for it?

#

Also, do we have an issue on the repo about this?

short snow
#

yes lemon_sweat , i was doing it separately first, but then it came out well, so thught putting it here too

#

idts

#

not for stack

obsidian patio
#

Ok. Wanna link it?

short snow
#

there are no issues for them

obsidian patio
#

Oh? I thought you meant that there were for the first one

#

I think something similar to the first one could be cool. However, Iโ€™d appreciate seeing an issue on it first. That way, we wonโ€™t be multiple people working on the same thing that accident and we can discuss if itโ€™s really something we want to do

short snow
#

ok! will open a issue tomorrow, need to go! thanks

cold moon
#
obsidian patio
#

This should be ready to merge after one more review. It's a quite short but significant PR, so I'd love to get it merged soon (we already have one approval)

dusky shoreBOT
eternal owl
#

How do you guys use docker on windows? Using wsl or install docker desktop with hyper v enabled ?

hardy gorge
#

Using the WSL back-end

eternal owl
#

alright

cold island
#

I already had docker desktop set up so I just continue using it

hardy gorge
#

I rarely use Windows for doing pydis stuff, but when I did that recently, the WSL installation was a breeze. I probably wouldn't have switched if I were to have had a working setup, but installing and running docker with a WSL back-end is now so trivial, it's amazing.

cold island
#

yeah, that's what I hear, so if you don't have something set up it's probably better to go with that nowadays

short snow
#

#bot-commands message why is this happening?

green oriole
#

OOM somehow

short snow
#

#bot-commands message hmmmm, new

eternal owl
#

I got a new pc (windows), my usb wifi adaptor does not support linux so I gotta stick in windows.
I could use a VM but I think WSL will be better and easier for docker.

cold island
#

Just don't use pipenv run lint, it's broken on Windows because of line endings. Let the precommit run during the commit itself.

eternal owl
#

okay

#

do you guys use wsl.exe as terminal or cmd? basically, where do you keep your virtualenvs, in the wsl or windows itself?

brazen charm
#

It should work fine after changing the line endings in your git config

cold moon
#

.issue 521

dusky shoreBOT
#

[404] #1289 Issue/pull request not located! Please enter a valid number!

cold moon
#

.issue 1289 bot

dusky shoreBOT
cold moon
#

Can we get these merged pretty fast to make branding daemon working again?

hardy gorge
#

We're currently pretty busy with the migration, which needs to move forward quickly

cold moon
#

Okay

surreal venture
#

Where are @dusky shore and @stable mountain hosted?

rapid swallow
#

Linode

surreal venture
#

ah okay thanks ๐Ÿ™‚

rapid swallow
#

the website too

#

Pydis' hosting is sponsored by them

hardy gorge
#

That's right

violet ember
#

Hey so when I was getting my env ready for Seasonal Bot I was getting the pipenv ready but I don't know what file to point it to

hardy gorge
#

What do you mean by "what file to point it to"? If you follow the setup guide we've got for the bot, it should all work out

#

In general, you need open something like a cmd/terminal window, navigate to the folder that contains the cloned repository, and then run pipenv sync --dev. That will automatically detect the Pipfile.lock that's there and install the correct dependencies.

violet ember
#

Ohh it's the Pipfile.lock okay thx

hardy gorge
#

It's not a file you should run yourself. Rather, you run pipenv and it will pick up on the file being there.

#

Are you following our guide?

violet ember
#

Yes

#

I have a window open and it's asking for a pipenv excutable

#

I have no idea where that exe is though

hardy gorge
#

Did you install pipenv?

violet ember
#

What do you mean?

hardy gorge
#

pipenv is a Python package that you need to install

violet ember
#

Ahh should I put Python\Python38\Scripts on path or leave it how it was installed?

green oriole
#

Yeah, it is a good idea

violet ember
#

Okay I got everything working and I was wondering if there was a way to run from PyCharm as pipenv isn't registering

ember cloud
#

sorry if this a dumb question but can someone send the file on github where the @stable mountain detects token leaks

thorny obsidian
ember cloud
#

lol thanks

thorny obsidian
#

I'm on windows and currently failing the precommit hook due to mixed-line-endings Flake8? It's just telling me it's failing on the Flake8 hook and not much else.

brazen charm
#

try setting core.eol to lf and core.autocrlf to input in your git config

thorny obsidian
#

It's fixing the mixed line endings but just failing flake8 because it's not a recognized command. Which I don't know how to fix in a pipenv environment

brazen charm
#

Are you using pycharm @thorny obsidian ?

thorny obsidian
#

No, VSCode

#

I can switch to PyCharm, I'd just prefer not to

brazen charm
#

Ah, not sure then, pycharm has a problem where you have to manually edit the precommit to activate the venv but don't know anything about vscode

sullen phoenix
#

that may be the issue here as well

#

if flake8 isn't a "recognized command"

thorny obsidian
#

What type of edit is required for the precommit in that case?

brazen charm
#

I replaced the block of the code that ran the commands for pre-commit with raise SystemExit(subprocess.run([INSTALL_PYTHON.replace('python.exe', 'activate.bat'), '&&', *CMD]).returncode)

#

(Or something along those lines)

#

sorry, managed to delete a prenthesis when copying it over from the file I was trying it out in; should be fine now

thorny obsidian
#

So looking at the lint-build-deploy.yaml, the flake8 is run separately from the other pre-commit hooks. So that was replace in... the flake8 hook or the other precommit hook? Or somewhere else entirely and I'm looking at the wrong file?

brazen charm
#

In the pre-commit file under .git/hooks, there's an if block at the bottom that's checking platforms and running system commands

#

Don't know if it'll help you but of it's wrong reinstalling the pre commit will get the original back up

thorny obsidian
#

@brazen charm YOU ARE MAGIC THANK YOU

short snow
#

pre-commit run --all-files how do i run this for a specific file?

surreal venture
#

pre-commit run file_name.py?

short snow
#
(seasonalbot) jason@devlab:~/PycharmProjects/seasonalbot$ pre-commit run extra_wikipedia.py
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/jason/.cache/pre-commit/patch1605770446.
No hook with id `extra_wikipedia.py` in stage `commit`
[INFO] Restored changes from /home/jason/.cache/pre-commit/patch1605770446.
rapid swallow
#

I guess you haven't staged the file

hardy gorge
#

It's saying that it doesn't recognize that name as a pre-commit

#

If you want to specify individual files, you have to use the --files option

#

This will try to find a pre-commit "hook" (checker) called extra_wikipedia.py, which we don't have

#

pre-commit run --files extra_wikipedia.py should work, @short snow

short snow
#

thanks!

cold moon
#

What Kubernetes stuff PyDis uses? I mean like deployment tools etc.

sullen phoenix
#

k8s does deployments

cold moon
#

Oh, true. I looked wrong section in K8S docs, that covered special setups for some providers, what need deployment tools.

patent pivot
#

yeah we just use the native kubernetes tooling

#

kubectl is good

cold moon
#

Why staff will have their own AoC leaderboard?

patent pivot
#

Just the way we've decided to run the event this year. We may offer a small prize of some sort to the staff leaderboard. We can't really do the same for the public board since we've experienced issues of cheating in the past.

cold moon
#

Oh, so other users will get nothing from public leaderboard?

patent pivot
#

We'll see, I guess we could look into doing a cosmetic prize of some sort

#

I'm not the events lead though, so it's up to kutie for how we run things :)

cold moon
#

Okay, I remember how I tried to get this IDE license last year... lemon_thinking old good times... lol

thorny obsidian
#

I was debating whether there should be a small or cosmetic prize for the PyDis leaderboard. Right now I'm hesitant due to the prior cheating issues, but I'm willing to re-evaluate depending on how the event goes.

#

But the staff board was something that was requested, so I'm happy to comply and set it up

mellow hare
#

@valid quest Just wanting to check in with you on this PR: https://github.com/python-discord/bot/pull/760 Are you able to work on this? If not I completely understand. We can always have someone pick up the torch if real life has you caught for a loop. (This isn't me trying to be pushy, just checking on you)

trim cradle
#

Does RedisCache not support __class_getitem__?

sullen phoenix
#

do you mean __getitem__?

#

it's not possible because that method cannot be asynchronous

#

similarly with __setitem__

trim cradle
#

like, type aliases

#
# why is it like this?
# RedisCache[discord.TextChannel.id, UtcPosixTimestamp]
claim_times = RedisCache()

# and not this?
claim_times: RedisCache[discord.TextChannel.id, UtcPosixTimestamp] = RedisCache()
sullen phoenix
#

ohhh, that makes more sense

#

not sure

#

@hardy gorge would be the one to ask

#

also, is __class_getitem__ a dunder that exists?

#

wouldn't it be __getitem__ on a metaclass

trim cradle
#

I thought that was the name of it

#

!pep 560

stable mountainBOT
#
**PEP 560 - Core support for typing module and generic types**
Status

Accepted

Python-Version

3.7

Created

03-Sep-2017

Type

Standards Track

sullen phoenix
#

oh nice, TIL

#

both methods work, but that's easier

trim cradle
#

"But the language reference explicitly reserves all undocumented dunder names, and allows "breakage without warning""

#

interesting tidbit from that pep

sullen phoenix
#
>>> class FooMeta(type):
...     def __getitem__(cls, key):
...             print(key)
... 
>>> class Foo(metaclass=FooMeta): pass
... 
>>> class Foo2:
...     def __class_getitem__(cls, key):
...             print(key)
... 
>>> Foo[str, list]
(<class 'str'>, <class 'list'>)
>>> Foo2[str, list]
(<class 'str'>, <class 'list'>)
trim cradle
#

dev-esoteric-python-contrib

sullen phoenix
#

hahahah

trim cradle
#

anyway my goal is to solve the !close bug that we uncovered a few weeks ago, and it looks like I just need to understand the rediscache api and then it should be a trivial fix

#

for some reason pycharm thinks rediscache isn't installed

trim cradle
#

@sullen phoenix I forgot what change I had to make to what file for warnings and such to work in a test environment

#

I think I had to stash it to switch branches and that was a few days ago

sullen phoenix
#

hm?

#

do you mean logs @trim cradle?

hardy gorge
#

Those type hints you're now trying to give don't look like type hints.

trim cradle
#

Whatever emulates the infraction database locally

hardy gorge
#

One is just documentation of the attribute used, not a type

trim cradle
#

true

sullen phoenix
#

Whatever emulates the infraction database locally
@trim cradle you need to run the actual API

#

ahh i gave you my config, right?

#

if so, in the docker-compose.yml, change the site aliases from subdomain.web:8000 to subdomain.pythondiscord.local:8000

cold moon
patent pivot
#

hmmmm

#

not yet really

#

it's been blocked until the k8s migrate @cold moon

#

so I've only just started working on it again

cold moon
#

Oh, yeah, this don't even have any CI.

patent pivot
#

It will have CI soonโ„ข๏ธ, I'll just steal from Ves ๐Ÿ˜„

crude gyro
#

<@&295488872404484098> <@&778378647618453545>

A fun idea that was suggested in a staff channel just now: Whenever says "seasonalbot", <@&518742000514891776> can respond by pinging that person and explaining that actually their name is Sir Lancebot.

The bot would pick one of 10+ random responses so it doesn't feel repetitive, and we write all the responses in old timey medieval English.

Anyone wanna write it? Or does anyone have suggestions for fun medieval responses the bot can give?

hardy gorge
#

one request: a cooldown

brazen charm
#

Feels like a common enough phrase now that it could become annoying

crude gyro
#

a generous cooldown sounds fine.

#

even like.. several hours.

mellow hare
brazen charm
#

The responses should also happen in the commands channel imo to not pollute topical/help channels

crude gyro
#

pollute? wow.

#

that's a very strong word for a bit of fun.

patent pivot
#

I don't see a context where seasonalbot would come up in conversation in topical or help channels

mellow hare
#

Unless it's someone suggesting "Hey, if you want to learn about disocord.py" blah blah

crude gyro
#

well I hate the idea to put responses in bot commands. I'd rather scrap the whole feature than go for that implementation

mellow hare
#

But it is a bit more obtrusive than like the Halloween one where it's just a reaction

#

I'm not super keen on it actually sending a message

patent pivot
#

A reaction doesn't indicate much

obsidian patio
#

We could otherwise just react with lemon_grumpy to the messages

mellow hare
#

I'm not suggesting it as an alternative

patent pivot
#

We should probably look into rebranding the code and repo before we add this feature though

mellow hare
#

Just that I don't like the idea of the bot interrupting help

patent pivot
#

seasonalbot has been mentioned less than once a day in #python-discussion and that is when it was called seasonalbot

obsidian patio
#

"Come on, that's not my name! I'm Sir Lancebot"
Something simple like this (one line) could be fun

mellow hare
#

I'm just really really against anything that interrupts help channel stuff at all

#

I kind of see those as sacred places

obsidian patio
#

If someone says "Check out SeasonalBot", how helpful is that, to be fair, if they can't find a repo or bot with that name?

rocky bloom
#

you could have it as a message that deletes after a certain number of seconds

crude gyro
#

interrupts is a strong word. it implies anyone would ever see this as anything except a bit if fun.

brazen charm
#

I guess it not that bad with the frequency it may occur in general channels, but k don't see the need for it to be active outside of the bot's channels as hemlock said

patent pivot
#

I do wonder what contexts seasonalbot would come up in a help conversation, or even a #python-discussion conversation..

mellow hare
#

Fine, interrupt might be the wrong word, but my point is that a bit of fun shouldn't disrupt, bother, intrude, whatever adjective properly describes it, a help channel. That's why the server exists

patent pivot
#

like, once we rebrand the repo it will just be "check out sir lancebots source code" as an example in py-gen and maybe d.py

mellow hare
#

I'm really firm on this

short snow
#

"No no no, don't be silly, I'm Sir Lancebot" something like this?

patent pivot
#

I don't see it coming up in a help conversation ever

obsidian patio
#

I think it could come up as a "here's something you could try contributing to". But in that case, isn't it better to tell them that it's not called SeasonalBot and that you won't find anything with that name? They may not actually know how it is

cold moon
#

Who is Contributor Lead?

thorny obsidian
#

(I will sometimes reference Seasonal Lancebot in help channels as an example if someone is stuck on a d.py feature)

mellow hare
#

@cold moon I am

short snow
#

hemlock

cold moon
#

Okay, is this Leads thing new?

mellow hare
#

It is yeah

crude gyro
#

sounds like you're defending a very fine principle, even though it doesn't really work for this implementation. if someone mentions seasonalbot and sir Lancebot corrects them, that's not gonna disrupt, interrupt, or intrude. I think the helper will say oh right we changed the name and probably call it Sir Lancebot next time.

patent pivot
#

in all of the active help channels right now there has been 5 mentions of seasonalbot

#

ever

#

2 of them are links to source, 3 of them are people working on seasonalbot, lol

short snow
#

or it wld only work in dpy, pygen and help channels?

cold island
#

I think in the few contexts "seasonalbot" will come up, clarifying what the bot's actual name is is not a bad thing. But like joe said maybe it should wait until we rebrand the repo

mellow hare
#

Fair enough

patent pivot
#

yeah, we should go ahead with the repo rebrand before we do this

crude gyro
#

I agree that we should rebrand first.

obsidian patio
#

@cold island Yeah, that's my point exactly

cold island
#

I concur ๐Ÿ‘

mellow hare
#

@cold moon All yours

cold moon
#

Gonna fix it now.

mellow hare
#

Appreciate it. Let me know when you need a review

eternal owl
#

what is the state of this PR?

hardy gorge
#

I'm not sure

#

It's probably something we need to think about and we now have an Event Lead.

#

We typically don't have a lot of dates far in advance, not currently anyway

eternal owl
#

so the event lead decides the dates/upcoming events ?

hardy gorge
#

but it's nice to have a good overview of future (and past) events

thorny obsidian
#

I have a tentative event calendar on notion, but I don't think I have anything firm enough to put up at the moment. We could at least put AoC and backfill the previous year's events.

I'm not sure what the calendar might look like with dewikification though.

hardy gorge
eternal owl
#

I think the past events are displayed in the timeline

patent pivot
eternal owl
#

btw, what do we use azure for?

#

CI?

patent pivot
#

we don't anymore, lol

#

but yeah, it used to run our linting CI flow and deploy to salt as CD

eternal owl
hardy gorge
#

No

patent pivot
#

oh yeah that's irrelevant

eternal owl
#

alright

hardy gorge
#

The problem is that we don't really have such a link now

#

I've been thinking about creating a GitHub action for custom webhooks for our runs

#

Because, currently, a merge could trigger up to three separate check webhooks and none of them have links

patent pivot
#

yeah, there is a slight downside to the workflow_run in that it isn't attached to a commit

hardy gorge
#

I think we could make one with a bit more info that only sends one for the final workflow that runs.

#

So, either a failing one (which stops the worflow sequence) or the terminating one for that trigger.

#

Anyway, this issue can be closed for now

patent pivot
#

yep

eternal owl
cold moon
#

Can I use non-async emoji library to de-unicode emojis to such :emoji: format to catch emojis?

green oriole
#

How does this library work?

cold moon
#

Looks like that this is built to re library.

green oriole
#

Do we really need a library for that?

#

It would just be a simple regex

cold moon
green oriole
#

I see

#

It wouldn't make sense for a library like that to have an async API, so yeah, go ahead

#

Can you mention it on the issue?

timid sentinel
#

How would using that library work for custom emojis? As they can have any name

green oriole
#

We would use the current regex for that

cold moon
#

I will still use Regex to do final parse

#

I use demojize function to convert unicode to :emoji: format, then I can use findall

cold moon
green oriole
#

Damn that is some fast work

mellow hare
#

Looking at it now

#

Um

#

Okay, can I just...

#

demojize

cold moon
#

There isn't any major changes, so this don't take much time.

mellow hare
#

I can't read it without seeing demo jizz

cold moon
#

Lmao

mellow hare
#

I literally keep looking at it and laughing

#

I'm such a child

patent pivot
#

lol

green oriole
#

Hahaha

mellow hare
green oriole
#

I already reviewed it

mellow hare
#

.... yes

#

Yes you did

green oriole
#

Or you want a 3rd review?

mellow hare
#

No I just didn't notice

#

Sorry guys

green oriole
#

Haha no worries

cold moon
#

Nice, so fast merge

obsidian patio
#

.issue 1287 bot

dusky shoreBOT
obsidian patio
#

Could we get a second review on this? Itโ€™s a very short change

obsidian patio
#

Discussing the k8s migration in Voice?

crude gyro
#

yep

#

well, we will be.

obsidian patio
#

Alrighty

mellow hare
tranquil topaz
#

oh right, i have forgotten. thanks.

trim cradle
#
    @commands.command(name="close", aliases=["dormant", "solved"], enabled=False)
    async def close_command(self, ctx: commands.Context) -> None:
        log.trace("close command invoked; checking if the channel is in-use.")
        if ctx.channel.category != self.in_use_category:
            log.debug(f"{ctx.author} invoked command 'dormant' outside an in-use help channel")
            return

        if not await self.dormant_check(ctx):
            return

        claimant = await self.help_channel_claimants.get(ctx.channel.id)
        await self.move_to_dormant(ctx.channel, "command")
        await self.remove_cooldown_role(claimant)
        ...

Still working on the close command; it looks like claimant still isn't the right data type.

#

oh I think I know

#

self.bot.get_guild(constants.Guild.id) gets called a lot--why isn't the guild an attribute?

tawdry vapor
#

Yeah it may be a good QoL to add it as an attribute

#

I mean, as an attribute of the bot

#

But it's just to shorten code

#

Getting the guild isn't an expensive operation as far as I know

#

It just looks it up in a dictionary by ID

trim cradle
obsidian patio
#
class SeasonalBot(commands.Bot):
    def __init__(self, **kwargs):
        # ...
        self.loop.create_task(self.send_log("SeasonalBot", "Connected!"))

This is how it currently looks when starting the bot. Do you know how I could get the username of the bot instance in this function? This is part of bot/bot.py

tawdry vapor
#

You have to do it in a coroutine, since you must wait for the guild to be available

#

Then you need to fetch the bot's Member from the guild

#

Cause I don't believe ClientUser has nickname info

#

If you need it's name rather than nickname then ClientUser is fine

#

And you wouldn't need a coroutine/waiting for the guild

obsidian patio
#

I purely need the username of the bot. The nick name doesn't matter

tawdry vapor
#

Then bot.user.name

#

Ah well

#

bot.user is None if the bot isn't logged in yet

#

And cogs are loaded before running the bot

#

So... maybe you do need to wait for the guild after all

obsidian patio
#

So, it's logging that it has connected before actually starting the bot?

tawdry vapor
#

I'm not as familiar with seasonal bot

#

But it is possible to load extensions and cogs before the bot logs into discord

sullen phoenix
#

can't you use bot.user in on_ready?

tawdry vapor
#

Yeah I suppose that's fine

obsidian patio
#
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.http_session = ClientSession(
            connector=TCPConnector(resolver=AsyncResolver(), family=socket.AF_INET)
        )
        self._guild_available = asyncio.Event()

        self.loop.create_task(self.send_log("SeasonalBot", "Connected!"))

For reference, this is the full __init__

tawdry vapor
#

Cause you don't need the guild for a username

trim cradle
#

Is it possible that other bots online in the test server are interfering?

#

there's an issue in my code for sure, I'm just wondering what else might be in play

tawdry vapor
#

Yes, looks like ves's bot is online

#

you can figure out his bots prefix and unload the cog

trim cradle
#

how

crude gyro
#

@obsidian patio

can I ask what you're working on?

tawdry vapor
#

!ext unload help_channels but IDK his bot's prefix

obsidian patio
crude gyro
#

okay. this will be caught by what I'm working on right now, so I'm not sure you need to fix it

obsidian patio
#

What are you working on? For SeasonalBot

crude gyro
#

rebranding it to Sir Lancebot

obsidian patio
#

Right, okay. Is there an issue for that, so I can mention that in mine?

crude gyro
#

not really, but I suppose I can make one?

obsidian patio
#

And I assume you mean that you're looking to make it dynamic as well

#

That would probably be nice

crude gyro
#

not sure it matters?

#

seasonalbot is mentioned in a million places in the bot. I'd be changing all of those, changing the repo name, the deployment on kubernetes, everything.

#

and yeah sure, dynamic would be better design but it's not like we're going to be renaming it every six months.

#

at most, I'd make it a config variable

obsidian patio
#

I'd be fine with a config variable like bot_name or something similar. That would make it quite dynamic

crude gyro
#

yeah. but I can't put that config variable into class names or comments

#

so it's still going to be hardcoded some places.

#

is all I'm saying

obsidian patio
#

Of course

crude gyro
#

class attribute for the Bot class, maybe.

trim cradle
#

@tawdry vapor regarding your refactor, I won't make any changes other restructuring changes for now. Though it looks like the configuration I'm working with removes the cooldown role and times out a help channel much faster than the real bot.

obsidian patio
#

We should try to call things Bot instead of SeasonalBot or SirLancebot as well when possible. If you're currently converting it, that would be a welcome change if it isn't too much trouble

crude gyro
obsidian patio
#

What do you think about putting it in a config file and using that to set the class attribute name?

crude gyro
#

although I think I'll probably move the name into constants, because it turns out the bot instance isn't always available everywhere that I need it

obsidian patio
#

Yeah, sounds good

#

A very welcome change โ€”ย especially renaming to Bot

crude gyro
#

I don't really love Bot but oh well

#

it's the best I got

obsidian patio
#

I think it's quite good. It's the Bot and we give it the attributes later. It's almost like having a Human class and giving it attributes like name = "lemon"

cold island
#

@obsidian patio gave your PR a review

obsidian patio
#

Perfect, thanks

#

@cold island should be fixed ๐Ÿ˜„

trim cradle
#

@tawdry vapor do you need your bot to be managing help channels rn?

tawdry vapor
#

No

#

It's already off

#

I had it on for 30 seconds

trim cradle
#

alright, thanks

crude gyro
cold island
crude gyro
#

yep, but it will soon

#

right now the whole site is down

#

because I renamed the seasonalbot repo. we're fixing that now :D

tawdry vapor
crude gyro
cold island
#

tsk tsk, force merging eh? and I was about to approve too

crude gyro
#

Mark's approval counts for two

trim cradle
#

It appears that async-rediscache is our own project? should we add a values() method?

trim cradle
#

Looks like my fix for the !close command is working, except that when the bot starts, it thinks that two help channels are already claimed (by me and Zig, if it matters) even if no channels are in use.

crude gyro
#

and yeah, it's something me and ves cooked up.

late wolf
#

where is the link for the redis that u guys use?

crude gyro
#

we use totally ordinary normal redis

late wolf
#

oh,

crude gyro
late wolf
#

thx

crude gyro
#

but this isn't a replacement for redis, just a utility for it

#

an async API for redis in Python, more or less.

late wolf
#

Why use redis when u have a db,???

crude gyro
#

well, first of all, the bot does not have a db

late wolf
#

@stable mountain does not?

crude gyro
#

nope. it just sends its requests to our API

late wolf
#

oh

crude gyro
#

and the API has a database.

#

so if we want to store something, we'd have to write a new endpoint for the API

#

that's inconvenient, and storing transient data in postgres is a waste anyway

#

so it's usually better to use a simpler, document database for this kind of data

late wolf
#

oh i see.

#

So it gets the data from the API's database?

crude gyro
#

hm?

cold moon
#

@patent pivot Can I Dockerize (Dockerfile, docker-compose.yml for development) forms-backend and add CI to it or you want to do this yourself?

patent pivot
#

go for it

#

how in depth do you plan to go for CI?

late wolf
#

what is CI?

patent pivot
#

continuous integration

#

i.e. run a code linter on every push to a repo

late wolf
#

oh i see

cold moon
#

I plan linting for everything, build and deployment for main pushes. I will make config based on other deployment.yaml files. There isn't any tests currently, so no point to test.

patent pivot
#

yeah that sounds good

#

do you have permissions on that repo to make branches

cold moon
#

No, this don't show me option to create branch.

patent pivot
#

should have write access now

cold moon
#

Yes, thanks

cold moon
#

@patent pivot What Python version forms-backend uses?

patent pivot
#

hmmmm

#

I've been using 3.9, so that @cold moon

cold moon
#

Okay

#

Just pyproject.toml don't mention it

patent pivot
#

it does actually @cold moon

#
[tool.poetry.dependencies]
python = "^3.8"
#

first entry in the dependencies

#

I think we can safely bump that to 3.9

cold moon
#

Oh, this is there! I never used Poetry before.

patent pivot
#

It's a nifty tool, I primarily use it because pipenv is pretty broken for me.

#

If you haven't figured out a nice way to run the app yet @cold moon, poetry run uvicorn --reload backend:app is the way to go

#

soon enough I'll add an entrypoint to the application so you can do poetry run start or whatnot

cold moon
#

Okay

patent pivot
#

in the container we'll do some poetry things like ```
poetry config settings.virtualenvs.create false
poetry install --no-dev
uvicorn --workers 2 backend:app

cold moon
#

I push Python to 3.9 then

patent pivot
#

๐Ÿ‘

cold moon
#

Should be --workers hard-coded to 2 or should be dynamic? @patent pivot

patent pivot
#

@cold moon hm, we'll go 2 for now, if we need to scale we'll probably scale at the kubernetes level

trim cradle
#

If we make RedisCache a subclass of typing.Mapping, that implicitly gives us type annotation support, yes?

#

might be a bit more to it given that we have named method rather than using the dunder methods

brazen charm
#

It doesn't implement the mapping protocol so it shouldn't be that, but should be able to make it a custom generic

#

Not sure how much that'd help though, the types are already fairly constrained so things like autocompletion are already provided by the current hinting, and specifying what the caches actually hold in a comment around them (user id: timestamp for example) gives you much more valuable information

cold moon
#

@eternal owl About bot's User Events system PR, you should mark reviews as resolved after you resolve them. When there is a lot of reviews, this will make finding not addressed reviews easier. I resolved old ones myself now.

eternal owl
#

oh right, will do, thanks for letting me know ๐Ÿ‘

cold moon
#

@patent pivot Do you know why this happens: When I use docker run to run built container and then I use Ctrl+C to quit (uvicorn), this don't do anything?

#

Uvicorn docs suggests using gunicorn for production.

patent pivot
#

hahaha

#

maybe we should use gunicorn

#

though what is gunicorn like for asyncio compat?

#

gunicorn is gevent, uvicorn is (presumably) uvloop, lol