Skip to content

Feat/reporter extension - #463

Merged
zachfedor merged 19 commits into
mainfrom
feat/reporter-extension
Apr 16, 2026
Merged

Feat/reporter extension#463
zachfedor merged 19 commits into
mainfrom
feat/reporter-extension

Conversation

@zachfedor

Copy link
Copy Markdown
Contributor

Adds the reference extension stellar-scaffold-reporter using all the new hooks for Scaffold:

  • It reports compile timing, Wasm sizes with deltas, deploy details, codegen timing, a summary after each life-cycle phase
  • This cleans up the current build output so nothing is duplicated (fixes Clean up --build-clients output #328). Now scaffold logging is only essentials (i.e. successes, warnings, errors).
  • Adds configured modes "standard" and "minimal" to quiet the output even more
  • Adds extension system tests using the reporter

Closes #449

@zachfedor
zachfedor requested a review from chadoh April 10, 2026 14:01
willemneal and others added 3 commits April 15, 2026 16:18
- 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>
Comment on lines 65 to 68
for ext in extensions {
if !ext.manifest.hooks.iter().any(|h| h == hook_str) {
continue;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 willemneal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Very nice! Makes things cleaner and is fun!

@zachfedor
zachfedor merged commit 9a9221a into main Apr 16, 2026
9 checks passed
@zachfedor
zachfedor deleted the feat/reporter-extension branch April 16, 2026 19:45
This was referenced Apr 16, 2026
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.

reporter extension Clean up --build-clients output

2 participants