#dev-contrib

1 messages · Page 73 of 1

cold moon
#

Their docs say gunicorn -k uvicorn.workers.UvicornWorker, I think this worker part is important.

cold moon
#

@eternal owl You can access to command arguments from Context, what is available in checks.

eternal owl
#

ooh the context.args, right, I forgot

#

lemme try

patent pivot
eternal owl
#

looks like ctx.args and ctx.kwargs dont really work with check(), I have to parse them from ctx.message.content, is it still worth using check?

#

@cold moon

cold moon
#

Huh, then not @eternal owl

cold moon
cold moon
#

@patent pivot I'm stuck with https://github.com/python-discord/forms-backend/pull/1 : Linting (flake8) have some parsing issues what raise errors, but in local device I don't get this error. Can you help to solve this issue? I tried to use specific actions and other ways, but they don't run flake8 extensions.

patent pivot
#

I'll have a gander, though I'm pretty busy today

cold moon
#

Okay

cold moon
#

@patent pivot Solved issue in staff lounge. Problem was that this linted venv. Now only thing that I have to do tomorrow is fix linting errors.

patent pivot
#

Ah perfect

short snow
subtle kraken
#

taken care of

short snow
short snow
#

probably like the way ks123 suggested for bounty board

#

u could also add helpers and helpers + to that too

eternal owl
#

I don't think it makes a lot of difference

obsidian patio
#

I agree about that @eternal owl, though I’ll elaborate on my reasoning on the issue later on

cold moon
#

I think our Contributors is enough wise that they don't make flood PRs and reviews

hardy gorge
#

I think that, too

green oriole
#

Yeah, that's a pretty good point

hardy gorge
#

It's a tool to make contributions visible and the threshold of having the contributors role should be enough to make it work

#

Anyway, @mellow hare is taking a lead on this project and we discussed it yesterday during the admin meeting as well. I think we're going to trial it in one form or another. I don't really think that it will lead to so many problems. The staff-only reviewfest worked just fine as well.

green oriole
#

Well, this sounds more like the Hacktoberfest 2019 than 2020

mellow hare
#

I'll elaborate on it when I get to the office

obsidian patio
#

@hardy gorge could you leave your thoughts on the issue as well, so we have the thoughts on a single place?

hardy gorge
#

Huh?

hardy gorge
#

This was something that was already extensively discussed; these issues are just about implementation, right?

obsidian patio
#

I think that’s very much about implementation, as well as if it’s even a good idea at all, to some extent. We haven’t really reached a consensus on either of the topics imo

eternal owl
#

do we want the leaderboard to be displayed in a channel which the bot edits as time goes on or will it be displayed at the end of each month in the #779073065560703007 channel or maybe even a command?

#

and the bot constantly updates the message

hardy gorge
#

We haven’t really reached a consensus on either of the topics imo

We've already extensively discussed the idea within the admin meeting. We're going forward with it, although the exact shape may change.

#

I trust our contributors and staff enough to not act to the detriment of our projects. If they can't, they should not have either role.

green oriole
#

Honestly it would have been nice if core devs could have been kept in the loop, we are pretty much affected by those. The original proposal was about including everyone, wasn't it?

hardy gorge
#

This is just a playful way of both highlighting areas that need attention and highlighting the contributions people make.

#

There were various variants we discussed, yeah.

obsidian patio
#

I agree about the idea of trying to reward people for contributing fundamentally, but these kinds of systems often lead to unintended consequences

hardy gorge
#

Yes, they could. That's why we decided to restrict it to contributors and staff.

obsidian patio
#

I don’t quite understand why you’re so determined on the idea that you won’t reconsider it though

green oriole
hardy gorge
#

Yeah, it's good to discuss those concerns. There's no harm in voicing them.

#

But, ultimately, we also discuss things within the admin group and decide that we want to trial something in an area

#

We're not deaf for concerns, but we also want to move forward and trial some projects, especially if we'd otherwise shut everything down and/or get stuck in consensus hell

obsidian patio
#

I hear what you’re saying, but right now it has no consensus outside of the admin group at least. I fundamentally like the idea of rewarding people for contributions, but this one has major flaws that need to be addressed. We won’t get stuck in consensus hell by taking in the input from other contributors, staff members and core developers. Including people and making them feel like an important part of the system is one of the key pieces to keep people engaged long term

#

Once again, I’ll mention the importance of long term stability of the contributions. We’re not looking for people to peak with a high-activity period where they reach the top of the leaderboard. We’re looking for long term contributors who view others as collaborators and team mates — not competitors

hardy gorge
#

I think I expressed myself wrongly: We do appreciate input, but sometimes we do make decisions as the admin team regarding policy points we think are important.

#

That's a valid concern and we will take note of it. I don't think it's a given, as we are talking about a group of people who are known to us: contributors and staff members. We simply don't know if this is going to be a problem and how much of an issue it's going to be. I don't really believe it's going to be an issue at all, but if it is going to be an issue, a trial should show that.

obsidian patio
#

I think that’s a fair point. The issue is that what I’m referring to isn’t a one month thing. It may work in such a short time frame. The issue is if we consider the long term. If you vision a year into the future, do you think that we will have more great and consistent contributors? Will this leaderboard contribute to that?

mellow hare
hardy gorge
#

Personally, I don't think it will change a lot; people who are motivated to contribute will still do so. I do think it will make frequent contributors more visible. It's not easy to see who's a frequent contributor to our projects without having a close look at the GitHub activity while it's very easy those who are very active in policy discussions in staff channels.

#

I do think the bounty board is a good tool to highlight issues and PRs that are currently of great interest to our projects.

green oriole
hardy gorge
#

Not all features have an equal priority and handpicking a few that need exposure is a good way of showcasing them here, within the community

#

(as opposed to relying people to visit GitHub, selects labels, and browse like that)

mellow hare
#

The main thing I wanted to get out of this was both calling attention to things that need to get done AND trying to get more members of the community involved with the process.

#

As I say all the time (probably to the point of being annoying), this community is first and foremost an education server. If I can get the opportunity to get people interested not only in PRs but also Code Reviews, then I think it's a step worth at least trying

#

Some people need that push to get going. Hopefully once they get a taste they'll be interested in the process and stick with it

obsidian patio
mellow hare
#

Before (if) this goes public, I'm going to explicitly say that high scores do not mean you'll get contributor.

thorny obsidian
#

On that note, and I'll make a comment on the issue too, I think code reviews should be weighted higher than producing code.

mellow hare
#

Noted

#

The current scoring system is just a rough idea I had at the moment

#

I'm more than willing to have it shuffled around until we find something that feels right

green oriole
#

I think making it public will end up in an endless Hacktoberfest 2019

hardy gorge
#

Yeah, we discussed that yesterday as well

mellow hare
#

@green oriole yes and no.

#

If we start getting code reviews into the mix, it won't be nearly as tedious

thorny obsidian
#

I just had a good convo with my best friend over the weekend about overall strats for encouraging code reviews, it happens to be very applicable here!

green oriole
#

But how can be sure that someone would left a review did its job correctly, and isn't just looking for point? We will have to do the work twice.

mellow hare
#

Correction, I will

thorny obsidian
#

Are you concerned that staff and contributors won't actually review code?

mellow hare
#

And that's something I'm willing to take up

#

He's saying whenever it gets opened to public

green oriole
mellow hare
#

Considering I'm going to be looking through the repos daily, it should be fine

#

And I could ask for assistance from time to time

thorny obsidian
#

I think that's putting the cart in front of the horse right now. I think the code review guidelines will help as well. Maybe have a checklist people can follow.

mellow hare
#

Oh trust me, I don't plan on being the only poor sod going through them all

#

But something to consider, ALL of our PRs require a core dev's signoff anyway

green oriole
#

Yeah, but you do need at least 2 good code reviews to be done before merging

mellow hare
#

If the core dev notices that the PR got a lgtm but they managed to find tons of stuff, we'll know that the other person isn't putting in their best

