Skip to content

fix: Make render_services exit non-zero on materialization failures#232

Merged
mwarkentin merged 2 commits into
mainfrom
michaelwarkentin/improve-materialization-with-failures
May 25, 2026
Merged

fix: Make render_services exit non-zero on materialization failures#232
mwarkentin merged 2 commits into
mainfrom
michaelwarkentin/improve-materialization-with-failures

Conversation

@mwarkentin
Copy link
Copy Markdown
Member

@mwarkentin mwarkentin commented May 25, 2026

Summary

  • When a service fails to render (e.g. jinja2.exceptions.UndefinedError), the process now collects all errors, continues processing remaining services, prints a clear summary, and exits with code 1
  • Previously the --multithreaded path would crash on the first failing future (hiding subsequent failures), and the non-multithreaded path had no error handling at all
  • Full tracebacks are available via --debug and include customer/cluster/service context

Example output

Service FAILED: customer1 : cluster-a : getsentry — UndefinedError: 'dict object' has no attribute 'some_var'
Service unchanged: customer2 : cluster-a : common
...

4 service(s) failed to render:
  - customer1 : cluster-a : getsentry — 'dict object' has no attribute 'some_var'
  - customer1 : cluster-b : getsentry — 'dict object' has no attribute 'some_var'
  - customer2 : cluster-a : getsentry — 'dict object' has no attribute 'some_var'
  - customer2 : cluster-b : getsentry — 'dict object' has no attribute 'some_var'
make: *** [materialize-k8s] Error 1

Test plan

  • Reproduced locally with make materialize-k8s — 4 failing services now show clear error lines and the process exits non-zero
  • CI should now fail on render errors instead of reporting success

Made with Cursor

Previously, when using --multithreaded, the first future.result()
that raised (e.g. jinja2 UndefinedError) would crash the process
immediately, hiding any subsequent failures. The non-multithreaded
path had no error handling at all.

Now both paths collect all errors, continue processing remaining
services, print a clear summary of failures, and exit with code 1.
Full tracebacks are available via --debug.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mwarkentin mwarkentin requested a review from a team as a code owner May 25, 2026 18:38
Cover both _render_multithreaded and the CLI entry point:
- All services succeed (exit 0)
- All services fail (exit 1, errors collected)
- Partial failure processes all services and reports summary
- Error summary output format
- Multithreaded vs single-threaded paths

ProcessPoolExecutor is swapped for ThreadPoolExecutor in unit tests
to avoid pickling issues with mocked callables.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mwarkentin mwarkentin enabled auto-merge (squash) May 25, 2026 18:44
@mwarkentin mwarkentin merged commit 5efc57e into main May 25, 2026
12 checks passed
@mwarkentin mwarkentin deleted the michaelwarkentin/improve-materialization-with-failures branch May 25, 2026 18:44
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