refactor: Command Auto Syncing - #2990
Conversation
|
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/2990/head:pr-2990
git checkout pr-2990This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/2990/head |
|
@Icebluewolf Feel free to mark this as ready for review once you think it is ready, note the linter failing in the gh actions |
|
Do you think that #1745 could be addressed here as well ? |
|
I updated the gist in the description to include a test file I do expect to do some cleanup tasks as well |
|
I have not done extensive testing with sub commands, sub sub commands, and if Discord gives extra information that we dont care about (aka not implemented) in the payload. |
Paillat-dev
left a comment
There was a problem hiding this comment.
Yappi lgtm and the sooner we merge the sooner we bust potential issues or rollback if needed imo now that 2.8.1 is outa the way
Signed-off-by: Paillat <jeremiecotti@ik.me>
|
|
||
| from typing_extensions import override | ||
|
|
||
| from discord import IntegrationTypesConfig |
There was a problem hiding this comment.
Not sure we wanna import from discord here
Signed-off-by: Lala Sabathil <lala@pycord.dev>
Summary
This is ready but needs lots of testing.
I also need to check what the behavior is for undocumented fields in the payload from discord that may be added in the future. I believe the best option is to ignore those fields.
This gist (https://gist.github.com/Icebluewolf/1842ea5f7234ba40e5df18191bb135a0) contains 2 files. The first is where I developed the fix so that I did not have to make real API calls and is here for reference if someone wants to do the same. The second is unit tests for the new system. Both are very rough and messy sorry 🙃. This change needs to be tested extensively, so if someone sees test cases I missed or more test cases that should be added please let me know.
AI Disclosure: Single token auto complete. No LLM usage
This PR attempts to fix the long running issue with the application command auto-syncing system. Currently the system is over eager and preforms upserts on commands that do not need to be updated. The main culprit is incorrect default value checking. This PR implements a more robust and easily extendable comparison system for commands.
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.