#dev-log

1 messages · Page 100 of 1

regal archBOT
#
[python-discord/sir-robin] New branch created: pr\-cj\-patch\-role\-lock
regal archBOT
#
[python-discord/sir-robin] New branch created: cj\-change\-info\-embed
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Participants in our code jam have asked for a way to pin things in their channel. We can't reasonably give them the native Discord permission, but we do have bots. Let's use the bots.

This command should be usable by Admins, Events Team, and anyone with the Code Jam Participants Role. It'll let people pin/un-pin messages only in their team channel via the bot. This should work with a reply to a message and also a message link.

I figure one way to do this is have a wonky role-check-l...

#

We have bot commands for moving people between teams, but we use a manually-updated spreadsheet to figure out where to move them and who to replace as leader, etc. If we generated a view of the participants in the database we don't have to worry about maintaining two sources of truth.

Participants should be grouped into teams, and teams should be ordered by timezone. It should include whatever background info we have about each participant such as experience-level estimate, leadership pref...

regal archBOT
#
[python-discord/sir-robin] branch deleted: cj\-change\-info\-embed
thin oysterBOT
#
Sir Robin

Connected!

regal archBOT
#
[python-discord/sir-robin] New branch created: cj\-remove\-partc\-role
regal archBOT
#
[python-discord/sir-robin] New branch created: cj\-pin
regal archBOT
#
[python-discord/sir-robin] branch deleted: cj\-remove\-partc\-role
thin oysterBOT
#
Sir Robin

Connected!

regal archBOT
regal archBOT
#
[python-discord/site] New branch created: add\-cj9\-links
#

So, I always navigate to the events page and somehow miss the huge summer code jam duck banner on the index page.

I was missing the big green box linking to CJ9 on the Events page and I think we should keep this here for the duration of the event. Let's not make users hunt for content.

To that end I've also added a CJ9 link on the CJ Info page, which can be updated once the theme is finalized and announced. (I know it's not a "previous" jam yet but soon enough, it will be)

odd spireBOT
regal archBOT
#

In my opinion, if this command is ran outside of the code jam team category, it should silently fail. Sir-Robin has no reason to respond to this command outside of that context.

If it is inside the code jam category, then you can assume the user running the command has permission to pin the message, as no other users will be in those channels.

If we really wanted to be safe, we can still check that the user invoking the command is a participant, but it's not 100% needed with the above s...

#
[python-discord/site] branch deleted: add\-cj9\-links
odd spireBOT
regal archBOT
#

In my opinion, if this command is ran outside of the code jam team category, it should silently fail. Sir-Robin has no reason to respond to this command outside of that context.

If it is inside the code jam category, then you can assume the user running the command has permission to pin the message, as no other users will be in those channels.

If we really wanted to be safe, we can still check that the user invoking the command is a participant, but it's not 100% needed with t...

regal archBOT
regal archBOT
regal archBOT
#
[python-discord/sir-robin] New branch created: add\-cj\-add
#

In my opinion, if this command is ran outside of the code jam team category, it should silently fail. Sir-Robin has no reason to respond to this command outside of that context.
If it is inside the code jam category, then you can assume the user running the command has permission to pin the message, as no other users will be in those channels.
If we really wanted to be safe, we can still check that the user invoking the command is a participant, but it's not 100% needed with the...

regal archBOT
#

In my opinion, if this command is ran outside of the code jam team category, it should silently fail. Sir-Robin has no reason to respond to this command outside of that context.
If it is inside the code jam category, then you can assume the user running the command has permission to pin the message, as no other users will be in those channels.
If we really wanted to be safe, we can still check that the user invoking the command is a participant, but it's not 100% needed wi...

regal archBOT
regal archBOT
regal archBOT
#

That sounds like a great idea. However as of now, the Code Jam Management system does not store timezone information.
My main question regarding that is.. whether you want this spreadsheet-like view to be editable, or just read-only.
Being editable would mean, that we would have to interact with the discord API, and upon interacting with the spreadsheet it would edit the roles as well. This is the hardest version, at least in point of implementation.
The read-only version would just be a g...

regal archBOT
regal archBOT
#

Normally, you are able to use !docs for class methods (e.g. str.split) like so:

However, this does not work for Sequence and Set types (list, tuple, range, set, frozenset):

The most likely reason for this is because the documentation for them are formatted differently on the official documentation, they could be added as an edge case that uses a different check to search for attributes.

regal archBOT
#
[python-discord/forms-backend] New branch created: bump\-motor
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
regal archBOT
#

These two commands have an authorization issue and maaaybe another one too:

  1. The Events Lead cannot use &cj pin or &cj unpin (poor Kat)
  2. Any helper part of the Events Team can abuse &cj pin and &cj unpin to (un)pin any messages in channels Robin has permission to do so. I have no idea what permissions Robin will be given in the actual server during normal operations, but let's verify if not block this route entirely.
#

These two commands have an authorization issue and maaaybe another one too:

1. The Events Lead cannot use `&cj pin` or `&cj unpin` (poor Kat)

2. Any helper part of the Events Team can abuse `&cj pin` and `&cj unpin` to (un)pin any messages in channels Robin has permission to do so. I have no idea what permissions Robin will be given in the actual server during normal operations, but let's verify this won't be an issue (if not block this route entirely).

