-
Notifications
You must be signed in to change notification settings - Fork 633
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
Enhancement: Apply Repository Settings on Every 'Synchronize' Event #511
Conversation
PR Analysis(review updated until commit a043eb9)
PR Feedback
|
PR Code Suggestions💡 Suggestion: Consider checking the return value of File: pr_agent/servers/github_app.py (133-135) Example code:Existing code: apply_repo_settings(api_url)
if not get_settings().github_app.handle_push_trigger:
return {} Improved code: if not apply_repo_settings(api_url) or not get_settings().github_app.handle_push_trigger:
return {} 💡 Suggestion: Consider handling the case where File: pr_agent/servers/github_app.py (138-139) Example code:Existing code: before_sha = body.get("before")
after_sha = body.get("after") Improved code: before_sha = body.get("before")
after_sha = body.get("after")
if before_sha is None or after_sha is None:
log_context.error("Missing 'before' or 'after' in the request body.")
return {} |
@zmeir @okotek The issue raised in: It's not ideal to read the configuration on every push. But currently the feature, and our instructions on the README, are not valid. |
/describe |
PR Description updated to latest commit (a043eb9) |
PR Description updated to latest commit (a043eb9) |
LGTM. I can't think of a cleaner way to handle this. The only other option I can think of is to just explicitly state in the README that this feature can only be enabled/disables via the global settings. But then what's the point of having it anyway? |
Persistent review updated to latest commit a043eb9 |
1 similar comment
Persistent review updated to latest commit a043eb9 |
…push Enhancement: Apply Repository Settings on Every 'Synchronize' Event
Type
Enhancement
Description
This PR modifies the handling of the 'pull_request' event with 'synchronize' action in the 'github_app.py' file. The main changes include:
PR changes walkthrough
1 files
github_app.py
pr_agent/servers/github_app.py
The 'handle_request' function has been updated to apply
repository settings on every 'synchronize' event. The check
for the 'handle_push_trigger' setting is now performed after
applying the repository settings.