#dev-contrib
1 messages · Page 39 of 1
Yep, it is a webhook category, it has been already disabled on bot, site and seasonalbot I think, so there is no duplicate with azure webhook @crude gyro
It's time for the relentlessness
Time to summon people!
Great, my discord has a js fatal error
@hardy gorge @glass pecan @bitter crown Can you review PR 679 - https://github.com/python-discord/bot/pull/679 - It's about adding remaining time of infractions if there is any
@hardy gorge Can I ask you to review PR 680 - https://github.com/python-discord/bot/pull/680 - unittests for the bot/utils.time.py
Ideally I would want only one of these PR to be merged first so I can add the remaining test for the new functions in PR 679
I can add the tests in either PR
And yes I'm very unlucky lol
There was one a while back that crashed the client if you put a space in the text input
Discord has come a long way from that..
Yeah that's what I'd advise
Prob something went wrong with the updates, I saw 14
Great, uninstalled, restarted, downloaded setup, ran it and got the exact same error
%appdata% - delete Discord folder did the trick
Discord please
@gusty sonnet I'll look at them, but I'm not feeling too well today. Maybe it'll be tomorrow morning.
I was trying to turn the current icon into a sticker but this doesn't work at all
trying to fill only the python looks weird
not filling it looks weirder
maybe bigger or brighter outlines?
this is the best I got so far
i like the first one
That could work
Now our messages are out of order
don't think the dashed lines fit there with a white background
I like the last one
I also tried painstakingly filling the pythons by hand with raster
but it ends up looking.. well, cheap.
A wider full outline could be nice I think, but the square sticker looks alright
the purple background is much better than white
yeah, I don't think we're seriously entertaining the idea of a white background
oh and here it is with photoshop stroke turned to 53px, because why not
looks like a level for Worms 2
@tough imp do you have that banner asset available to send me?
maybe if I stick one of those on the square sticker..
ill export it
although I do wish we had the psds available.
for everything
but iunno how we would do that
i was thinking that since we have learned a lot about some of discord's limitations and some of the conventions on resultions etc we've adapted i could put together a quick guide for the branding repo
like a list of things to follow
not a bad idea.
hey, hmm
we have 100MB file upload limit here because of boost level 3..
we could probably be using discord for psd storage
we'd have to whitelist it, though
discord's not terribly reliable
that's true, but sharing psd's is also not terribly critical
What if the shape of the background matched the pythons?
scroll up, lol
i think thats pretty good but it feels like its missing something
darker background? snow?
Round?
i think thats pretty good
the red banner looks nicer there
That does look pretty good
but maybe it works better when the ribbon is lower as it was, it gives a better uh space feel with the ends sort of wrapping around the snake
space feel
yeah i think thats nice af
:ok_hand: Added space-feel to the names list.
yeah true
yeah I like that too, let's keep it like that
almost makes me wanna stick the banner on the shirt, too
but I don't think that would work
Do they have restrictions on like the shape of sticker you can print?
no, not really.
Interesting
I wonder if it'd be worth doing unusual shapes as well
Although I guess it'd be annoying if the points were too small
Hah, that's right, I forgot about that
we should replace that sticker
it has an inferior hyperlemon with a short beard
this cannot be permitted
Haha
🖤
It's black, like my soul
these emojis are bad choices
the first one needs a bit more vibrant colors with that background imo, but I think that background also fits more although then it won't be the python color duo
and it's also just an image so not sure there too ¯_(ツ)_/¯
lemon (not staff)
yeah wtf is that
People keep thinking I can do things
And I can't do things
So now it's obvious I can't do things
it's annoying, please don't.
peoplle will keep asking 😛
Yeah, I guess
could have a role color spectrum in the infos
I wonder if akarys has the same problem, he said he was thinking of doing the same thing
I was gonna suggest muted colors for non staff but I feel like it'd look garbage
you can practically split the electromagnetic frequency spectrum in half and on the right you will have staff.
hey lemon, how agile are you feeling right now
on a scale of i wont look at your pr to i will look at your pr
hahaha
yeah I can look at it but I gotta reboot first
windows is killing me
and I'm done photoshopping
Haha, "how many standups are you feeling like?"
we put some polish on https://github.com/python-discord/seasonalbot/pull/327, its been a bit of a mess for how small of a feature it is so i think it would be great if we could move towards merging it
i think all the feedback has been adressed now
The elusive hundred-commenter
1:1 loc to comments
Haha
actually more like 1:2
im asking because i think it should be a fairly easy review and im afraid otherwise it will go stale because no one will want to go through the 100 comments once its not fresh in memory
@tough imp you got this running on the test server or something?
and i promised AG i'd help get it merged
like, can I play with it?
on my own server yeah
oh right you might not have access to the test server
you're not a core dev
at least not yet
okay invite me to your server then
we'll hang out
this gives me anxiety
is it a very private server
I don't reaaaally need to join, I just need a screenshot of the latest DM
because the one in the original PR description doesn't seem to match the code
I mean, none of the four
yeah sure i can do this
sorry i think id prefer to keep it a private server since there are some message exchanges between me and some irl friends
that's fine, I just figured you had an inert testing server with nobody on it
most people don't test on actual live servers considering all the garbage channels you need
I don't think we're meeting the attribution requirements for icons8
that bookmark icon?
Yes
where'd we steal that from?
It's linkware
hm.
font-awesome probably has one, maybe that could be used
this comes from scrag's feedback
rock solid
i mean tbh we could just make our own and host it on github or something?
although im not sure what constitutes as making our own
all our current bot icons are fontawesome
which also requires attribution
which we're probably not completely compliant with
but we're not hosting those anywhere either
they're just uploaded to the emoji servers
@woeful thorn @tough imp icons8 have some pretty unreasonable attribution requirements
maybe we should just not use them.
when it comes to FA attribution, it's covered by a pro license
and you guys have my seats
so you don't need to worry about that
not that FA as a service has seat management, but you get what I mean
let me rephrase: the perpetual kickstarter licenses don't have a seat limit
we could add the bookmark icon from fontawesome to our emoji server and just link directly to the discord-hosted emoji image URL.
which, yeah