green oriole
#

As cool and well done the code review guidelines might be, we can't force people to follow them

#

But I agree on that point, it sounds like a problem for later

#

We are working on a lot of "if" right now

mellow hare
#

Exactly

#

For now, it's internal

#

And like Kat said, the guide needs to be done first

#

..... and I'd like help with that

#

I've hit a wall on how to articulate it

#

It shouldn't get stuck behind me just because I've got writer's block

hardy gorge
#

I'm confused about one aspect: Did we not decide to keep it contrib+staff yesterday?

mellow hare
#

For now we did, yes

#

But I feel like the board won't serve its purpose until it gets the community involved

#

I love our contribs, but they're, what, 0.001% of the total server pop?

green oriole
#

!role 295488872404484098

stable mountainBOT
#
Contributors info
ID

295488872404484098

Colour (RGB)

#55cc6c

Colour (HSV)

0.37 0.58 204

Member count

35

Position

17

Permission code

0

mellow hare
#

And most have already become staff

green oriole
#

0.035%

mellow hare
#

That's still teeny-weeny

hardy gorge
#

What we discussed yesterday is that the board is a way of highlighting contributions. Most of us won't see what happens on GitHub at all, as it happens outside of the community.

mellow hare
#

I agree. As I said, this is a trial and it's locked down for staff and contribs

#

I'll try to keep more focused on the current issue at hand then

hardy gorge
#

Anyway, we can cross the public bridge once we get to that point

mellow hare
#

Yep

cold moon
#

I think this should be contributors and staff + invited normal members.

mellow hare
#

If we're thinking someone is worthy of being on the board, would we not have them become a contrib anyway?

#

I don't want this to feel like it's an exclusive club

#

Everyone on this server should have a stake in the game, as it were

eternal owl
mellow hare
#

I'm in no way trying to dismiss anyone's thoughts or opinions on the matter. I want to hear everyone's thoughts on this, either publicly, privately or on the repos

#

Yeah we should

green oriole
#

There's a meta issue for those

eternal owl
#

I will comment in that

green oriole
#

If you can comment on it, that'd be nice

eternal owl
#

done

green oriole
#

thanks!

eternal owl
#

also, what the 2 reddit commands we have on our bots?
I guess we want to have it on only 1 bot, on @dusky shore and remove it from @stable mountain

mellow hare
#

Ideally

green oriole
#

We would need to migrate #reddit to lancebot too, but yeah

obsidian patio
#

This is something @green oriole has talked about a lot hahaha

eternal owl
cold moon
#

This is sending it with webhook yes

eternal owl
#

yea, so what is there to migrate to @dusky shore from @stable mountain

#

Unless we really like the reddit command on python compared to @dusky shore's reddit command

green oriole
#

But @stable mountain is sending webhook messages, isn't it?

cold moon
#

Yes, @stable mountain sends these webhooks

stable mountainBOT
#

Gah, so many pings!

green oriole
#

so @dusky shore will have to send th- ... lol

eternal owl
#

someone just woke up @stable mountain

eternal owl
#

Maybe we can open an issue for the reddit command and migration?

green oriole
#

Yeah, I'll do that

#

!remind 1h30M do that

stable mountainBOT
#
No problem.

Your reminder will arrive in 1 hour and 30 minutes!

green oriole
#

@thorny obsidian why do you think we shouldn't just give one point for both?

thorny obsidian
#

Because I want to specifically incentivize code reviews as they can sometimes be seen as less "fun" or what have you.

eternal owl
#

@green oriole

green oriole
#

Alright, sounds good

eternal owl
#

ty

cold moon
#

When any core dev have to time, @dusky shore 524 PR should get core dev review, as this already have 2 approvals.

cold moon
#

Will we have summary page in site about this year Hacktoberfest?

green oriole
#

I didn't know we had one for 2019 lol

cold moon
#

I don't know do we have for 2019, but I think we should have summaries for our events.

green oriole
#

Aaah

#

Maybe @thorny obsidian could be interested about writing one?

thorny obsidian
#

haha, I was just about to ask what the process is for putting up something on the site since that sounds like my domain and a good idea.

cold moon
#

I think this should be possible to have draft posts?

green oriole
#

Haha, we are currently in the process of migrating to a markdown based workflow

cold moon
#

Event pages will have HTML

#

I'm migrating them right now

green oriole
#

You'd simply have to commit markdown to our site repo

#

Well, once the migration is complete

thorny obsidian
#

I'll just create markdown that I hold in reserve until the migration is complete

green oriole
#

Sounds good

thorny obsidian
#

I guess this might be more of an @wild ridge question, but will it support html + markdown or strict markdown?

green oriole
#

If you need to pull any stats about the hacktoberfest or whatever, feel free to ask us lemon_happy

cold moon
#

Like I said, staff decided to have full HTML event pages that is in repo.

thorny obsidian
#

oh whoops, I can't read. Thanks!

green oriole
#

Oooh, I thought we were also going to have markdown

#

Alright thanks

cold moon
#

You can also open PR now to dewikification branch, then this go live same time when dewikification is completed.

thorny obsidian
#

Oh neat, I will give that a go. I'm still a bit of a git noob, so I might need core dev assistance if I fuck it up

green oriole
#

As I always say, no worry, you can always get rid of the proofs if you mess up haha

cold moon
#

And you can't make any disaster, because we have protected branches 😆

stable mountainBOT
#

@green oriole

It has arrived!

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

green oriole
#

Smh just when I shut down my computer

rapid swallow
#

shut down your computer and don't tell us 😉

patent pivot
#

@cold moon review left on forms-backend#1

tawdry vapor
hardy gorge
#

!remind 8h Review this

stable mountainBOT
#
I got you.

Your reminder will arrive in 8 hours!

late wolf
#

For the bot, I see lots of logging, are all of those logs in a file?
Or are they sent to the specific channels?

hardy gorge
#

The bot does write its logs to a file within the docker container, but we can also view the logs from the command line using kubectl

#

The logging level is set to INFO in production

#

Which means there are not as many log messages in production as you see in development mode

late wolf
#

ah so it writes the logs to a file, i see thx

hardy gorge
#

It does, but that's not how we view the logs

#

The logs outputted are also capture by docker (you could view them with docker logs container) and those are relayed by kubernetes

#

It would still work without writing them to file

late wolf
#

those are relayed by kubernetes
where are they relayed?
to the site or the server

hardy gorge
#

Someone with access can access them from the command line with a tool called kubectl

#

We're also currently setting up a dashboard

late wolf
#

oh i see

stable mountainBOT
#

@hardy gorge

It has arrived!

