Skip to content

Conversation

@aborgna-q
Copy link
Collaborator

Makes the helper public, so other libraries don't have to re-create.

drive-by: Add generator data to validation errors in hugr mermaid.

@aborgna-q aborgna-q requested a review from a team as a code owner August 7, 2025 09:17
@aborgna-q aborgna-q requested a review from mark-koch August 7, 2025 09:17
@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.66%. Comparing base (33e5305) to head (d19cb9e).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
hugr-cli/src/validate.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2507   +/-   ##
=======================================
  Coverage   82.66%   82.66%           
=======================================
  Files         251      252    +1     
  Lines       46798    46801    +3     
  Branches    42327    42330    +3     
=======================================
+ Hits        38686    38689    +3     
  Misses       6061     6061           
  Partials     2051     2051           
Flag Coverage Δ
python 91.38% <ø> (ø)
rust 81.74% <92.85%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aborgna-q aborgna-q added this pull request to the merge queue Aug 11, 2025
Merged via the queue into main with commit 513350b Aug 11, 2025
26 checks passed
@aborgna-q aborgna-q deleted the ab/hugr-cli-err-helper branch August 11, 2025 09:19
@hugrbot hugrbot mentioned this pull request Aug 11, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 15, 2025
## 🤖 New release

* `hugr-model`: 0.22.2 -> 0.22.3 (✓ API compatible changes)
* `hugr-core`: 0.22.2 -> 0.22.3 (✓ API compatible changes)
* `hugr-llvm`: 0.22.2 -> 0.22.3 (✓ API compatible changes)
* `hugr-passes`: 0.22.2 -> 0.22.3 (✓ API compatible changes)
* `hugr-persistent`: 0.2.2 -> 0.2.3 (✓ API compatible changes)
* `hugr`: 0.22.2 -> 0.22.3 (✓ API compatible changes)
* `hugr-cli`: 0.22.2 -> 0.22.3 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr-model`

<blockquote>

##
[0.22.2](hugr-model-v0.22.1...hugr-model-v0.22.2)
- 2025-08-06

### New Features

- Type of constants in `core` `Term`s.
([#2411](#2411))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.22.3](hugr-core-v0.22.2...hugr-core-v0.22.3)
- 2025-09-11

### Bug Fixes

- SiblingSubgraph::try_from_nodes not including disconnected components
([#2549](#2549))

### Documentation

- Clarify docs for SiblingSubgraph::{inputs, outputs}
([#2508](#2508))

### New Features

- SiblingSubgraph supports function calls
([#2528](#2528))
- Add unchecked constructor for SiblingSubgraph
([#2526](#2526))
- Add HugrMut::insert(_view)_forest
([#2518](#2518))
- Add extend_inputs function for DFGs
([#2536](#2536))
- Loosen bound on Patch trait
([#2545](#2545))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.22.2](hugr-llvm-v0.22.1...hugr-llvm-v0.22.2)
- 2025-08-06

### Bug Fixes

- added public func getter for EmitFuncContext
([#2482](#2482))
- *(hugr-llvm)* Set llvm function linkage based on Visibility hugr node
field ([#2502](#2502))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.22.3](hugr-passes-v0.22.2...hugr-passes-v0.22.3)
- 2025-09-11

### New Features

- SiblingSubgraph supports function calls
([#2528](#2528))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.2.3](hugr-persistent-v0.2.2...hugr-persistent-v0.2.3)
- 2025-09-11

### Documentation

- Clarify docs for SiblingSubgraph::{inputs, outputs}
([#2508](#2508))

### New Features

- SiblingSubgraph supports function calls
([#2528](#2528))
</blockquote>

## `hugr`

<blockquote>

##
[0.22.3](hugr-v0.22.2...hugr-v0.22.3)
- 2025-09-11

### Bug Fixes

- SiblingSubgraph::try_from_nodes not including disconnected components
([#2549](#2549))

### Documentation

- Clarify docs for SiblingSubgraph::{inputs, outputs}
([#2508](#2508))

### New Features

- SiblingSubgraph supports function calls
([#2528](#2528))
- Add unchecked constructor for SiblingSubgraph
([#2526](#2526))
- Add extend_inputs function for DFGs
([#2536](#2536))
- Loosen bound on Patch trait
([#2545](#2545))
- Add HugrMut::insert(_view)_forest
([#2518](#2518))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.22.3](hugr-cli-v0.22.2...hugr-cli-v0.22.3)
- 2025-09-11

### New Features

- *(hugr-cli)* CliError::validate helper
([#2507](#2507))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
@hugrbot hugrbot mentioned this pull request Sep 16, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 30, 2025
## 🤖 New release

* `hugr-model`: 0.22.4 -> 0.23.0 (✓ API compatible changes)
* `hugr-core`: 0.22.4 -> 0.23.0 (⚠ API breaking changes)
* `hugr-llvm`: 0.22.4 -> 0.23.0 (✓ API compatible changes)
* `hugr-passes`: 0.22.4 -> 0.23.0 (⚠ API breaking changes)
* `hugr-persistent`: 0.2.3 -> 0.3.0 (✓ API compatible changes)
* `hugr`: 0.22.4 -> 0.23.0 (✓ API compatible changes)
* `hugr-cli`: 0.22.4 -> 0.23.0 (✓ API compatible changes)

### ⚠ `hugr-core` breaking changes

```text
--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/enum_variant_missing.ron

Failed in:
  variant PackageEncodingError::ExtensionVersion, previously in file /tmp/.tmp8eoQo1/hugr-core/src/envelope/package_json.rs:89

--- failure function_parameter_count_changed: pub fn parameter count changed ---

Description:
A publicly-visible function now takes a different number of parameters.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/function_parameter_count_changed.ron

Failed in:
  hugr_core::import::import_package now takes 3 parameters instead of 2, in /tmp/.tmpBTXSed/hugr/hugr-core/src/import.rs:187

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/struct_missing.ron

Failed in:
  struct hugr_core::extension::prelude::PRELUDE_REGISTRY, previously in file /tmp/.tmp8eoQo1/hugr-core/src/extension/prelude.rs:43
  struct hugr_core::extension::PRELUDE_REGISTRY, previously in file /tmp/.tmp8eoQo1/hugr-core/src/extension/prelude.rs:43
  struct hugr_core::std_extensions::logic::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/logic.rs:134
  struct hugr_core::extension::prelude::PRELUDE, previously in file /tmp/.tmp8eoQo1/hugr-core/src/extension/prelude.rs:43
  struct hugr_core::extension::PRELUDE, previously in file /tmp/.tmp8eoQo1/hugr-core/src/extension/prelude.rs:43
  struct hugr_core::std_extensions::ptr::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/ptr.rs:112
  struct hugr_core::std_extensions::arithmetic::int_types::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/arithmetic/int_types.rs:209
  struct hugr_core::std_extensions::arithmetic::conversions::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/arithmetic/conversions.rs:174
  struct hugr_core::std_extensions::collections::array::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/collections/array.rs:93
  struct hugr_core::std_extensions::arithmetic::int_types::INT_TYPES, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/arithmetic/int_types.rs:49
  struct hugr_core::std_extensions::arithmetic::float_types::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/arithmetic/float_types.rs:104
  struct hugr_core::std_extensions::collections::static_array::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/collections/static_array.rs:142
  struct hugr_core::std_extensions::collections::list::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/collections/list.rs:289
  struct hugr_core::std_extensions::STD_REG, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions.rs:35
  struct hugr_core::std_extensions::collections::value_array::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/collections/value_array.rs:99
  struct hugr_core::std_extensions::collections::borrow_array::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/collections/borrow_array.rs:290
  struct hugr_core::std_extensions::arithmetic::float_ops::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/arithmetic/float_ops.rs:115
  struct hugr_core::std_extensions::arithmetic::int_ops::EXTENSION, previously in file /tmp/.tmp8eoQo1/hugr-core/src/std_extensions/arithmetic/int_ops.rs:254
```

### ⚠ `hugr-passes` breaking changes

```text
--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/enum_missing.ron

Failed in:
  enum hugr_passes::non_local::NonLocalEdgesError, previously in file /tmp/.tmp8eoQo1/hugr-passes/src/non_local.rs:57
```

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr-model`

<blockquote>

##
[0.23.0](hugr-model-v0.22.4...hugr-model-v0.23.0)
- 2025-09-30

### Bug Fixes

- [**breaking**] Appease `cargo-audit` by replacing unmaintained
dependencies ([#2572](#2572))

### New Features

- Documentation and error hints
([#2523](#2523))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.23.0](hugr-core-v0.22.4...hugr-core-v0.23.0)
- 2025-09-30

### Bug Fixes

- [**breaking**] Appease `cargo-audit` by replacing unmaintained
dependencies ([#2572](#2572))
- *(core)* check extension versions on model import
([#2580](#2580))
- [**breaking**] test extension version compatibility on ModelWithExts
([#2587](#2587))
- *(core)* check used extension versions against resolved extensions
([#2588](#2588))
- [**breaking**] model import loads Package extensions
([#2590](#2590))

### Miscellaneous Tasks

- [**breaking**] Cleanup deprecated definitions
([#2594](#2594))

### New Features

- add trait+funcs for linking Hugrs explicitly by Node
([#2521](#2521))
- Documentation and error hints
([#2523](#2523))
- Allow creating DFG builders from existing hugrs
([#2562](#2562))
- add_input/output for arbitrary DFGBuilders
([#2564](#2564))
- [**breaking**] Return error instead of panicking in
DFGWrapper::add_{in,out}put
([#2571](#2571))
- *(core)* inner acccesors for WithGenerator error
([#2583](#2583))
- Normalize CFGs ([#2591](#2591))

### Refactor

- [**breaking**] Replace lazy_static with std::sync::LazyLock
([#2567](#2567))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.23.0](hugr-llvm-v0.22.4...hugr-llvm-v0.23.0)
- 2025-09-30

### Miscellaneous Tasks

- [**breaking**] Cleanup deprecated definitions
([#2594](#2594))

### Refactor

- [**breaking**] Replace lazy_static with std::sync::LazyLock
([#2567](#2567))

### Testing

- Add framework for LLVM execution tests involving panics
([#2568](#2568))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.23.0](hugr-passes-v0.22.4...hugr-passes-v0.23.0)
- 2025-09-30

### Bug Fixes

- DeadCodeElim keeps consumers of linear outputs
([#2560](#2560))
- [**breaking**] Appease `cargo-audit` by replacing unmaintained
dependencies ([#2572](#2572))

### Miscellaneous Tasks

- [**breaking**] Cleanup deprecated definitions
([#2594](#2594))

### New Features

- [**breaking**] DeadCodeElimPass reports error on non-existent
entry_points ([#2566](#2566))
- Normalize CFGs ([#2591](#2591))

### Refactor

- [**breaking**] Replace lazy_static with std::sync::LazyLock
([#2567](#2567))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.3.0](hugr-persistent-v0.2.3...hugr-persistent-v0.3.0)
- 2025-09-30

### Miscellaneous Tasks

- [**breaking**] Cleanup deprecated definitions
([#2594](#2594))

### Refactor

- [**breaking**] Replace lazy_static with std::sync::LazyLock
([#2567](#2567))
</blockquote>

## `hugr`

<blockquote>

##
[0.23.0](hugr-v0.22.4...hugr-v0.23.0)
- 2025-09-30

### Bug Fixes

- DeadCodeElim keeps consumers of linear outputs
([#2560](#2560))
- [**breaking**] Appease `cargo-audit` by replacing unmaintained
dependencies ([#2572](#2572))
- *(core)* check extension versions on model import
([#2580](#2580))
- [**breaking**] test extension version compatibility on ModelWithExts
([#2587](#2587))
- *(core)* check used extension versions against resolved extensions
([#2588](#2588))
- [**breaking**] model import loads Package extensions
([#2590](#2590))

### Miscellaneous Tasks

- [**breaking**] Cleanup deprecated definitions
([#2594](#2594))

### New Features

- [**breaking**] DeadCodeElimPass reports error on non-existent
entry_points ([#2566](#2566))
- add trait+funcs for linking Hugrs explicitly by Node
([#2521](#2521))
- Documentation and error hints
([#2523](#2523))
- Allow creating DFG builders from existing hugrs
([#2562](#2562))
- add_input/output for arbitrary DFGBuilders
([#2564](#2564))
- [**breaking**] Return error instead of panicking in
DFGWrapper::add_{in,out}put
([#2571](#2571))
- *(core)* inner acccesors for WithGenerator error
([#2583](#2583))
- Normalize CFGs ([#2591](#2591))

### Refactor

- [**breaking**] Replace lazy_static with std::sync::LazyLock
([#2567](#2567))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.22.3](hugr-cli-v0.22.2...hugr-cli-v0.22.3)
- 2025-09-11

### New Features

- *(hugr-cli)* CliError::validate helper
([#2507](#2507))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
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.

3 participants