1.:The Event...

#

These two commands have an authorization issue and maaaybe another one too:

  1. The Events Lead cannot use &cj pin or &cj unpin (poor Kat)
  2. Any helper part of the Events Team can abuse &cj pin and &cj unpin to (un)pin any messages in channels Robin has permission to do so. I have no idea what permissions Robin will be given in the actual server during normal operations, but let's verify this won't be an issue (if not block this route entirely).
regal archBOT
regal archBOT
regal archBOT
#

I'm sorry, but some more changes are needed.

Technically the Events Team and Admins can (un)pin a message from a CJ team channel that IS NOT the channel the command was invoked in, but honestly I don't think this matters much and isn't a permission bypass (just confusing). So I suggest ignoring this unless someone feels very strongly. I'm kind of scared of making any more changes than necessary :sweat_smile:

regal archBOT
#

Both the pin and unpin command have a lot of duplicated code. IMO this tends to mean that it should be abstracted to a helper func, where the two commands just call this function with pin or unpin and the helper func does all this work in a single place. (see the help channel implementation.)

There also seems to be a very common pattern in sir-robin where we get a team, do some API error handling and then do something with the team.

IMO this fetching of the team and error handling shoul...

regal archBOT
regal archBOT
odd spireBOT
odd spireBOT
regal archBOT
regal archBOT
regal archBOT
odd spireBOT
regal archBOT
#

c6ec291 Use the view clear on timeout feature from bot-... - ChrisLovering
4148216 Include what version of Python was used in snek... - ChrisLovering
28d91d4 Update snekbox tests to expect new output - ChrisLovering
76caa09 Start 3.11 snekbox container by default - ChrisLovering
977b682 Merge pull request #2225 from python-discord/sn... - ChrisLovering

oak estuaryBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
thin oysterBOT
#
Sir Robin

Connected!

regal archBOT
thin oysterBOT
#
Sir Robin

Connected!

regal archBOT
regal archBOT
#

@akabinds Yes, that would be a welcome contribution. However, how to accomplish this has not been researched yet; that's probably where you should start. Maybe it should be an in-memory file system (tmpfs) rather than on disk?

Here is what I believe needs to be implemented:

  • Each eval mounts a new read-write directory.
  • It is initially empty.
  • It is set as the CWD for the eval.
  • It is isolated, meaning evals from other requests cannot access this directory (neither read nor write...
regal archBOT
regal archBOT
regal archBOT
#

@akabinds Yes, that would be a welcome contribution. However, how to accomplish this has not been researched yet; that's probably where you should start. Maybe it should be an in-memory file system (tmpfs) rather than on disk?

Here is what I believe needs to be implemented:

  • Each eval mounts a new read-write directory.
  • It is initially empty.
  • It is set as the CWD for the eval.
  • It is isolated, meaning evals from other requests cannot access this directory (neithe...
odd spireBOT
regal archBOT
regal archBOT
#

The Compose file uses some features of the spec only supported by Docker Compose v2, such as pull_policy. The contribution documentation and the Makefile currently refer to the v1 command, docker-compose. Under some circumstances, this can be aliased to v2, but it isn't guaranteed to always be the case. All references should be updated to use the v2 command, docker compose. An explicit mention of v2 being required for the command would be helpful as well.

#
[python-discord/site] New branch created: clarify\-websocketrule
odd spireBOT
regal archBOT
#

I like solution 2, as it seems like the most robust version. We’re not doing anything risky like generating the code from the spec, and we aren’t doing anything that’ll go out of sync. I don’t mind which library. For the GitHub pages aspect, it’s actually a very common thing to deploy the built docs from actions. There’s an action which abstracts 100% of the work, and pushes to a docs branch. We use it on botcore for the docs.

odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
odd spireBOT
regal archBOT
#

Okay, I was leaning towards 2 as well. In fact, I contributed to spectree to reduce the amount of dependencies it needs.

Can you go into more detail on the build process for GH pages? Would the action on snekbox build the docs and deploy them to the GH pages repo, or would there instead be an action on the GH pages repo to do this?

How would I avoid building docs if there are no changes? Would I need to put the spec file in version control for that? Is it even worth to try to avoid red...

#

How would I avoid building docs if there are no changes? Would I need to put the spec file in version control for that? Is it even worth to try to avoid redundant builds?

Do we even need to worry about that? If unsure what the performance of building these docs is, so we could just build them all the time, if anything in /snekbox is changed if it's only a few seconds.

#

Apparently redoc just needs a URI to the spec file. Everything else is generated by JS I guess. So, it comes down to

CI could generate the spec and then create a commit if it detects a change, but that feels hacky. Alternatively, it could just check if a spec needs to be regenerated without actually doing it, but it would be a bit tedious for the PR author to have to generate it.

And not sure in which repo the spec file should be.

night lilyBOT
#
Sir Lancebot

Connected!

regal archBOT
#

Looks good, I think you've got a nice structure with the flows here. Looks pretty clean and somewhat nice "separation of concern" behaviour (I say somewhat because it still passes ctx).

I do have an inquiry though, what happens if there's already a leader and we want this member to be the leader? This may be a question for the codejam management system.

As of now, there is no Code Jam Management support for that, but I'll definitely write that one up on the list, since it's impo...