Here's your reminder: Review ![this](https://cdn.discordapp.com/emojis/470903994118832130.webp?size=128 "this").
[Jump back to when you created the reminder](#dev-contrib message)

hardy gorge
#

!remind 2h this

stable mountainBOT
#
Affirmative!

Your reminder will arrive in 2 hours!

valid glade
#

!remind 2h

stable mountainBOT
#
Missing required argument

content

#
Command Help

!remind [mentions]... <expiration> <content>
Can also use: reminder, reminders, remindme

Commands for managing your reminders.

Subcommands:

!remind delete <id_>
Delete one of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> <content>
Set yourself a simple reminder.

eternal owl
#

@green oriole you can assign the reddit issues to me

green oriole
#

Sure thing

#

Have you commented on them?

eternal owl
#

done

green oriole
#

Done!

eternal owl
#

ty

stable mountainBOT
#

@hardy gorge

It has arrived!

Here's your reminder: ![this](https://cdn.discordapp.com/emojis/470903994118832130.webp?size=128 "this").
[Jump back to when you created the reminder](#dev-contrib message)

green oriole
#

The reminder chain haha

surreal venture
#

@hollow cedar Sorry if I am disturbing you , but can you please drop a review on my PR?

dusky shoreBOT
eternal owl
#

I will take a look soon

cold moon
#

@surreal venture About 509, persisting data to JSON doesn't work anymore. You have to use Redis now.

cold moon
#

Is there any way to get Postgres or MongoDB to @dusky shore ? I'm currently thinking about AoC implemention, but Redis don't support dicts and lists and is very limited.

green oriole
#

Weeeeellll

#

I would be against that because it will add a pretty major complexity to the bot

#

I think seeing if async-redis-cache could support those type instead sounds like a better idea (CC @hardy gorge)

brazen charm
#

worst case scenario you should be able to pickle/json it

cold moon
#

I don't want to store JSON.

hardy gorge
#

Could you describe the type you're after? A RedisCache is already pretty close to a dictionary

cold moon
#

I don't want to create namespace for every user

#

I want user -> user info

brazen charm
#

What's the data layout you need to store?

#

user info would be a list for example?

cold moon
#

No, simple example is such dict: {score: x, days: [{day: 1, completed: time, star2: bool}]}

brazen charm
#

serializing it before sending it off to redis sounds like the simplest solution to me if we're avoiding proper databases because of ease of use

green oriole
#

I agree

cold moon
#

Is there no way like fake DB?

#

Like fakeredis?

hardy gorge
#

fakeredis does not give persistence

#

It's faking redis without actually having a redis backend

brazen charm
#

I don't think there's anything readily available for postgres; redis is much less complicated to replicate the behaviour of

hardy gorge
#

Regardless, serialization sounds like the way to go here, although you need to be mindful of race conditions

#

The hash sets that we're using basically have two keys and one value: (namespace->key->value)

#

That's the deepest nesting of native redis types you'll get

cold moon
#

Let's see what I can do with JSON. I will make not persistent list to cog that store all entities that is being edited and this check for them.

brazen charm
#

I'd lean towards pickle here personally (and used it it for the doc redis cache), as it's more performant and nobody will be viewing the raw data in redis anyway

cold moon
#

@patent pivot About forms-backend, do you really want type hints for self and cls?

surreal venture
#

What's Redis now?

patent pivot
cold moon
#

@patent pivot PR is now ready for another review.

patent pivot
#

approved @cold moon. @hardy gorge if you get a chance could you give it a onceover from a CI PoV

late wolf
#

What's the ratelimit of snekbox?

green oriole
#

We don't have any rate limit AFAIK

late wolf
#

oh

cold moon
#

@late wolf I think this have max 2 evals running at same time, but no actual ratelimit.

lament hedge
#

sry it's me. implementing requested changes and every time i merge a requested change it auto runs the tests

#

idk how to stop it

cold moon
#

Oh, this is in fork

grave summit
#

how can I start contributing to the bot?

cold moon
#

How to store Pickle object to Redis and then get it again? Redis need argument to be string, but pickle wants bytes.

brazen charm
#

redis strings should be able to store binary data

cold moon
#

I mean I need to provide some encoding when converting Redis string to bytes (I use str converting when I store to Redis).

#

What encoding I should provide?

green oriole
green oriole
cold moon
#

I thought that this is main repo master

cold moon
#

@brazen charm I think I'm still going to use JSON. This is just much easier than pickling and depickling object.

brazen charm
#

Ah right I guess rediscache will try to turn everything into strings

hardy gorge
#

There's a max of two eval workers

#

Just one job per person at the same time enforced by @stable mountain I think

#

Other jobs just queue up and we process a max of two at a time

#

Maybe not. I think that's what Mark recently said when we were thinking about the container memory limit

#

Ah, yes

#

There are two workers available (restricted on the gunicorn level)

brazen charm
#

Any reason rediscache doesn't have a bytes datatype? Feels like a useful type to have @hardy gorge

hardy gorge
#

It's never come up before

#

I think we could, but we'd have to refactor some bits to bypass the encoding/decoding steps

cold moon
#

I already solved issue with JSON, but I think this might really be useful.

brazen charm
#

Just looked at the code, is it not using pickle intentionally to simplify what it can do or for the size gains? Doing dumps/loads directly instead of the typestrings would work nicely and expand the possible types to a wide range

rapid swallow
#

Perhaps it has something to do with race conditions or something

hardy gorge
#

I'm not sure if I want to pickle/unpickle everything. I'd rather give the bytes option to the end user and let them handle it themselves.

#

Including making sure that nothing "bad" ever gets pickled and then unpickled

brazen charm
#

Even then, using pickle in the background with restricted types sound simpler to me

trim cradle
#

I want to make sure that my fix for the !close command is right but I'm not sure exactly what testing to do before I put in the PR

#

I'm pretty sure it's working

cold island
#

What is the fix

#

Also you can submit a PR draft if you don't want to say you're done yet but want to allow other people to take a look

trim cradle
#

I'm realizing that docker isn't using my virtual environment

cold island
#

Why would it pithink

#

It's using whatever is in the image

trim cradle
#

I see

#

my image is missing emoji, then

hardy gorge
#

Is it part of the Pipfile.lock?

#

If so, you should be able to rebuild your container

cold island
#

Your test bot just doesn't have access to those emojis

#

If that's what you mean

trim cradle
#

I think docker-compose pull is what I need. The bot would no longer start once I pulled from master.

hardy gorge
#

you could try a docker-compose build

#

Assuming that you're using the docker-compose in the bot repository

trim cradle
#

I'm trying that now

hardy gorge
#

It does not pull an image from somewhere; rather, it builds it from the dockerfile using your current files

trim cradle
#

This is what I get only having experience programming in an academic setting.

trim cradle
#

I'm noticing that commits in the bot repo typically have a main commit message and then a longer, secondary message. What is this called?

cold island
#

@trim cradle you mean the commit subject and body?

cold island
#

I'm just not sure if I'm answering to the right thing

trim cradle
#

I guess I'll have to figure out how to get that in the commit tool in PyCharm

cold island
#

You basically write why you're making the commit in short, and then after a blank line explain in more detail if you think it's necessary

sullen phoenix
#

the blank line is key

cold island
#

If you're committing from the command line, you can do that by using the -m flag twice

trim cradle
#

I'm learning lemon_hyperpleased

sullen phoenix
#

i'd suggest to not use the -m flag at all

cold island
#

😮

#

Let it prompt you mean?

sullen phoenix
#

yeah, git will open your editor of choice instead

cold island
#

considering I have to write every commit twice I'd rather just have it all right away 😄

sullen phoenix
#

i just use nano since it's quick and easy

#

lol

trim cradle
#

I only do git commit -m if I'm working in a terminal-only setting

#

ie my uni's mainframes

cold moon
#

@hardy gorge WARNING "::error file=%(path)s,line=%(row)d,col=%(col)d::[flake8] %(code)s: %(text)s" is an unknown formatter. Falling back to default. I get this error when I try to use same formatting like other repos use for annotations. (verbose mode)

gritty wind
#

I get the same error too, yet it still formats using that string. I think it might either be a bug, or bad wording (unknown formatter I.E not a builtin one, default = parsing)

cold moon
#

I will make changes when I'm back from school

lament hedge
#

I can't find formatter for Expiry object to send expiry date in message, like in !tempmute it sends message with until 2020-11-25 19:32 (59 minutes and 58 seconds).

#

can someone point to me where this formatter is?

lament hedge
#

I think that's it, thx

cold moon
#

@hardy gorge made changes to forms-backend GH Actions and deployment PR.

hardy gorge
#

I was thinking about your matcher. Do you know if it shortcuts after the first match in the pattern array or does it try to match all entries, regardless of previous matching ones?

#

The matcher seems to be a bit underdocumented

cold moon
#

I don't know. I used Regex that pre made actions used. This doesn't have official docs yet, only third party posts

hardy gorge
#

Yeah, I was looking into them as well during my initial investigation

#

But the documentation is lacking and I decided that the --format option was really straight forward

#

However, if it only matches the first, you could still have the "warning" vs "error" level thing

cold moon
#

This use now again format too

#

Pre-made actions don't use extensions

hardy gorge
#

By adding a matcher for the warning first, then a "matches all error codes" for the rest with an error level after

hardy gorge
#

That's what made me look for a different solution

cold moon
#

Yes, I reached same after trying multiple times

#

But I will leave from WiFi connection area now.

hardy gorge
#

I'll have a look later. There wasn't much to change, so it's probably good to go anyway

#

The files already looked good

grave summit
#

do I really need to install all this stuff to contribute to the bot?

green oriole
#

If the stuff is all the dependency at the top of the contributing guide, yes

grave summit
#

I meant the test server and account

green oriole
#

Yes

grave summit
#

how do I activate the virtual envirnoment creaated by pipenv?

green oriole
#

You don't really need to activate it

#

What do you want to do?

grave summit
#

I mean later I'd to run the scripts

#

shoudln't I do that within the ve?

green oriole
#

To run pipenv run you don't need to enable the venv

#

Pipenv will sort it out itself

grave summit
#

ah great, I always used virtualenv so far, so I was confused

#

how about docker-compose shoudln't I install that within the ve?

green oriole
#

You'd usually do a system wide install of docker-compose

clever wraith
#

how i setup @stable mountain bot @green oriole ?

grave summit
clever wraith
#

i download it in the github repo

green oriole
#

You should take a look at the link Kingboi posted

clever wraith
#

how i install pipenv on vs code?

grave summit
#

you have to use cmd for that

clever wraith
#

but which cmd

cold moon
#

@patent pivot forms backend PR is now ready for merge

grave summit
#

did you ever use pip install before,

clever wraith
#

no

grave summit
#

ok then you have a bit of reading to do before contributing in my opinion

green oriole
#

Paste them in your config.yml

#

I believe it is described later in the guide

grave summit
#

this is found in the cloned repo?

green oriole
#

No, you need to make a copy of config-default.yml

clever wraith
#

send dm to minty codess

grave summit
#

ok I think I got it now, sorry for all the questions

green oriole
#

No worries, I don't mind lemon_happy

grave summit
#

do I have to cpy the ids of all the channels?

brazen charm
#

You don't need to create all of them but some are required for the general setup and then for whatever you'd be working on to test it out. Could point them all to one or two channels if you're being lazy

cold moon
#

@patent pivot Sorry about ping again but I started thinking that when my PR in forms-backend get merged, this is first time when this actually go to production?

patent pivot
#

itttttttt is

#

yeah

cold moon
#

Nice!

patent pivot
#

that is a good point actually

#

we'll need to add a secret to contain the application environment

cold moon
#

Yes, KUBECONFIG and GHCR user and password

patent pivot
#

not those

#

like actual env vars for the container

cold moon
#

Oh, these. Yeah

patent pivot
#

those secrets are on the org already

cold moon
#

DB URL and secret key

patent pivot
#

and oauth creds

cold moon
#

I think after this is done, next thing I'm going to do in this repo is to write nice README.

patent pivot
#

okay suggestion added

cold moon
#

Commited

trim cradle
#

Trying to figure out the flake8 situation

patent pivot
#

address will beeeeeeee

#

hmm

cold moon
#

Amazing!

patent pivot
#

eh, can't figure out two levels of SSL, for now it'll be forms-api

#

merged

cold moon
#

@patent pivot Deployment failed

patent pivot
#

ah

#

I see the problem

#

fixed

cold moon
#

Nice!! I love to see when new things go live!

gritty wind
trim cradle
#

I think this output means that I lost my chance to run flake8 because I already committed the changes?

gritty wind
#

You need to add the files to git before running the pre-commit, otherwise it'll stash them all, then try to run pre-commit on 0 files, thus the skip

#

And uhh, I didn't ping you whoops

trim cradle
#

you replied and I thought that would give me some kind of alert.

gritty wind
#

It does, but only if I keep the mention option active

gritty wind
#

I turned it off because of muscle memory 😅

trim cradle
#

I see. The changes I made are already committed and pushed.

#

what does "add to git" mean, in this case? The files in question are tracked by git.

gritty wind
#

They are tracked, thus without git add they were left in the staging area

#

That functionality is what allows for commiting only certain changes from your change log

trim cradle
#

@gritty wind the changes are already committed, so what is there to add?

hardy gorge
#

You can also run flake8 directly.

gritty wind
#

In theory, if you try to commit with unstaged changes, you'll see something like

hardy gorge
#

You can also just list the status

gritty wind
#

Some of your changes must've been added, and the rest were stored away by the precommit

#

[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\Steele.cache\pre-commit\patch1606418810.

trim cradle
#

I'll have to look at this after my family does our Thanksgiving stuff. Thanks so far @hardy gorge @gritty wind

gritty wind
#

Have fun, and happy thanksgiving

cold moon
#

I found that forms-frontend also don't use Docker. Should I create Docker + Kubernetes there too?

lament hedge
#

for some unholy reason Pipfile.lock committed with some other files. Do I need to revert that or don't worry bout it?

surreal plaza
#

Can you guys help me out here?

green oriole
#

Hey @surreal plaza, see #❓|how-to-get-help, although this look like an assigment, we probably can't help you with that

surreal plaza
#

Thank you! <3

cold island
lament hedge
#

I don't think I did, but can't guarantee it didn't happen on accident

cold island
#

If you think you might have done something by mistake then it's probably better to revert it.

green oriole
#

If almost the whole file changed, it probably means that you locked with the wrong python version

cold moon
#

.issue 531

dusky shoreBOT
cold moon
#

Can any Core Dev give review to this?

patent pivot
#

I'll request the core dev team now

#

lol of course it just requests mark that's helpful

cold moon
#

@patent pivot Created PR to forms-backend for README

patent pivot
#

good structure, I'll fix some phrasing stuff and then it'll be good to go

cold moon
#

How will be new forms created and answers collected? Custom interface in forms-frontend, with plain API requests or even another like dashboard?

patent pivot
#

custom interface

cold moon
#

So there will be total 3 apps for forms: forms-frontend, forms-backend and forms-dashboard?

patent pivot
#

nah, custom interface inside forms-frontend

green oriole
#

ks is working on the forms but isn't in the event team smh

cold moon
#

Oh

patent pivot
#

I think the backend logic is in place already

#

ks maybe you should like

#

be in the insights team

cold moon
#

What team this is?

thorny obsidian
#

lol

green oriole
#

well, you didn't really had a choice, did you

patent pivot
#

the team working on forms and eventually insights (our version of DO currents or other dev surveys)

#

no one gets a choice!

#

my team my rules

green oriole
#

Hahaha

#

"You are mine now!"

thorny obsidian
#

The next code jam will most likely try to use whatever comes out of Insights/Forms

cold moon
#

😆

thorny obsidian
#

So yes, please more people on Insights

patent pivot
#

ks I think the logic for the admin stuff is already there

#
        user_details["admin"] = request.state.db.admins.find_one(
            {"_id": user_details["id"]}
        ) is not None
#

so if there is an entry in the admin table for a uid then they get an admin key in the assigned JWT

#

and the frontend will read that and display the creation UI

#

as with most react apps everyone will get access to the frontend UI if they play around with their console, so we'll validate it on the admin side (we can verify that we signed the JWT they submit with)

cold moon
#

I have seen one Vue app where all logic was in frontend and no validation in backend. Data that was finally submitted...

patent pivot
#

lol yikes

#

yeah we'll probably just write a decorator for it

green oriole
#

"Trust me backend, my will is good"

cold moon
#

Should I make PR to use to use GH Actions, Docker and Kubernetes for forms-frontend?

patent pivot
#

hmmmmm

#

not right now

#

we may still use netlify for production

cold moon
#

Oh, you will not use Kubernetes for this?

patent pivot
#

probably not

#

it feels a bit overkill, y'know?

#

it's a fully static thing

#

we'll use netlify or S3 or maybe even github pages

cold moon
#

Committed README PR suggestions

patent pivot
#

last review comments left, then it's ready

green oriole
cold moon
#

But is there currently something more to do?

patent pivot
#

backend is not there yet

#

I'll add it after dinner

green oriole
#

Fair enough

patent pivot
#

not yet, I can write up some issues after dinner

cold moon
#

👍

cold island
#

So I have an Expiry argument I want to make optional, and then give it a default value inside the function. Would I set it explicitly, or would I use the appropriate converter for it? doing it explicitly is not ideal in case the implementation of the Expiry object changes. But I don't know if it's acceptable to use a converter explicitly

#

Setting it explicitly would be duration = datetime.datetime.utcnow() + datetime.timedelta(hours=1), which works technically

brazen charm
#

Nothing wrong with calling the converter yourself

cold moon
#

Finally all code jams pages are migrated to HTML...

#

Only game jam pages left

#

Or actually, there is only 1 page

cold moon
crude gyro
gritty wind
#

Running into a bit of a conundrum here. I have a file importing classes from discord, and importing classes from constants. now the constants imports include guild, and the import I want is discord.Guild.

What is my course of action here:

  1. Make both explicit imports, and use constants.xy, discord.xy, etc
  2. Make just the discord imports explicit
  3. Leave the existing imports, and double up the discord imports so I can use discord.Guild
green oriole
#

Hmm, you could use as imports, something like a

import discord.Guild as DiscordGuild
import constants.Guild as ConstantGuild```or use dotted path for both
brazen charm
#

Both of those feel like they benefit from having the module name in front of them to me

gritty wind
#

Most of constants really could use that

#

I guess I'll do Akarys' suggestion and leave it up to reviewers

brazen charm
#

I don't like that too much, feels like discord.Guild and constants.Guild but with extra steps

sullen phoenix
#

i’d rather namespace it

gritty wind
#

It is, but the if we do go with discord.Guild and constants.Guild, do we do that for all the imports?

brazen charm
#

Probably, depends on what those imports are and how they are used

green oriole
#

The small issue is that this will feel disorganized depending on how the code look like

#

TBH, do whatever feels right

trim cradle
#

It looks like the help_channels.py file was deleted in the help channel refactor, even though _cog.py appears to be the spiritual successor to that file. What's the most git-thonic way to integrate my changes into that file?

brazen charm
#

So you have changes in help channels and need to merge master which removed it?

trim cradle
#

so I'm not sure what to do except figure out how different _cog.py is from what help_channels.py was before I made those commits and copy/paste them in.

#

doesn't git support continuity for a file if you move or rename it?

gritty wind
#

One idea would be merging into the head before deletion, updating the branch, and adding another commit to migrate to the new file

#

At least from a history perspective, things make more sense

trim cradle
#

I'm worried I'd make the history even more difficult to follow if I did that.

#

I might just have to make a new branch and try again.

green oriole
brazen charm
#

I'd probably just introduce the changes to the new file as a part of the merge

green oriole
gritty wind
trim cradle
green oriole
#

@gritty wind FYI we don't assign GitHub authors to PRs

gritty wind
#

oh

#

I assumed we did because the bot adds a need author tag

green oriole
#

We sometimes do if someone will walk the author through the whole thing

#

the status: waiting for author tag?

gritty wind
#

Yeah

green oriole
#

It is to communicate that changes need to be done by the author

gritty wind
#

Huh, the way I originally read it was "Author needed to take over"

#

Good to know

green oriole
#

That's pretty fair, I think the tags could deserve some little descriptions

gritty wind
#

Though, if the tag doesn't mean what I originally thought it meant, how does adding one for that purpose sound?

green oriole
gritty wind
#

I don't have statistics on how many stalled PRs there are, so I don't know how useful it would be

green oriole
#

Author needed to take over in what sense? Someone else should take over the PR?

gritty wind
#

As in the original author is no longer working on the PR, but their changes can still be useful

#

So a new author can continue fixing the PR for merging

trim cradle
green oriole
#

Right, this is so rare that I'm not sure if it would really be worth it

#

Yes Stel

#

Hmm actually it will only appear as one commit

tawdry vapor
#

It's not possible to "tag" a file as renamed in git afaik

#

It's just something git will automatically figure out based on how similar the file is

#

I remember having frustrations years ago when refactoring stuff

#

If the file is explicitly moved with git mv, and then edited significantly, git will still think it's a new file

#

It's just a fundamental way of how git was designed is what I read

trim cradle
#

I see

#

I've almost finished re-introducing the changes @tawdry vapor

#

though I have to leave now, so I'll have to figure out what the situation is with the automated checks later.

sullen phoenix
#

hey @gritty wind, could you also line up the spacing for the channel IDs?

#

i don't want to add another comment lol

patent pivot
#

git calls it a "rewrite", so a rename is a 100% rewrite to a new file (that's why you'll sometimes see like 74% similar etc. etc.)

gritty wind
#

Ouch, that was a bit of an oversight

sullen phoenix
#

it's all good

#

oh yeah

#

they should also be alphabetized @gritty wind

#

sorry lol

gritty wind
#

I'll do that, but perhaps that should be a comment on the thread too?

sullen phoenix
#

sure, i'll comment it

gritty wind
#

Its just staff voice chat and voice chat that need to be switched, correct?

#

or do the categories themselves need to be switched too

sullen phoenix
#

also the voice channels category, and the Channels class

gritty wind
#

(With the staff and voice chat switched)

sullen phoenix
#

give me a bit, currently eating lunch

patent pivot
sullen phoenix
#

i’m having a breakfast sandwich actually

#

eggs, sausage, bacon, etc. in it

patent pivot
#

nice

sullen phoenix
sullen phoenix
#

that would be cool

green oriole
#

But... that's just noise? lemon_glass

patent pivot
#

it's pretty noise

green oriole
#

I mean, we don't have some insane 10 second delays

#

It will probably always reply to the last message

patent pivot
#

this is true

gritty wind
#

Oh, i get you know

#

I should open an issue for refactoring both files after this then

#

Maybe later

trim cradle
#

Are all async redis cache operations expensive? I'm thinking it would be useful for the increment and decrement methods to return the new value.

#

Which would have the consequence of making them asymmetric with a[b] += c

sullen phoenix
#

all the others should already be alphabetized

#

oh nice, you already made the changes

gritty wind
#

In theory, yes, but:

change_log
announcements
python_news
...

like right above it

#
how_to_get_help
cooldown```
#

don't want to flood this channel though

sullen phoenix
#

oh lol, i didn't look there

gritty wind
#

It can be tackled later

sullen phoenix
#

sorry

#

yeah, that'd be a good idea then

#

sounds good

gritty wind
#

I think that git hook got sent before I pushed the submit button lol

cold moon
trim cradle
#

It's taking docker desktop a long time to restart. is that normal?

gritty wind
#

How long have you been waiting?

trim cradle
#

ten minutes maybe?

gritty wind
#

And is it the backend, or the container

#

Ok that’s way too long

trim cradle
#

and if I do docker-compose up:

    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.')```
#

might just reboot my whole computer

gritty wind
#

Was there a recent update or big change on your system?

trim cradle
#

not that I know of

#

but I have environment issues with pretty much anything I try to do

#

which I realize is a vague category of problems

#

not just for the bot, but in general.

gritty wind
#

Try rebooting then, and take it from there

trim cradle
#

alright

gritty wind
#

It’s a honestly a miracle docker even supports windows

trim cradle
#

I run all my work stuff via an ssh connection because I'm not willing to waste any more of my life trying to set up ML/AI packages on Windows.

#

I want the "run these apt get commands and do the pip install again, problem solved" experience all the time.

gritty wind
#

I’m sure there are more than enough people here that would love to get you dualbooting off their grandmas secret os recipe

trim cradle
#

but as it turns out, I still had to defragment the hard drive to create room for a new partition

#

not sure why that was still needed--I guess because I didn't use the secure wipe so there's some way in which that memory is still allocated, or something.

#

in either case, it probably would have taken over 24 hours to defragment at the rate it was going and I can't be without my computer for even a third of that time with school and such.

gritty wind
#

I feel ya, my laptop has practically become a desktop at this point because I refuse to go to the repair center

#

Did docker get its crap together?

trim cradle
#

@gritty wind yeah, looks like my changes are working now. I just need to figure out the automated checks and then I can fix the PR.

#

my changes to the bot, that is

gritty wind
#

Checks as in precommit hooks?

trim cradle
#

I think so

gritty wind
#

Ah, well I wish you luck

#

Feel free to ask if you run into any issues

trim cradle
gritty wind
#

Yeah that usually fails

#

Run again

#

And make no changes

trim cradle
#

it passed that time

#

weird

gritty wind
#

It changed it when it failed

trim cradle
#
Check Yaml...........................................(no files to check)Skipped```
#

I assume this doesn't matter

gritty wind
#

The thing in, after that it should in theory mark it as fixed and pass

#

Yeah that’s fine unless you were modifying something you expect to run on those files

gritty wind
trim cradle
#

what did the line ending thing even mean? is that the issue with Windows doing line breaks differently?

cold island
#

yeah

#

Windows uses CRLF, unix uses LF

gritty wind
#

It’s not a problem unless you ask the precommit to run on your entire project, I.e if you try to run lint

cold island
gritty wind
#

There’s gotta be a way around that lol

#

Ig I can manually turn off that check

cold island
#

probably, but I'm too lazy to do the required research lol

trim cradle
#
        claimant = self.bot.get_guild(constants.Guild.id).get_member(claimant_id)
        if claimant is None:
            log.info(f'{claimant_id} left the guild during their help session; the cooldown role won\'t be removed')
            return
#

is this useful to log?

green oriole
#

Yeah, it is

cold island
#

sure, why not

gritty wind
#

At some point we had also come to the conclusion that you can clone the repo using LF so it wouldn’t even face any issues

green oriole
#

It won't be triggered very often anyway

gritty wind
#

It does mean I have to commit twice like zig said, and from my editor that means running code analysis and limiting twice

#

Also it doesn’t work if you have staged and unstated changes

trim cradle
#

sigh. now the precommit check won't pass and running the check doesn't fix the line ending

brazen charm
#

You can set git to use lf for commits

trim cradle
#

I'll have to see if I can make pycharm use LF

gritty wind
#

Git already automatically uses lf, it’s the checkout and your editor that cause the problem

trim cradle
#

turns out pycharm has a toggle for that on the screen at all times

#

weird allocation of screen space

gritty wind
#

Funny enough, most editors I can think of do have it in the corner too

trim cradle
#

I'm not sure why running the check isn't fixing the line endings anymore

gritty wind
#

Do you have unstated changes?

#

(You’d a get a message about stashing if you do)

brazen charm
#

git will use native by default, setting autocrlf to input and eol to lf fixed the behaviour for me

#

Not sure if you need the eol set

trim cradle
#

I see; doing git add again fixes that

gritty wind
#

The default behavior is to commit with lf, but the issue arises when the editors automatically use crlf, which some do

gritty wind
trim cradle
#

In my workflow, git add is usually a formality

brazen charm
#

Try doing git config core.autocrlf input and see if it fixes it, having to rely on the hook to fix it is a pain with merges (and in general)

gritty wind
#

i see commits

trim cradle
#
Error: [flake8] D205: 1 blank line required between summary line and description
Error: [flake8] D415: First line should end with a period, question mark, or exclamation point
Error: Process completed with exit code 1.``` welp
gritty wind
#

Hm, why didn't that get flagged?

trim cradle
#

is it an objection to the commit message? or perhaps an earlier commit message?

gritty wind
#

oh right, the precommit hooks only run on the current staged files

trim cradle
gritty wind
#

Would be handy if the path was included

#

Try running pipenv run flake8 locally

#

Though it did fail flake on the last commit

trim cradle
#
PS C:\Users\Steele\development\projects\pydis\bot> pipenv run flake8
Loading .env environment variables...
``` Frozen on this step for some reason
gritty wind
#

There is no output while processing (unless you add -V). Did it take you back to terminal yet, or are you still on that step?

trim cradle
#

still on that step

gritty wind
#

For how much time approximately?

trim cradle
#

Presumably right around when you said "Try running pipenv run flake8 locally"

#

not sure how much of a delay there was

gritty wind
#

it only takes a few seconds for me, can you run it with verbose then?

trim cradle
#

sure thing

#

a lot of text happened and now it's idle but hasn't returned

gritty wind
#

If you can, dump it into the pastebin

trim cradle
#

!paste

gritty wind
#

I'm not necessarily seeing anything that should make it break

#

Wait yes I do

#

bot only has a 150 odd files

#

Why Checking 2832 files

trim cradle
#

should I be working in a subdirectory of where I am currently?

gritty wind
#

You should be fine running the flake command directly in your project root

trim cradle
#

that's where I am

gritty wind
#

I'm just not sure why there are thousands of files there

#

Perhaps logs or something?

trim cradle
#

let's see

#

I only have one log file

cold moon
#

For some reason, this don't load extensions

#

Maybe this don't load config too and lint like venv or such things

trim cradle
#

wow a lot of text is happening now

gritty wind
#

If you find where you have ~2k files within your project dir, you'll be golden

trim cradle
#

it's searching the virtual environment.

gritty wind
#

yikes

cold moon
#

This means that this don't load config

gritty wind
#

On an unrelated note, I went ahead and tried to commit your commit (the one that failed the action), and it passed both manual invocation of the precommit, and the actual precommit. It failed a manual lint

trim cradle
#

what does that mean?

gritty wind
#

So I checkout out your branch, and reset to the second to last commit. I then ran:

  1. pipenv run lint [passed]
  2. git commit [passed]
    (rollback)
  3. pipenv run flake8 [failed]
#

The workflow does step 3

#

So I'm guessing the precommit and the manual invocation of flake8 might be running two separate tasks?

trim cradle
#

I have no idea

#

I'll be right back

cold moon
#

pipenv run lint runs flake8 inside pre-commit

gritty wind
#

Yes, which is why its weird that produces a different result from running flake8 using pipenv run flake8 or activating then flake8

#

Ok, nevermind it does find the error, but the git hook still passes

#

and now it doesnt and it does, alright i give up

trim cradle
#

I'm not sure what to do

gritty wind
#

So I've done more testing, the exact same commit passes in:

  • My IDE (pycharm)
  • Github Desktop

It fails in:

  • git bash (mingw)
  • regular terminal git
#

I haven't been this confused in my life

trim cradle
#

looks like I may have more line break issues

#

so I'll have to run that fix recursively for the project

#

must be from pulling stuff from origin

cold moon
#

Can anybody link PR? I try to run this myself too.

trim cradle
brazen charm
#

Do you have a global flake8 install?

trim cradle
#

I don't believe that I do @brazen charm

gritty wind
#

Yes, but shouldn't it be running pipenv anyways (and we don't have extra rules, so even a system wide flake8 would fail)

cold moon
gritty wind
#

Finding them isn't the hard part

brazen charm
#

pycharm has a bug where its precommit doesn't activate the environment and just runs flake8 outside of it

gritty wind
#

Alright, I'll uninstall and test

brazen charm
#

I'd check that to make sure it isn't because of that

gritty wind
#

And now it can't find flake8

#

Well, it was that apparently

#

How do you get around it?

brazen charm
#

You have to manually patch the path

trim cradle
#
    async def unclaim_channel(self, channel: discord.TextChannel) -> None:
        """
        Remove the claimant from the claimant cache and remove the cooldown role
        if it was their last open help channel.
        """

It objects to the second line of this, namely the initial """

brazen charm
trim cradle
#

but it might be an objection to the docstring itself

gritty wind
#

Yeah that docstring should be one line, or three lines

trim cradle
#

Interesting

gritty wind
#

First line is always a short description, followed by a break, followed by paragraphs

trim cradle
#

now 217 files are modified because of the line breaks

#

sigh

#

I'll just have to delete my clone when this PR is done and try that again

brazen charm
#

Have you tried setting the autocrlf config?

trim cradle
#

for git itself? no

brazen charm
#

Try #dev-contrib message, it fixed the newline issues for me. I also set eol to lf but the docs say that's ignored hen autocrlf is not false

trim cradle
#

alright

#

I ran Numerlor's command, and I fixed the docstring

#
PS C:\Users\Steele\development\projects\pydis\bot> pipenv run pre-commit
Loading .env environment variables...
Check for merge conflicts................................................Passed
Check Toml...........................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Mixed line ending........................................................Passed
Trim Trailing Whitespace.................................................Passed
check blanket noqa.......................................................Passed
Flake8...................................................................Passed
#

does this mean I can commit then push now?

gritty wind
#

Did you fix the other annotations?

trim cradle
#

right. I need to make the linter exclude the venv directory

cold moon
#

When I run pipenv run lint in PyCharm terminal, I get both these errors

trim cradle
#

the only issue there is that it tries to fix line breaks in 200+ files

gritty wind
#

Oh thats safe to commit

trim cradle
#

but I don't want one commit to change 200+ files 😦

gritty wind
#

Numerlor's fix would require you recheck out the project

#

It won't, under the hood git converts everything to LF anyways, so it recognizes no changes need to be made

#

Just check the commit before pushing

trim cradle
#

so if I just go ahead and commit all those files (except the one that I actually changed), nothing will actually happen?

gritty wind
#

Assuming all the changes are line endings, then yes

trim cradle
#

alright

gritty wind
#

If you delete the local repo, then set global autocrlf, then reclone, this won't be an issue

trim cradle
#

I'll do that when this is done

gritty wind
#

Yeah, wise choice

trim cradle
#

pushed. Now we see if I get to not cry

gritty wind
#

I mean.. probably, but at least the line endings didn't get changed :D

#

flake8 passed

short snow
#

how does the aoc subscribe thing work, i saw the source but couldn't figure it out, like for every new challenge it pings.

gritty wind
#

The old one, or the PR?

#

In the PR, if you check the cog, line 88, it

  1. gets the time left
  2. sleeps that time + 1 second
  3. checks for the new puzzle up to five times
  4. send a role ping if it was found
  5. repeat for 25 days
#

The subscribe function itself just adds people to a list

short snow
#

thanks!

gritty wind
#

OS: Windows 10
Command: aoc leaderboard
Config: 631135 Last year's pydis leaderboard. If you need my cookie, lmk

Exception:
https://paste.pythondiscord.com/alafejusus.rust

Some of the unicode characters:
\u2b50, \u0142

This seems to be on the redis end, as it doesn't stop the program, and I can not catch an exception there

#

@hardy gorge

#

(in reference to lance#531)

#

oh right, fakeredis is True

#

Doesnt actually break the program, so lower priority issue

sullen phoenix
#

...it's a logging error? that's new

hardy gorge
#

Weird. It may be due to the encoding used for logging in Windows. Maybe it's using that windows encoding, not unicode.

#

Ah yeah, it's using cp1252

#

Hmm, worth looking into, but it won't hurt the feature in deployment

gritty wind
#

👍

hardy gorge
#

My guess is that it's going to occur for any logging statements that try to log unicode characters

gritty wind
#

Oh, good catch

cold moon
#

I will soon run this locally

gritty wind
#

I'm writing a conclusion on the issue, then closing

hardy gorge
#

I'll make some final changes. I have a few hours to do change stuff, but I also have to do a bit of work.

#

I only slept 2 hours last night 🙃

gritty wind
#

Ouch thats rough

cold moon
hardy gorge
#

Ah, yeah, coding is fun

#

@cold moon the comment is correct; it does check range(1, 25) (excluding the 25th, because we don't need countdowns on the 25th for the 26th)

#

The docstring and the comment are just not entirely consistent

cold moon
#

But I think then docstring should be changed

brazen charm
#

The file handler that's created for the logging will need utf8 set

#

Should be a simple fix as a kaizen

hardy gorge
#

@gritty wind I can't check it myself here on Linux, but could you check if the error is now gone?

#

I've added an encoding to the file handler

gritty wind
#

Yeah, it’s working as expected

#

I don’t think it should’ve necessarily been part of this PR but I’ll approve it for time’s sake

brazen charm
#

No need to create an issue and a pr for every little change

gritty wind
#

Agreed, but this is unrelated from the actual PR

green oriole
#

At worst, a core dev can push to master

hardy gorge
#

It's also a small change that falls within the kaizen allowance, I'd say

gritty wind
#

Either way, it’s in now

#

Who’s needed for review btw?

hardy gorge
#

I'm not sure. I think @sullen phoenix made himself code owner of everything, which means that he must approve or I have to merge using my admin permissions

#

There needs to be a second approval as well, I think?

sullen phoenix
#

lol

#

yeah, there should be

#

nope wrong channel

green oriole
#

We can change that

sullen phoenix
#

is the PR for the code owner review already merged?

#

ah nope

green oriole
gritty wind
#

This is for files that don’t have a code owner afaik

green oriole
#

We can just merge ves’ PR

mellow hare
#

I need to bribe someone to help me finish the code review guide

#

I just haven't had any time due to work

#

(and my self imposed hiatus last week)

thorny obsidian
#

What needs to be done for it?

mellow hare
#

Pretty much just the procedure part of it. Or the "How" as I have it listed

#

I've already did the who, the what, and the why

#

Started a little bit into the how and just got stuck

#

I've been using Akarys' template he gave me to work from (it's on the issue, I'll snag that real quick)

gritty wind
#

How long do you expect it to be

mellow hare
#

Length isn't the goal. I just want to make sure that it's clear and helpful for people brand new to the concept of code review

#

It can be as long or short as it needs to be as long as it gives someone a good idea of how to do it

green oriole
mellow hare
#

Oh derp right

green oriole
#

I could polish my comment, if that can help

mellow hare
#

Sorry

#

It'd help immensely. If you did that I could just rip it whole sale

#

Because what you have is incredibly solid

#

It just needs some polish

green oriole
#

Good lord, there are a lot of spelling mistakes in there

mellow hare
#

And I was also trying to give it the proper Hemlockisms

green oriole
#

Alright, I'll try to do that pretty soon

#

In fact

mellow hare
#

I really appreciate it. I feel bad that I'm having to push it off to someone

green oriole
#

!remind 16h30M polish the thing

stable mountainBOT
#
Yeah okay.

Your reminder will arrive in 16 hours and 30 minutes!

green oriole
#

Taking your own words

#

Life gets in the way

#

That's alright lemon_pleased

mellow hare
#

You are my hero

karmic frost
#

Hi is there a stats command like to do!stats the bot will answer all the uptime CPU storage

gritty wind
#

I think I misunderstood your original phrasing. If you are trying to implement it for your own bot, you'd have to implement it from scratch. There is no uptime, but that should be easy to implement using the time or datetime module. For hardware usage, you can use a library such as https://pypi.org/project/psutil/

#

Either way, now that I understand what you are asking, that question is indeed better suited for the help channels, sorry

hardy gorge
#

because I'm stupid

#

(the actual reason is that I initially converted them to int and did not think about it after removing that)

gritty wind
#

I was guessing it was something along those lines, anyways it isn't a big deal :D

hardy gorge
#

One of the background tasks has definitely failed (the status updater) and the other one, the new puzzle announcer, may have failed (although I hope it's still running). Regardless, both were a bit broken due to the deseasonification of @dusky shore. This PR should fix them.

gritty wind
thorny obsidian
#

Oh that's curious

gritty wind
obtuse arrow
#

That's me, btw. 🙂

thorny obsidian
#

You're just special @obtuse arrow

obtuse arrow
#

I'm number zero

#

That's better than one

sullen phoenix
#

lol, you have all of them solved, right?

obtuse arrow
#

Yep

sullen phoenix
#

yeah, iiinteresting

obtuse arrow
#

Could it be the nordic character in my name?

#

I don't see anyone else with non-ascii in the table, I think.

sullen phoenix
#

hmm

thorny obsidian
#

That's what I'm thinking

gritty wind
#

Who has access to the logs

hardy gorge
#

I have

gritty wind
#

Anything interesting in there?

hardy gorge
#

No

#

sadly

gritty wind
#

Hmm, I'll do some testing locally

sullen phoenix
#

i suspect it's redis having issues with that character

gritty wind
#

Welp, got a json decoding error

sullen phoenix
#

oh

gritty wind
#

It is not the ö

#

Reason still unclear

#

Issue narrowed down: it happens in lines 80-95 of _helpers

#

Its the loop that parses the raw leaderboards and assigns the stars

#

It parses correctly at first, but fails afterwards

#

Issue identified: repeated names

#

The second one has no stars

#

We have to store ids instead of names

cold moon
#

Looks like Ves changed it from IDs to names. This should be changed to IDs back yes.

gritty wind
#

I was half way through opening an issue, should I keep writing it, or will it just be patched

cold moon
#

Let's write it, but attach critical label I think?

gritty wind
#

👍

hardy gorge
#

We can patch it immediately

gritty wind
#

Welp, alright

#

Alright, I think I have a patch ready

jagged forge
#

Hey Admin, is it allowed here to share python GitHub projects?

gritty wind
#

This is specifically for the python-discord projects

#

If you want to share your own projects, check out the general and offtopic channels

jagged forge
#

cool 👍

gritty wind
#

Would it make sense to include the ID on the leaderboard too?

hardy gorge
#

I think that would just be noise

gritty wind
#

Alright... what do I do with my code now lol

#

I seem to possibly have write access to master

cold moon
#

You are not core dev

gritty wind
#

Which is why I'm confused

#

I might just make a paste and let one of you handle it from here lol

obtuse arrow
#

Ah, ok, so it was because I'm also in the old PyDis leaderboard?

gritty wind
#

No, you have two entries in the old leaderboard

obtuse arrow
#

On another account?

gritty wind
#

Yeah

obtuse arrow
#

Ah, right.

gritty wind
hardy gorge
#

@gritty wind Thanks. I'll create a patch from that. I'll change a few thinks to make the naming consistent (like name to member_id in that star result)

stable mountainBOT
#

@green oriole

It has arrived!

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

green oriole
#

Yes siiir

gentle harness
#

Chrome crashed when sending the new version, I am really sad

mellow trench
#

any specific reason snekbox requires Python 3.9?

gentle harness
#

Well, it allows us to run 3.9 code

mellow trench
#

ah

#

I didn't think of that lol

thorny obsidian
#

So I'm trying to create a custom cog-level error handler for a change to the AoC commands. I have it so that I can send the new error message, but the error still propagates through to the other bot-level error handlers. Is there a way to prevent that?

#

I only want the first one to appear, but I don't know how to stop the error from propagating through the handler

tawdry vapor
#

Try setting an attribute named "handled" on the exception

#

Never mind, that isn't checked by this bot

#

You can edit that to check for error handlers on the cog too

#

Or a custom attribute like @stable mountain does, which is more fine gained

gritty wind
#

That check specifically seems to be implemented on the global bot level using d.py, and there doesn't seem to be a direct override. I think you might be able to add an optional ignore parameter to the check itself, then decorate any functions you want to ignore

thorny obsidian
#

So I can't find an example in seasonal lancebot of the "on_error" being used to have a cog-level error handler, and my attempts so far to use it have not been successful. I feel like I'm missing something basic.

gritty wind
#

That on error seems to be specifically for the evergreen cog possibly?

thorny obsidian
#

For your potential proposed solution where you add an optional ignore parameter and then decorate functions, what exactly would that look like? I'm still a relative newbie to d.py

gritty wind
#

So a lot of the commands in that aoc cog have the @override_in_channel deco. What you could do is change the deco signature to accept a skip bool, which if true returns true, otherwise carries on to the rest of the predicate

#

I'm testing that right now

#

Any commands you'd want exempt from that check, would then get the skip parameter

tawdry vapor
#

I disagree

#

Seems reversed to how it should be

cold moon
tawdry vapor
#

Yeah I meant 404

cold moon
#

Okay, gonna make changes now

gritty wind
# tawdry vapor Seems reversed to how it should be

Well, the current way to override the global check is by manually using override_in_channel to add the channels you want to the allowed list. There would have to be a change on the in_channel_check level if you want to implement your own bypass functionality

#

The current iteration checks if the override_in_channel is part of the callback, so you could technically add a has error checker attr there

tawdry vapor
#

I thought it's just the message that needs to be changed

gritty wind
#

I thought the goal was to suppress the error propagation?

#

But I do agree about not using a skip parameter, I think a separate skip decorator might be better

tawdry vapor
#

Yeah, so a custom message can be used

gritty wind
#

Well, you could also have more logic than just a message

tawdry vapor
#

Maybe not for a custom message, but either way, the error can be stopped from propagating by adding a custom attribute that the global error handler will check for and skip if present. So it doesn't really stop it from propagating, it just makes it get skipped.

gritty wind
#

But I think I see what you're getting at

tawdry vapor
#

By reversed I mean that I feel that the handler should be modified, not the check.

gritty wind
#

Yeah that already exists with the hasattr on line 214

thorny obsidian
#

@eternal owl helped! It turns out I was missing something basic with how I was implementing it.

tawdry vapor
#

It doesn't work for cog error handlers, only per-command. Which I proposed to change

#

It's not really good anyway cause if a local error handler exists then it means it'd be responsible for handling all errors.

eternal owl
#

@tawdry vapor should we have the same way to check on both the bots if their is an error handler for that command/cog?

#

on @dusky shore we check if the command has the attr on_error but in @stable mountain we check if the error has the attribute handled

#

could we make it same on the both of bots?

tawdry vapor
#

Yes

#

Checking for handled is better

eternal owl
#

yep

#

Should I open an issue and a PR?

tawdry vapor
#

Sure

eternal owl
#

okay

gritty wind
#

Here's a counterargument: you don't want that global check to look for the error handlers, as they can be handling other errors, while that check is specifically responsible for one type of error.

#

Unless you get the error handler to propagate that error like normal anyways

eternal owl
#

The global handler will only handle errors which were not handled by the local error handler if done properly

tawdry vapor
#

Yes, that's why I am suggesting to check for an attribute on the error rather than looking if any error handler exists

gritty wind
#

Except the global handler as far as I can tell doesn't send the message about the channel being incorrect

#

Ah, I see

eternal owl
#

mark, can you look at the issue and approve it if right

tawdry vapor
#

The global handler doesn't control the message but it does propagate it

#

It has a condition to check for the InChannelCheckFailure exception

#

The check doesn't directly send a message; it just raises an exception containing a custom message

thorny obsidian
#

*grumble grumble* pre-commit hook is annoyingly helpful

eternal owl
#

its a pain on windows tho, it changes all my line endings in alll the files, thats why I just do flake8, lol

gritty wind
#

The hook itself should only run on changed files?

#

run lint would go over all the files, but not the pre-commit hook itself

eternal owl
#

oh yea, I meant run lint

gritty wind
#

Ah, yup

#

If you don't have any work saved right now, you could try setting autoctrlf

tawdry vapor
#

Change your editor to use LF and then you won't have problems

eternal owl
#

git still says that I have modified those files and have to commit them, lol

gritty wind
#

Yeah that would have to change in the autoctrlf setting

tawdry vapor
#

Your editor needs to be using LF and git needs to be checking out files as LF too

gritty wind
#

Git on windows by default checksout ctrlf, and commits LF

#

thus it tricks itself into thinking the remote repo uses crlf

eternal owl
#

lemme see

tawdry vapor
#

Just set it to false to disable it

eternal owl
#

where do I do that?

tawdry vapor
#

git config --global core.autocrlf false