Skip to content

Log review gate config failures - #67

Merged
chihsuan merged 2 commits into
mainfrom
auto/RSM-3793
May 22, 2026
Merged

Log review gate config failures#67
chihsuan merged 2 commits into
mainfrom
auto/RSM-3793

Conversation

@chihsuan

@chihsuan chihsuan commented May 22, 2026

Copy link
Copy Markdown
Member

Context

Review-agent config errors silently disabled the pre-push review gate.

TL;DR

Log expected review-agent config failures instead of swallowing every error.

Summary

  • Narrow review-agent and tracker config rescues to expected config errors.
  • Log explicit review_agent_config_failed and tracker_config_failed messages.
  • Preserve enabled and disabled review-agent behavior for valid config.
  • Add focused tests for config errors, bubbling, tracker logging, and env cleanup.

Alternatives

  • Fail closed on review-agent config errors, but this keeps existing fail-open behavior with visibility.

Test Plan

  • make all
  • mix test test/symphony_elixir/orchestrator_status_test.exs:2239 test/symphony_elixir/orchestrator_status_test.exs:2265 test/symphony_elixir/orchestrator_status_test.exs:2280 test/symphony_elixir/orchestrator_status_test.exs:2304
  • mix specs.check
  • make check failed locally: MCP Unix socket open returns :eperm, causing MCP/AppServer socket expectation failures.

Summary:
- Narrow review-agent and tracker config rescues to expected config
  exception shapes.
- Log review_agent_config_failed and tracker_config_failed before using
  the existing disabled or unknown fallback.
- Add focused orchestrator tests for enabled, disabled, expected
  config failures, unexpected exceptions, and tracker fallback logs.

Rationale:
- Config mistakes should not silently bypass the review-agent gate.
- Expected config errors keep the current fail-open behavior with an
  explicit log, while unrelated runtime errors still bubble.

Tests:
- mix test test/symphony_elixir/orchestrator_status_test.exs:2239
  test/symphony_elixir/orchestrator_status_test.exs:2265
  test/symphony_elixir/orchestrator_status_test.exs:2280
  test/symphony_elixir/orchestrator_status_test.exs:2294
- mix specs.check
- make check (fails: MCP Unix socket open returns :eperm in this
  environment, causing MCP/AppServer socket expectations to fail)

Copilot AI left a comment

Copy link
Copy Markdown

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 makes review-gate and tracker configuration failures visible by narrowing rescues to expected config-related exceptions and emitting explicit error logs instead of silently failing open.

Changes:

  • Log tracker_config_failed when reading/normalizing tracker kind fails with expected config exceptions, while still returning :unknown.
  • Log review_agent_config_failed (including repo key and optional issue context) when review-agent settings fail with expected config exceptions, while still returning false.
  • Add tests that assert (a) valid configs do not log, (b) expected config failures log + fail open, and (c) unexpected exceptions bubble.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/symphony_elixir/orchestrator.ex Narrows config-related rescues, adds targeted error logging, and threads issue context into review-agent enabled checks.
test/symphony_elixir/orchestrator_status_test.exs Adds regression tests for config error logging, fail-open behavior, and bubbling unexpected exceptions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2283 to +2288
Application.put_env(:symphony_elixir, :config_cache_file_reader, fn _path ->
raise RuntimeError, "config cache exploded"
end)

Cache.clear()

Summary:
- Restore the previous config_cache_file_reader app env after the
  unexpected-exception review-agent gate test.
- Clear the config cache during cleanup so later tests do not observe the
  temporary raising file reader.

Rationale:
- The test mutates global application env and should not leak that state into
  the rest of the suite.

Tests:
- mix test test/symphony_elixir/orchestrator_status_test.exs:2239
  test/symphony_elixir/orchestrator_status_test.exs:2265
  test/symphony_elixir/orchestrator_status_test.exs:2280
  test/symphony_elixir/orchestrator_status_test.exs:2304
- mix specs.check
- make check (fails: MCP Unix socket open returns :eperm in this
  environment, causing MCP/AppServer socket expectations to fail)
@chihsuan
chihsuan merged commit 56c5bd3 into main May 22, 2026
12 checks passed
@chihsuan
chihsuan deleted the auto/RSM-3793 branch May 25, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants