Skip to content

fix(jans-cedarling): early error returns in build_entity_attrs cause test failures #13038

@dagregi

Description

@dagregi

Describe the bug
Adding early error returns in build_entity_attrs_with_shape function causes multiple tests to fail.

To Reproduce
Steps to reproduce the behavior:

  1. Add early return in jans-cedarling/cedarling/src/entity_builder/build_entity_attrs.rs and update jans-cedarling/cedarling/src/entity_builder/error.rs
  2. Run the tests with cargo test -p cedarling
  3. Multiple tests that previously passed will now fail due to early error returns

To check add the below code:

  • In build_entity_attrs.rs line 153 add:
    if !errs.is_empty() {
        return Err(BuildAttrsErrorVec::from(errs));
    }
  • In error.rs add:
impl From<Vec<BuildAttrsError>> for BuildAttrsErrorVec {
    fn from(errs: Vec<BuildAttrsError>) -> Self {
        Self(errs)
    }
}

Expected behavior
Tests should continue to pass.

Additional context

The issue appears to be that the new early error return changes the flow of error handling. The existing code doesn't return errors so maybe this is wanted by design, and adding the early return may be redundant or interfering with the existing error handling logic.

Metadata

Metadata

Assignees

Labels

comp-jans-cedarlingTouching folder /jans-cedarlingkind-bugIssue or PR is a bug in existing functionality

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions