-
Notifications
You must be signed in to change notification settings - Fork 0
Consistent Error Responses #48
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
Conversation
…Bubble up error messages
…hooks and handlers
…kEnvBuilder for building Rack environment and improve error response structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures the env
parameter is passed into all handler #call
methods, introduces a RackEnvBuilder
to centralize environment construction, and standardizes JSON error responses throughout the request lifecycle.
- Expanded handler signatures and updated all specs accordingly
- Added
Hooks::App::RackEnvBuilder
and replaced inline env construction - Unified error response format with structured JSON bodies
Reviewed Changes
Copilot reviewed 62 out of 33 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
spec/unit/lib/hooks/handlers/default_spec.rb | Updated #call to include env and added env fixture |
spec/unit/lib/hooks/handlers/base_spec.rb | Expanded #call signature in base handler tests |
spec/unit/lib/hooks/core/plugin_loader_spec.rb | Added env arg to plugin loader handler invocations |
spec/unit/lib/hooks/app/helpers_spec.rb | Added JSON parsing of error bodies and env arg |
spec/unit/lib/hooks/app/helpers_security_spec.rb | Adjusted error message regex and env param |
spec/unit/lib/hooks/app/auth/auth_security_spec.rb | Included request_context and env in auth tests |
spec/unit/app/rack_env_builder_spec.rb | New spec for RackEnvBuilder |
spec/integration/hooks_integration_spec.rb | Updated integration handler signature |
spec/integration/global_lifecycle_hooks_spec.rb | Updated lifecycle handler signature |
spec/acceptance/plugins/handlers/test_handler.rb | Added env to acceptance handler plugin |
spec/acceptance/plugins/handlers/team1_handler.rb | Added env to team1 handler plugin |
spec/acceptance/plugins/handlers/slack_handler.rb | Added env to Slack handler plugin |
spec/acceptance/plugins/handlers/okta_setup_handler.rb | Logged env and added env arg |
spec/acceptance/plugins/handlers/okta_handler.rb | Added env to Okta handler plugin |
spec/acceptance/plugins/handlers/hello.rb | Added env to Hello handler plugin |
spec/acceptance/plugins/handlers/github_handler.rb | Added env to GitHub handler plugin |
spec/acceptance/plugins/handlers/boomtown.rb | Added env to Boomtown handler plugin |
spec/acceptance/config/endpoints/does_not_exist.yml | New endpoint fixture for nonexistent handler |
spec/acceptance/acceptance_tests.rb | Enhanced acceptance tests to validate JSON error bodies |
lib/hooks/plugins/handlers/default.rb | Updated default handler signature and docs |
lib/hooks/plugins/handlers/base.rb | Changed base #call signature |
lib/hooks/app/rack_env_builder.rb | New builder class for Rack environment |
lib/hooks/app/helpers.rb | Expanded enforce_request_limits and load_handler |
lib/hooks/app/endpoints/catchall.rb | Switched to builder and standardized error format |
lib/hooks/app/auth/auth.rb | Enhanced validate_auth! with structured errors |
lib/hooks/app/api.rb | Replaced inline env build with RackEnvBuilder and unified error handling |
docs/instrument_plugins.md | Updated handler signature example |
docs/handler_plugins.md | Documented env parameter and usage |
docs/design.md | Reflected new #call signature in design docs |
README.md | Updated usage examples with env parameter |
Gemfile | Added ostruct dependency for specs |
No description provided.