Repository navigation
Conversation
|
@Ani07-05 Has this been well tested ? |
|
Yes, tested. I ran:
|
There was a problem hiding this comment.
Thank you for this contribution, Ani07-05, and for the clear PR description. Unwrapping scalar map keys and values in visitMapDeclaration is a clean fix for the undefined SSN and Time types, and removing the two Rust skips in test/verification/cases.js is the right follow-through. Boxing non-array relationships does break the Manager cycle in the HR model. Nothing here is blocking, but a few things would make this ready to merge: (1) rebase onto main and regenerate the snapshot, (2) either box recursive containment fields as well or narrow the title and description to relationship recursion, (3) list the unconditional boxing as a numbered question for the maintainers and consider limiting it to relationships that are actually recursive, and (4) add a unit test for a scalar map value.
Nothing blocking; some suggestions below. Findings: 3 should-fix, 1 nit.
- should-fix · hygiene: GitHub reports this branch as conflicting with
main. Please rebase, runnpm run test:updateSnapshots, and read the changes intest/codegen/__snapshots__/codegen.js.snapto check that each changed line still follows from the fix. The commit also needs to be able to passnpm teston the rebased branch.
Automated review by Mira, an Accord Project agent, at f7c8295. Findings are labelled blocking, should-fix or nit; a maintainer makes the final call.
Unwrap scalar map key/value types in type aliases to their primitives and box non-array properties that reach their declaring class, so generated output passes cargo check. Remove the Rust verification skips for hr_base and hr_integration. Closes accordproject#264 Signed-off-by: Anirudh <anirudh.ashrith2005@gmail.com>
f7c8295 to
ae6fb34
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Thank you for the updates, Ani07-05. The new head addresses the earlier feedback well. Boxing now happens only where a property really reaches its declaring class, which keeps the generated output unchanged for most models. Containment fields are covered as well as relationships. The snapshot change is limited to Employee.manager and Manager.manager. The scalar key and value map handling has unit tests, and the two stale verification skips are removed. One edge case remains, under the opt-in flattenSubclassesToUnion parameter. Once that is handled, with a unit test, this looks ready for a maintainer to approve. The earlier review threads look resolved by these changes, so it would help to mark them resolved. The CI workflows for a first contribution need a maintainer to approve them, so only the DCO check has run so far.
Nothing blocking; some suggestions below. Findings: 1 should-fix.
- should-fix · correctness ·
lib/codegen/fromcto/rust/rustvisitor.js:isRecursiveonly boxes when the target is the declaring class, reaches it through properties, or is a subclass of it. WithflattenSubclassesToUnionon, a field typed with a superclass is emitted as<Base>Union, and that enum has a variant for every subclass. Takeabstract concept Base {}andconcept A extends Base { o Base other }. This generatesA { other: BaseUnion }andBaseUnion::A(A), which is an infinitely sized type thatcargo checkrejects with E0072.isRecursivereturns false here becauseBasenever reachesA. Suggested fix: passuseUnionintoisRecursive. When it is true, also treat the property as recursive if the owner is, or inherits from, the property's target type (compareowner.getAllSuperTypeDeclarations()with the target) and the target has subclasses in the same model file. Please add a unit test for this case alongside the other recursion tests.
Automated review by Mira, an Accord Project agent, at ae6fb34. Findings are labelled blocking, should-fix or nit; a maintainer makes the final call.
With flattenSubclassesToUnion, a field typed with a base class is
emitted as <Base>Union, which has a variant for each local subclass.
A subclass declaring such a field (A { o Base other }) produced an
infinitely sized type that cargo check rejects with E0072.
isRecursive now also treats the field as recursive when any union
variant reaches the declaring class.
Signed-off-by: Anirudh <anirudh.ashrith2005@gmail.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
Thank you for sticking with this, Ani07-05. The latest commit is a clear improvement. Boxing now happens only when a property reaches its declaring class, which covers direct, indirect, subclass and flattenSubclassesToUnion cases and leaves other output unchanged. Earlier comments about containment recursion, unconditional boxing and missing scalar-value tests are addressed, and the new unit tests for the cycle and union cases are well chosen. I found no new problems in the code. To make this mergeable: (1) the test and verification workflows haven't run on this commit, so cargo check for the Rust cases whose skips you removed is not yet confirmed. A maintainer needs to approve the workflow runs, and they need to pass; (2) please resolve the three earlier review threads that are now addressed; (3) a maintainer needs to approve. Please also include the commands you ran locally and the pass counts in the description, as the repo's guidance asks.
No problems found.
Automated review by Mira, an Accord Project agent, at 6938e9c. Findings are labelled blocking, should-fix or nit; a maintainer makes the final call.
|
@mttrbrts could you approve the CI workflow runs ? |
Signed-off-by: Anirudh <anirudh.ashrith2005@gmail.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Closes #264
Changes
pub typemap aliases (HashMap<SSN, Employee>becomesHashMap<String, Employee>), matching how field sites already behave. Scalars are not emitted, so the alias previously referenced undefined types (bugs 1 and 2)Box<T>(Option<Box<Manager>>) only when it is recursive, to break the infinite-size type (bug 3). A field is recursive when its target reaches the declaring class through properties (direct or indirect cycle), through a superclass or subclass, or, withflattenSubclassesToUnion, through any variant of the<Base>Unionenumskipentries forhr_baseandhr_integrationintest/verification/cases.jsso they are verified withcargo checkFlags
Vec<T>fields and map values are left unboxed since they already provide indirectionTesting
npm test: 703 passing, 99% statement coverage; lint, licence-header check and JSDoc cleannpx mocha test/codegen/fromcto/rust/rustvisitor.js: 62 passingcargo checkon generated crates):hr_baseandhr_integrationpass with the skips removed. Five union and recursion cases pass withflattenSubclassesToUnionRelated Issues
cargo check#264Author Checklist
--signoffoption of git commit.