Feat/reporter extension - #463
Merged
Merged
Conversation
1 task
1 task
6 tasks
- state::save now returns io::Result and callers log on failure via a save_state helper, instead of silently dropping state writes - read_stdin returns Option<T>; the reporter logs a diagnostic and degrades gracefully on bad input instead of panicking and surfacing as a non-zero extension exit - HookName and DeployKind are marked #[non_exhaustive] so adding a hook or deploy kind in the future is not a breaking change for external extension authors consuming stellar-scaffold-ext-types - Drop unused thiserror dependency from the reporter crate - Remove a stale TODO comment in report.rs whose behavior is already correct Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ilures `generate_contract_bindings` previously short-circuited via `?` inside the rebuild block, so PostCodegen was skipped whenever any inner step (bindings typescript, npm install/build, fs ops, create_contract_template) returned Err. Combined with `handle_contracts` swallowing per-contract errors, this made the build exit 0 while a hook that consumers rely on never fired — exactly the failure mode of `extension_hooks_fire_in_order`. Restructure so PostCodegen always fires after the fallible work, then propagate the error via a new CodegenStepFailed variant. `handle_contracts` now counts failures and returns ContractClientFailures so a broken codegen step can no longer masquerade as a successful build. Adds a regression test that shims npm to fail and asserts both pre- and post-codegen still appear. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reverts the handle_contracts change from 590a1a5. That commit made per-contract codegen failures propagate as a build error, but `build_clients::contracts::contracts_with_failures_show_summary` explicitly asserts `build.success()` while showing per-contract success/fail messages — non-fatal contract failures are documented behavior, not an oversight. Propagation also surfaced pre-existing real codegen failures in several example contracts (case_02_account, case_17, case_18) that had been silently swallowed; restoring or expecting those is out of scope for this fix. The PostCodegen-on-error fix and its regression test remain. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
willemneal
reviewed
Apr 16, 2026
Comment on lines
65
to
68
| for ext in extensions { | ||
| if !ext.manifest.hooks.iter().any(|h| h == hook_str) { | ||
| continue; | ||
| } |
Contributor
There was a problem hiding this comment.
Missed in my last review, but you can do extensions.iter().(filter). Also I would advocate for all not vs not any, to avoid the ! in the front.
willemneal
approved these changes
Apr 16, 2026
willemneal
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Very nice! Makes things cleaner and is fun!
This file contains hidden or 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
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.
Adds the reference extension
stellar-scaffold-reporterusing all the new hooks for Scaffold:--build-clientsoutput #328). Now scaffold logging is only essentials (i.e. successes, warnings, errors).Closes #449