-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: copilot project #144
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daabr
force-pushed
the
daniel/refactor-copilot
branch
from
January 5, 2025 05:43
474461d
to
144ee36
Compare
daabr
commented
Jan 6, 2025
pashafateev
reviewed
Jan 6, 2025
pashafateev
approved these changes
Jan 7, 2025
Co-authored-by: Pasha Fateev <[email protected]>
- Enable unit testing (except in the Purrr project - those UT require AK context) - Add various optional but important linters to Ruff - Don't pin pytest and ruff versions, no point in updating it from time to time like in the AK repo
daabr
force-pushed
the
daniel/refactor-copilot
branch
from
January 7, 2025 02:38
015dfee
to
8a8bf34
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes in general:
Fixes in
README.md
:GITHUB_ORG
Fixes in
autokitteh.yaml
:GITHUB_ORG
IDLE_USAGE_THRESHOLD
: changed debug values (10m) to stated default (72h)Replaced
helpers.py
withusers.py
(adapted from new Purrr, likehelpers.py
)Fixes in
users.py
compared tohelpers.py
:None
when a function declares that it returns onlystr
try
&except SlackApiError
, checkingresp.get("ok", False)
is never reached in case of an error (unlike our old Starlark wrapper)_slack_users
function: Python rewrite doesn't need recursion (unlike our old Starlark wrapper)Fixes in
msg.json
:Fixes in
seats.py
:prune_idle_seats
function is unnecessary - embedded infind_idle_seats
with a new input booleant
timestamp: renamed to be more self-describing (now
), but more importantly eset for each seat instead of using a single initial value (the loop should be quick, but may not be)status
line too line, split into 2 lines (readability is usually more important than efficiency)is_idle
tois_active
: results in flatter code at the bottom of the loop (if is_active: continue
instead ofif is_idle: ...
)seat_dict
: renamed, don't specify types in variable namesseat_dict
: changed type fromdict[str, Any]
todict[str, str]
- it's our object, no need to mimic GitHub's nested object structureevent_type
instead ofdata.type
match-case
instead ofif-elif-else
report
function: handle gracefully emptySLACK_LOG_CHANNEL
to enable making this project var optionalNote: we don't really need
autokitteh.start
, we could use the same trick as in the Slack sample project (embed important values e.g. GitHub/Slack user IDs in the interactive message and get them when the user clicks a button), but I guess there's educational value in showcasingautokitteh.start
.Fixes in
triggers.py
:on_schedule
function: print each seat on its own instead of the whole list - more readable_get_logins
function: renamed arg, don't specify types in variable names