That definitely works
@tough imp still here?
oh.
not ideal
try it with the thing
wait no
hmm
okay hang on
I'll fix it

weird. it's the same size, wtf.

you n eed that whole thing?
so you right click that and copy it
then paste it into the channel
then you click the preview, right click the full version of the image
and that's your CDN url
it's a weird proxy thing they do for all image embeds
I suppose so your IP never gets leaked
note that you need both width and height, and if the ratio doesn't match, it'll crop it
@tough imp try with this URL then:
and just adjust the width and height until it looks good
big url
i can hereby confirm that this will work
haha, the perfect test
@crude gyro all done but i cannot merge
Thoughts on these icons for voice state changed?
which one is better?
or both suck?
I think the second is better.
Also I need the ID for the admins voice channel please
id say the second
Thanks
@tawdry vapor admin voice is 500734494840717332
thanks
Here's the current Top 10! 🎄🎄🎄
--------------------------------------------
1) 4335 Starwort (11, 11)
2) 4281 WillDaSilva (11, 11)
3) 4254 smartspot2 (11, 11)
4) 4244 @LaughLax (11, 11)
5) 4236 asishm (11, 11)
6) 4232 Sedsarq (11, 11)
7) 4201 Luke Dixon (11, 11)
8) 4163 bijij (11, 11)
9) 4157 salt-die (11, 11)
10) 4010 Modelmat (11, 11)
Guys, apparently you can do some cool things with issue and PR template, can I try refactoring them and open a PR?
You're always welcome to open a PR or at least an issue for it. Worst that will happen is it will get closed
If you're really asking "is it worth my time to even try" then I don't know the answer.
@green oriole what are you thinking of doing with them?
they do need improvement, I don't like them at all.
For example, you can markdown a line so it doesn’t appear in the issue description, and use anchor node, and a lot of cool things
I don’t like them too, that’s why I’m thinking about refactoring them
we did it bois . its in
Should I be concerned if my lock file doesn't seem to match?
Did you relock?
All you should have to do to synchronize your environment is pipenv sync --dev
That will make sure you're using the same dependencies as specified in the lock file
(given that you seem to be using a non-docker route)
Yeah I re-locked, that's my issue
For some reason it added an additional dependency
Like when I synced before it showed 80 things but when I synced after the lock it showed 81 for some reason
No idea why
A package that have a new dependency?
if anyone wants a fun issue, check out https://github.com/python-discord/site/issues/316
It seems to be
Ah, yeah I see it
colorama seems to have been added
Oohhhhh, that's why, since I'm on Windows.. but wait it says win32 but I'm on 64-bit? Does that matter?
My brain ain't go so fast today
I guess it'd be a moot point so long as I don't commit the new lock, right?
Because the dependencies are still going to be restricted by the versions mentioned in the pipfile
But what happen if you check out the lock file on master?
Might overwrite it, then I just re-lock
I mean I haven't noticed any issues either way, I just thought it was an interesting quirk
I did notice that it seemed to update things further than the pipfile said they should, though
Or wait, maybe I need to remember what the ~= does first
Ah, no never mind, I misunderstood.
I thought the ~= restricted the versioning levels that you specified. So like requests ~= 1.2 would prevent you from going to 1.3
But no, just prevents you from going to 2.x
it locks you to "compatible versions" based on the specifier
~= 1.2.0 would stop you going to 1.3
Just tried to launch the bot and my VM pretty quickly froze up. Managed to kill the process eventually and saw this error a bunch of times in the site
django.db.utils.OperationalError: could not translate host name "postgres" to address: Temporary failure in name resolution
Maybe I just need to restart the container, but what the fuck was the freeze man
compose?
if your app doesnt start docker-compose will usually just try to start it again instantly, which makes things worse if you‘re waiting for something like postgres
maybe starved for io?
The containers were already up
It was just idle for quite a while (since last night)
I started up the bot and when it tried to connect to send logs my entire vm took a shit and froze for a good minute until I managed to kill the bot process
Restarting the containers fixed it
I just don't know why it froze so hard
@tawdry vapor would you believe me if I told you I mistaken the string converter factory as a class
i'm a nong sometimes
We could make it a class btw
since it's already got the actual structure of what an original-style converter has
You'd have to tell me how
gimme a sec
I didn't think passing parameters to init was possible with how class converters are typically done
Scragly! Review pls
Hey I have like 8 PRs open wanna review some 😄
class AllowedStrings(commands.Converter):
def __init__(self, *values, preserve_case = False):
self.values = values
self.preserve_case = preserve_case
async def convert(self, ctx, arg):
if not self.preserve_case:
arg = arg.lower()
if arg not in self.values:
raise BadArgument(f"Only the following values are allowed:\n``{', '.join(self.values)}``")
else:
return arg
cut the backticks to 2 for the purpose of showing
that's an old-style traditional converter
they have an instance-per-command so accept arguments
new-style converters would have convert as a staticmethod instead and you wouldn't make an instance, only specifying the class
Thanks
no probs
TypeError: Union[arg, ...]: each arg must be a type. Got <bot.converters.AllowedStrings object at 0x7f66e8056510>.
Yeah
Not sure where that is
yeah this is a known issue
shame
then we will have to go back to your method
sorry for mucking you around there
@tawdry vapor should we avoid strings in typehints due to ide's attempting to resolve them into types
yeah it would involve defining them up with the other converter i guess
something like
but if we don't care, then we can leave it
rgr
While you're here can you create a webhook in the dm log?
I'm not sure if I'll end up using it but better to have it available
@tawdry vapor is this better?
<!-- Describe how you've implemented your changes. -->
yea
and <!-- Outline the reasoning for how it's been implemented. --> for reasoning?
or you still feel that's redundant?
No I didn't realise it was intended to be for justifying implementation
But it does feel a bit like asking too much maybe
we have to remember the audience
it's a bit of extra effort perhaps, but it's good habit building
I agree I just hope it doesn't discourage anyone
that's fair.
That aside for a moment, yes I do think that is a better comment for it.
thanks
Hemmmm, guys.. Well, I.. Was working on the templates
bah if you want to check them out they are on my clone on the seasonalbot https://github.com/Akarys42/seasonalbot, I used some things to make text don't appear in the final issue, if for some reason you want to test them
i looked for an issue and found nothing
I wanted to write some things before to show them, my bad
lol and that's why you don't wait
good job finding the proper commenting though
most people wouldn't bother looking for a way
hmm, should we require discord username in the issue tickets 
like you've got there
could put it in the "did you" section after join the community
but it's extra effort for repeat contribs
No. If we need the name we could just ask, and we usually don't need the name as far as I know.
fair nuff then
Guys... This line break is bugging me 😄 https://github.com/python-discord/seasonalbot/pull/333/files#diff-6bbbbaf49258c5f6252cb684d47d16f4R34
shall we merge the subclass one then
boom
wonder how many PRs that's just put into conflict
hmm, i'm starting to think maybe the black styled imports wouldn't be a terrible idea
individual lines for each import
Oh that's the same then I believe
Man git is so dumb with adjacent lines sometimes
the changes are on separate lines yet it still says a conflict
Is it intentionally like that as a safety guard or something
no idea eh
i thought it wouldn't do it if it's adjacent
otherwise there'd be no point of the individual import style
one has TextChannel, the other has Bot
yeah on different lines
still weird
This one also dumb but more forgivable
lol
I dunno about git, but at least PyCharm recognises that the converters import is still the same line just with something appended
yeah that's likely a diff algo thing
it has the magic wand too
magic
which is sometimes awful but sometimes useful, like here
i feel like pycharm does have it's own little logical helpers when it comes to diffs
like i've seen pycharm be pretty smart with file renames when git couldn't
There's a git command to move (rename) files, which PyCharm probably uses when you rename a file
That way, git doesn't have to guess if it's a renamed or new file
git mv
I thought that git never actually commits that information
You can move in one commit, then completely rewrite the contents of the file in another
and it will no longer think the file was moved
I don't know then
To populate the submodule again in the new location the user will have to run "git submodule update" afterwards.
This is what it says when it messes that type of thing up
Guys, from bot.bot import Bot is the bot subclass right?
and it's especially dumb if you try to move while significantly changing contents
If someone gets a chance, please review this one
would be nice to have merged today
K think I took care of conflicts
yeah cause they shouldn't have been conflicts in the first place 😒
haha
except for 1 where it had additions on the same line that was understandable
or rather, was a new line added in the some position
It has failed on one of my PR, and the conflict was pretty weird
Like, it could have been resolved by itself
yeah
that's what marks saying too
hence why the unamused emoji haha
it's a bit silly sometimes
to be fair, i did see these coming
One thing I can give git credit for is that when it does merge without intervention then you can be confident nothing got mangled
insofar as the code isn't incompatible
but that's too much for a poor little diff tool
ye, it won't help cases where conditions have changed
but yeah it's not literally running the code to test, so i think that's a bit of an ask
I'm wondering if the decision to merge or not depends on its chunking heuristics.
I think it's reasonable to say "these lines are part of the same smallest chunk I can make", so check them manually
chunk is such a visceral word to me for some reason. got a real clear feel to it lol
Conflict can also arise from logical error being introduced (not just competing line diffs)
but git can't detect those
So, it just says "check for yourself"
which, to be fair, is better than it assuming
but maybe one day
AI powered differs
That's very close to AI powered programming algorithms
Guys, when you review a PR, should you always re-test it, even if someone already did it (I assume yes)?
Yes
Ye
Don't you guys think the bookmark emoji is a little weird now , it was way better size in the version i added ?
My Version -
Current Version -
TBH mine is way better , it provide pleasure to my eyes ;-;
I prefer the bottom one.
Not me ;-;
Oops sorry
also, there were attribution issues with the former.
Ooh it auto deletes ? or Lemon deleted it ?
I thought this channel was whitelisted
I deleted it.
There is an issue opened to auto-delete them
its just a 3 line addition , would love if it auto deletes
then solve the issue
It is harder than it looks I think
I don't think so, but we don't just want auto deletes for that feature
we want it for any feature that might be channel-locked
No it's not
m = await ctx.send(embed=embed)
asyncio.sleep(5)
m.delete()
ELA said timeout only
yep, I agree
I even included a link to the appropriated code
TBH agreed
I thought messages had a delete_after()
ctx.send has it
Ah okay
so @green oriole
all you need is to modify this line: https://github.com/python-discord/seasonalbot/blob/master/bot/seasons/evergreen/error_handler.py#L50
to use delete_after=10 or something
nothing else is needed. @clever wraith's 3-line solution is more complicated than it needs to be
Well, I wanted to left it for someone that wanted to do small contribs
I don't know if 10 is the right amount, but that's the right solution.
Sure , will do after i get back from tution
yeah I don't know. maybe 5 is too short, maybe 10 is too long.
7.5?
10 is perfect, message is lengthy tho
I think 7.5 might be better, and it does allow a float.
I don't think we need to wait 2 weeks for @clever wraith to return before making a 15 character modification, @green oriole, if you've got time just do it.
I am here for today only
I also didn't knew i will get a chance, just hope this laptop don't go away after i come from my tution
Well, if you finally can't, let me know
ok
@crude gyro i have a pr in that edits seasonalbot's error handler
i can just do it in that, it's within scope
it also avoids unnecessary pr conflicts
in-channel check failure
ah
not the command usage
@clever wraith don't worry about it, i'm slipping it in an existing pr that's already open
ok
If someone does get time for a review, the PR to tidy up the error handler is at:
https://github.com/python-discord/seasonalbot/pull/332
You should add Closes #307 in the PR description
there's a relevant issue?
i didn't notice, lemme read it
see if there's anything i missed
oh you made it
nice
lol all g, it's just the autodelete
i should double check there's no other error related issues
There wasn't when I wrote it
good stuff
@glass pecan I love you and I hate u, love more than hate but I cri
Now if I want to put tests for the new function in time.py should I open another PR? Lol
I was hoping one of them to be merged and I had some time to put the missing test on the other PR haha
I was looking at bot and it appears it makes calls to website to retrieve data, is this design decision so you are not doing async database calls and abstracting that out to website?
It's primarily because Django has a build in ORM which makes it easy to access the database for things we need
Does PyDis use one of Salt's bundled APIs for deployments, or did you write some little Flask server for it? I recall it being the latter, but I don't see anything like that on GH
I think that'd be Scragly question, but I don't want to wake him on the off chance he's FINALLY sleeping
I'm mostly curious because I'm using the bundled cherrypy api and it's a complete pain in the ass
but basically hooked up dockerhub webhooks to a very limited subset of the salt api
instead of exposing the salt api directly.
Oh, docker webhooks, that's a good idea
so then you have some small webapp running to catch those?
no, it is the salt api catching them, but it's configured to have zero rights except to apply those specific states.
and only when called by that webhook
it's locked up pretty tight.
then again there's like a bajillion APIs this thing has
yeah, hard to know anything about saltstack since the documentation is garbage.
yeah, no kidding
the way I did it was via cherrypy and PAM users
so the PAM users are locked to specific states they can apply
but the API is so.. weird, the way you call it is super specific and their official API client doesn't work most of the time
Howdy folks - I'm pretty weak on Docker. I'd like to make sure I understand something - the repo for python-discord/site includes the Docker container, right?
Okay, great. And would that include everything necessary to run the PostgreSQL DB as well, or is it going to rely on my own PG installation, outside of the container?
It includes everything
Alrighty, so far so good! I'm a little puzzled because I recently pulled the repo after being away from it since ~October, and I'm having some trouble with the "docker-compose up" command, which used to work for me. Specifically:
postgres_1 |
postgres_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1 |
postgres_1 | 2019-12-12 23:29:27.142 UTC [1] FATAL: database files are incompatible with server
postgres_1 | 2019-12-12 23:29:27.142 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.1.
It's because we upgraded pg
docker-compose down would nuke it, right?
Ah.
If you don't care about saving your old data just delete the container and run Docker compose again
Perfect, I should've figured out that your comment includes the Docker file from which the container is built was a clue!
So pulling the repo doesn't modify the container directly, is that right?
Correct
But I think the site container does use the source code that's on the host
Rather than copying them over to the container
It does
Which means if you want to pull changes you will not need to rebuild the container most of the time
You'll just need to restart it
Okay. So assuming nothing significant like software version upgrades of components and such, if it's just new code, the existing container should keep working.
Sweet, thanks to you both!
So what do "site_postgres_1" and "site_web_1" refer to specifically? Are those the names of individual docker containers? Just trying to get my head around this a bit better.
Yes, those are container names
Okay. One hosting the DB and one hosting the Django site?
okay, that sounds convenient.
Is this a known thing or is it more likely something unique to my setup?
web_1 | Starting in debug mode.
web_1 | Traceback (most recent call last):
web_1 | File "manage.py", line 163, in <module>
web_1 | main()
web_1 | File "manage.py", line 155, in main
web_1 | SiteManager(sys.argv).run_server()
web_1 | File "manage.py", line 136, in run_server
web_1 | self.prepare_server()
web_1 | File "manage.py", line 117, in prepare_server
web_1 | django.setup()
web_1 | File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
web_1 | apps.populate(settings.INSTALLED_APPS)
web_1 | File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 91, in populate
web_1 | app_config = AppConfig.create(entry)
web_1 | File "/usr/local/lib/python3.7/site-packages/django/apps/config.py", line 90, in create
web_1 | module = import_module(entry)
web_1 | File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
web_1 | return _bootstrap._gcd_import(name[level:], package, level)
web_1 | File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
web_1 | File "<frozen importlib._bootstrap>", line 983, in _find_and_load
web_1 | File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
web_1 | ModuleNotFoundError: No module named 'allauth'
web_1 | Starting in debug mode.
web_1 | Starting server.
...
site_web_1 exited with code 1
try rebuilding the container?
I tried to find a module named "allauth" to add to my environment (thinking maybe just a Pipefile oversight or something) but didn't see anything obvious, other than django-allauth which is already there.
I believe this is the new container, since I used "docker-compose down" first to wipe em out
(site) C:\ProgProjects\python-discord\site>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
postgres 12-alpine c8abd8e13a5c 9 days ago 146MB
squarelet_local_celeryworker latest dd080c52232b 2 weeks ago 1.47GB
squarelet_local_django latest dd080c52232b 2 weeks ago 1.47GB
squarelet_local_celerybeat latest dd080c52232b 2 weeks ago 1.47GB
squarelet_production_postgres latest 56afa7fa52d1 2 weeks ago 236MB
python 3.6 5bf410ee7bb2 2 weeks ago 913MB
nginx latest 231d40e811cd 2 weeks ago 126MB
site_bot latest d6833660b52c 2 months ago 300MB
site_web latest ddaac9abe2b8 2 months ago 305MB
bot_bot latest 2c3eb1647bc4 2 months ago 300MB
pythondiscord/site latest 16fe26949878 2 months ago 305MB
python 3.7-slim b5a7c089ece3 3 months ago 179MB
postgres 11-alpine 78b21f6420c0 3 months ago 71.9MB
redis 3.2 87856cc39862 14 months ago 76MB
postgres 10.4 978b82dc00dc 16 months ago 236MB
mailhog/mailhog v1.0.0 09b680955aed 2 years ago 19.3MB
I should have said "rebuild the image"
yeah the image is old
there were some new dependencies added which requires a rebuild
you can docker rmi 16fe26949878
then run compose up and it will build a new one
(I think that's the right ID)
Gotcha. So help me make sure I'm understanding correctly - wiping out containers doesn't rebuild their images...? I'm not very clear on image vs. container I guess, but maybe I just need to do some research on my own.
A container is an instance of an image
So removing and rebuilding a container without modifying its image only wipes out state data or similar, it doesn't "update" anything
Yeah
In the case of postgres, I guess compose saw you had a stopped container that already exist, which was named postgres so it thought it could use it
but when you removed the container it created it again, using the new image
Hmm, alright. How come it didn't do that with pythondiscord/site?
because the image's label didn't change
it's still just latest so as far as it knows your 2 month old image fits the bill
Oh, I see.
Which may be why using a latest tag isn't the greatest idea I guess
But the folks at Docker changed the tag on their library image
I think I'm with you.
Well what actually happened is that in the compose file we changed it to use 12-alpine
so docker saw you dont have that image thus it fetched it from docker hub
So containers are instances built from images; running docker-compose down caused my containers to be wiped out; subsequently running docker-compose up caused the containers to be rebuilt, but because the python-discord/site image tag made the image still look appropriate, it just rebuilt the container without updating the image
So if I get rid of this old image, where does the new one come from? Is it constructed from something within the repo or does it reach out and download it from somewhere?
The image will get built using the Dockerfile
if you open the compose yml you should see it point to a Dockerfile path
An image does get pushed to Docker Hub but that's only meant for production use (because the code gets copied onto the image).
Okay, I'll look at that. I appreciate your help!
@simple peak my bad, but that PR needed another test to be added and i forgot to remove the "needs review" label.
all good
it was either that merged first or the other one that added the time func
both are your prs
i figured since you worked on both, you'd be the best person to add the extra test
so went with merging the other first
hope that's ok 😄
Ah yes, either is fine
I was hoping one of them to be merged before the other, the order did not matter
Thanks again, now I can finally add the missing test

Oh
My god
I found out why unittests are failing
from bot import constants```
And wtf this is new
Im having problem with test_links as well py from bot.rules import links from tests.helpers import async_test
Weird
Say no links in bot.rules
So unittest in vscode is failing horribly and cant find tests in the folders after
ok this is just me being silly
Yep turned out I deleted the wrong stuff, please ignore me
Ok i'm done, @tawdry vapor @glass pecan @simple peak can I request a re-review on https://github.com/python-discord/bot/pull/680
@glass pecan sorry, thought you had added it, my bad. On mobile so didn't dig into the commit history.
@simple peak all g mate, just wanted to give a heads up first 🙂
if anything i felt bad because i left the darn label up lol
I'll let you merge, plane is about to push from gate lol
have fun
i have this very weird idea . what about bookmarking something with a reaction ? a new reaction
downside. allow reaction everywhere
Going home yay
@green oriole wdy think ?
Ty @glass pecan @simple peak
thank you for the work
Not sure if it would be that useful
And I'm not from the staff, I can't tell you if something could be implemented or not
It make bookmarking easy tho
@glass pecan I think it is intentional, but just to be sure, my clone of seasonalbot isn’t a fork, it is detached from pythondiscord/seasonalbot, is it what you wanted?
An autofork? Well, thanks github haha
yeah if you hit the edit button you can create a fork if you don't have edit access
Even if you don’t commit your changes, it fork it nonetheless ?
pretty sure saving the change just makes a branch on the new fork
don't remember exact details though
Hmm strange
That's what it does, yeah
BTW scragly, have you took a look at the non-docker guide?
if anyone's desperate to review some PRs on this fine evening, worry not for i got your back with a juicy one 
please
Mmh the max attachment number is hard-coded, as we have a config entry for it
Any special reason?
Because if we change the config, we'd need to update the test, which make the config kind of not useful, right?
i'm sorry, what do you mean? im providing my own config precisely so that the test is self-contained
the rule's behaviour depends on the config, so i need to control it to test the behaviour
I mean, if we ever change the config, for example we up the limit to 10 attachment, the test will fail, it defeat the purpose of a configuration file then?
Anyway
im not sure if i follow
the filter always uses the config you pass it explicitly
so the test will not fail because the test has its own config
Yeah, but the test config is hard-coded, so it would make us change the config in two different places
we dont need to change both
the purpose of a test is to test that it fails at the number we tell it to fail at
not specifically at "10" or whatever number used in production
Okay I get it, thanks for taking time to explain
what does this mean, exactly? this None? https://github.com/python-discord/bot/blob/10a39501a0835d860188c4605e9dd0f41a28549b/bot/cogs/sync/syncers.py#L180-L184:
Returns: Tuple[int, int, None]: A tuple with two integers, representing how many users were created (element `0`) and how many users were updated (element `1`), and `None` to indicate that a user sync never deletes entries from the API.
or what's the convention behind "to indicate that a user sync never deletes entries"?
Without looking at the code iirc there is another method that returns something else for the third element
And both the return values are consumed by a single function so the return value had to be in the same format
got it, thanks
It is driving me crazy!
remote: Permission to python-discord/snekbox.git denied to Akarys42.
fatal: unable to access 'https://github.com/python-discord/snekbox/': The requested URL returned error: 403```
I should have access to snekbox right??
I can access my private repos but not PyDis' repos
It's probably just a mix up in the permissions
I think you'd have to bug one of the owners about it. Maybe admins can fix it too
Oh wait no, I don't have access to the repo
Okay okay
Cheers
So, if an owner or an admin is here, can you please add access to contributors of snekbox?
Hey @crude gyro, are you here?
Thanks!
try now @green oriole
It worked, cheers
Owww, is it a compiler problem? https://dev.azure.com/python-discord/Python Discord/_build/results?buildId=4960
hmm.. we are installing it in the dockerfile.
we are using alpine for it, though
which has been problematic in the past.
yeah I'm not really sure, I guess the alpine gcc install just isn't doing the trick
I think the easiest solution for you @green oriole is to just make an issue explaining this and then remove the package that's failing due to gcc from your PR
Okay
sorry but, which package is failing? Yaml?
Oh wait
a lot are failing actually
Forbiddenfruit, numpy, pandas, pendulum
looks like maybe scipy too
hmmm
okay well if the scale of this problem is that large, we may need to just fix the problem
but I'm not sure exactly how. I'd like to hear @tawdry vapor and @glass pecan's take on it.
just mention them in your PR and describe the issue, and I'm sure they'll chime in when they can
Oki
Could just switch to debian like the other containers
Debian have gcc pre-installed right?
Well, alpine doesn't actually use libc
So gcc is going to be inherently different
But yeah the debian python images have everything you need
I think gcc is aliased to clang actually on alpine but I'm really not sure
yeah, switching the image to what we're using in the others is prooobably the right solution
@green oriole @crude gyro @molten bough yes we had planned to migrate the base image to a debian based image, same one we use for the other projects now. This is a good reason to flip sooner than later.
Yes switch to debian
what would be the most convenient way to drop/reset the entire DB in the Docker container? what I actually need is the bot to forget every (synced) user and every infraction
There's a separate Postgres container; if you remove/rebuild it, you'll get a clean database
Are you on Linux?
yes
Do you use the bot-only docker-compose or do you use site+bot?
that's a good question because I know nearly nothing about Docker, I would say it's the first case... you mean site as website?
I never set up the website
it seems it's just running the PostgreSQL server and the bot
Starting bot_postgres_1 ... done
Starting bot_web_1 ... done
Starting bot_bot_1 ... done```or maybe not
or does it try to start them anyway?
the web_1 log messages are there POSTing and GETting
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
89388528f8eb bot_bot "python3 -m bot" 18 hours ago Up 4 minutes bot_bot_1
1ea068e12978 pythondiscord/site:latest "python manage.py ru…" 2 weeks ago Up 4 minutes 127.0.0.1:8000->8000/tcp bot_web_1
7fd84dd25b34 postgres:12-alpine "docker-entrypoint.s…" 2 weeks ago Up 4 minutes 5432/tcp bot_postgres_1```they seem to be running too
oh
I understand less about Docker now
took me a while and had to come across with several concepts but I got it, thanks Ves
yes, in a nasty way probably
I had to understand there are containers and images
but the process was way too slow for what I'm doing so I'll see if I can connect to the DB directly and remove what I need every time... or maybe from the bot itself
sorry, I got distracted
no worries, you're not obligated to help me and the longest path is sometimes beneficial too lmao
i know matplotlib can be supported with snekbox too @green oriole
I mean, how do you display the graph? There is no feature for it yet
@clever wraith That has indeed be discussed, but there's currently no support for getting images out of snekbox; that means it's a larger change than just adding a few third-party packages to the requirements.
Was also wondering, would it be possible (feasible) to link snekbox to a paste service to get text files from?
That would not be that difficult to add to the bot (snekbox does not have to be adjusted). The bot "just" sends the code that needs to be evaluated to Snekbox using an API, so it could fetch the raw paste and send that.
That means it could just be a bot command, snekbox itself wouldn't care
Oh, that seems like a good idea
So the bot could go to a paste.pydis url, fetch the text, pass it to snekbox with some code that uses it?
That does sound good
Yes, there's even a "raw" endpoint variant of the url
The only downside I see is that a paste can have a much larger size than a single Discord message, but we could check for that
We could still use a sensible size restriction
The paste site already has one, doesn't it?
You mean a size restriction? Probably.
It does have an upload restriction from bot -> paste
I mean the reason you'd want to use a paste site would be to get past the character limit, surely
Isn't that the upside of implementing this? To make evals on more code, while keeping the codeblocks small
Yes, but I don't want to bounce pastes of several MBs around from people who deliberately want to spam the Snekbox API (and the bot)
So, a sensible size restriction, not a restriction equal to Discord's message limit
That is a massive amount of text, I'd be surprised if even the paste site supported it
Oh, that's right
Anyway, it would be a simple check. Just restrict it to a sensible kb size and it should support everything we'd ever want to eval from a paste
The paste site issn’t already limited in size?
It is
Do you remember how much ? Could it already a good limit for the eval, since linode server have crazy fast internet input (40Gb/s or something)
100MB maybe
There is a limit in the source for the snekbox cog
In the paste upload function
Is that for the paste site itself or for the bot uploading something to the paste site?
The latter I suppose
Right. I was more thinking about that if we're going to implement something that evals a paste site, we should have a limit on how much input we allow from the paste site as well
So the 100MB limit seems enough?
It's actually less
There is also a character limit
1000 if I read my old code correctly
The server sets a request limit of 100MB too though so anything past that will have the request fail right away
Otherwise the whole thing is uploaded before it would return 400 for too many characters
Okay. In this case, do we want our bot to fetch 100 MBs worth of paste to send it off to snekbox? I think that's a little excessive and not entirely necessary. Who needs to genuinely evaluate 100MBs worth of code with our snekbox?
I was thinking more of it as a normal read file for longer strings to be processed but guess the input will achieve the same with a bit on top. A few thousand normal lines should fit into 1MB so IMO around that would be a good limit
Could be a bit higher
5MB, 10MB sound reasonable yet generous
I think it should support any site not just ours
Nvm maybe
I don't think we can know how big a download is before it's downloaded
I suppose it abort once it sees too much data though
depending on how close the new paste it, could have an info header on the files if it isn't something like that already
Yeah it actually might have the content length header
If not then I think it's fine to waste downloading a few MB only to find it to be too large in total
So I'm playing around in the aoc cog to see if I can make some headway along the lines of these issues:
https://github.com/python-discord/seasonalbot/issues/321
https://github.com/python-discord/seasonalbot/issues/325
They haven't gotten much activity though, am I in the clear to PR if I get something working? Or should I clarify my issue first? I know it's a lil fuzzy.
Ah, if you want to work on them, you can certainly drop a message to get them assigned to you
If you want to ask anything about them ( clarifying what this does what in the cog / in the bot ) you can ask here or in the issue
Getting PR to fix them is much better than nothing!
It's a formality to ask to be assigned but I can save you the trouble so you can go ahead and assign yourself to those if you want to start working on them. @past falcon If you don't have permissions to assign yourself let me know, but I think you should
Well, not exactly a formality. We do it so we don't have 2 people unknowingly doing the same thing.
I would ask the folks who opened the issues first before self-assigning
Cool, yeah I can self-assign. Well one of the issuers is myself (Skaft), so I can take that at least. I'll ask Lepto
Oh yes good catch
With the new templates coming up hopefully this won't be a consideration anymore since it'll be explicit
good catch? because he knew the name of his own GitHub handle?
seems like pretty much the least goodest catch ever
good catch lemon.
good catch as in I did not consider that the person opening the issue may be interesting in working on it
I misclicked and edited https://github.com/python-discord/bot/issues/553 by accident
how the heck do I revert that :(
I'm really dumb
ok got it
Guys, what are you thoughts about it ? https://github.com/python-discord/snekbox/pull/51#issuecomment-565949455 Would you need bs4, toml and yarl, and would you like to have demo files during evals?
?
creating a issue . its not fixed yet i think
Well, open it, no need to paste the link without any info here
i did cuz am on phone and had no where to temp paste the link .
Please.. don’t
There is various note app outta here, you probably even have a stock one
ok
You are missing a lot of information on your issue, look at this one for example https://github.com/python-discord/bot/issues/676
you should provide screenshot on how it work right now, and how it should work
I mean, you are still missing some critical informations, like why we should change it
And your code block is missing some line break
Also, use markdown heading do delimit your sections https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax#headings
Create sophisticated formatting for your prose and code on GitHub with simple syntax.
Your codeblock doesn’t work, you should use the same syntax as in discord
!codeblock
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```python
print('Hello world!')
```
Note:
• These are backticks, not quotes. Backticks can usually be found on the tilde key.
• You can also use py as the language instead of python
• The language must be on the first line next to the backticks with no space between them
This will result in the following:
print('Hello world!')
forecast says Scragly won't be online for a few days and I don't want to get this stalled, so I'd like to know if any core dev would be up to _pre_view my early but working code and give me some hints
or maybe I should finish it and do a PR and get a proper review there? but I'm not entirely confident on this
Sometimes it can be helpful to open a PR early - that's what I usually do
you can mark it as a WIP when you open it
then it's easier to get feedback
oh okay thanks
just open a Draft PR
is it okay if I leave some TODOs? they're not many but they're there in my fork
for a draft PR, you can leave whatever you want.
no problem. then just ping furiously until someone reviews it when it's live
As you're here @crude gyro, what is your opinion about this https://github.com/python-discord/snekbox/pull/51#issuecomment-565949455
did you get someone to look into the issue with the builds here?
Yeah, mark updated the image, now everything install fine
Okay cool
Just a little note @long garnet, if you say Closes #XXX instead of Address #XXX the issue will be closed when the PR will be merged, which avoid having unclosed issue all over the place because someone forgot to close it when the PR was merged :)
ah, I assumed something like that, thanks
GitHub features are not totally obvious to me, there are things that do stuff and don't follow obvious design patterns
The list is here if you wanna know https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords
You can include keywords in your pull request descriptions, as well as commit messages, to automatically close issues in GitHub.
Github is pretty dumb anyway
It is pretty stupid too haha
The worst is to suggest modifications of a code in a review
Do like if you would select the little plus square, and drag it down
🤷♂️
I also can't select all of it because there's a space in between
I think maybe you can shift click too?
Yes
Hey, that's git fault this time
and shift clicking is one of those nice intuitive design things
thanks
Hmm, didn't know you could do that, thanks
and shift clicking is one of those nice intuitive design things
oh yeah, I didn't notice the remaining code was sliding down
I thought it was disappearing
well, no
I can't select that else because it's not part of the diff
😐
You can't slide across or select the other part too?
In the same comment? It should show up then
yeah you can't review stuff that's not in the PR
_(Which is quite stupid) _
not sure I agree
reviews for a PR should be about the changes in that PR, not about stuff that person didn't even write
that doesn't mean the refactor has to be limited to exactly those lines
I mean, it could be handy to be able to select it too
Whats ROCKSTARS_ROLE ?
Refactoring multiple lines aren't allowed anyway
@Python Community, but with the old name
@clever wraith an anacronistic name for the <@&458226413825294336> role.
👍
How do you put color on not mentionable role?
nope
With the ID? Oh yeah okay nice well
I forgot it , i used to do that
<@&267629731250176001>
OOPS
my bad, I guess, since I didn't explain it well enough before you decided to test with live ammunition
My leg...
you ran so fast cuz of the tag ? @mellow hare
No, you shot him with live ammunitions
Aka gets it
Fire In The Hole!
well, I'm done fighting against GitHub
anyone who wants can review it, trash it, spit on it
We're constructive in our criticism
701, Python
I liked that PR , actually ;-;
(You can put py in the first line of the codeblock too to have syntax coloration)
We do use converters, but this is another issue we have.
there isn't a Converter for absent users that aren't in the DB
To register an infraction in our database, the database needs to "know" the user
So, if we want to give an infraction to a user that has never been here, we need to fetch a bit of basic information and add that to the db
Got it
The new custom converter tries to do that, which also validates if the user id is a valid one (since otherwise the fetching will fail)
So.... What's up?
Yay eivl! Can’t wait to watch you helping people again!
Cool to know, I'm on sick leave so I'll be back soon 😊
Have a nice rest then!
@tranquil topaz https://tenor.com/oEba.gif
I had like 10 whoopsies already in the repo, and they will be there forever in the logs
We all have that. Comes with figuring it all out
cough cough i had 100+
Not the first, probably won't be the last
That one was quite funny https://discordapp.com/channels/267624335836053506/622895325144940554/647565776815128598
Once all of them will be resolved https://github.com/python-discord/snekbox/pull/51, https://github.com/python-discord/bot/issues/676 and https://github.com/python-discord/bot/issues/699, would we get an announcement about the snekbox changes?
Yes. I was supposed to announce the upgrade to P3.8 last week, along with a few other things, but I'm recovering from sickness, so I've delayed it by a bit
I'll write something up this week
We upgraded to 3.8?

