Workflow fix - #111
Conversation
…ad-local weaver references
Root Cause: The test was calling WeaverGenerator.main(args) which internally calls System.exit(), terminating the JVM before the golden file comparison could execute. This is why the changes to WeaverGenerator weren't being detected - the comparison code was never reached. Fix Applied: Changed both calls from WeaverGenerator.main(args) to WeaverGenerator.run(args) with proper exit code assertions. Result: The tests now run to completion and properly compare generated files against golden files.
…the past commits. - Removed the version option from CLIOption and related parsing logic. - Updated OptionsParser to remove references to the version option. - Adjusted help printing methods to exclude version information. - Modified tests to reflect the removal of the version option, ensuring no references remain in CLIOptionTest and OptionsBuilderUtilsTest. - Updated various tests to use the new TestJoinPoint constructor that requires a WeaverEngine instance. - Cleaned up WeaverEngine and JoinPoint tests to remove unnecessary thread-local weaver management. - Ensured all tests are consistent with the new structure and functionality.
- Add WildcardType IType implementation to represent ?, ? extends T, and ? super T, including factory methods (unbounded(), extendsType(), superType()), singleton for unbounded, proper toString()/type(), equals/hashCode and validation. - Parse wildcard type arguments in LanguageSpecification: - Detect wildcard tokens in getType() and route to parseWildcardType(...). - Parse ?, ? extends X, ? super X and build corresponding WildcardType instances. - Preserve nested generics and array handling (e.g., List<?[]>, ? extends this[]). - Add extensive XML fixtures for wildcard scenarios: - artifacts.xml - actionModel.xml - joinPointModel.xml - Fixtures include nested wildcards, wildcard arrays, multiple wildcards, this-bound wildcards, and attributes with parameters using wildcard types. - Add integration tests: - WildcardTypeXmlIntegrationTest.java — 39 tests covering parsing of wildcard generics, nested cases, arrays, actions, parameters, and inheritance with this. - Add unit tests: - WildcardTypeTest.java — comprehensive unit tests for WildcardType. - Small supporting changes: - Update LanguageSpecification.java to add wildcard handling and parsing helper. - Add attribute-parameter tests covering parameters whose types are wildcards and compound generics (e.g., Map<String, ?>, List<? super this>). - Minor test resource and test class additions/adjustments to ensure coverage and validation.
…d actions - Implemented exception handling with ThistypeWeaverException for better error reporting. - Updated XML specifications of integration tests for actions and artifacts to test 'this' type and generics. - Enhanced Java code generation tests to ensure 'this' type integration and method signature uniqueness. - Added regression tests to verify correct behavior of generated code and prevent duplicate signatures. - Developed utility tests for conversion behavior related to 'this' type in the context of attribute conversion.
… field count and JSON structure
… and improve type handling
… and SuperAbstractJoinPointGenerator; add TypeTraversalUtils for type checks
…or and SuperAbstractJoinPointGenerator; enhance type conversion in ConvertUtils
…s WeaverGenerator
…'s langspec; Added utility classes for artifact manifest and JSON invariants - Introduced `ArtifactManifestEntry` for representing file metadata with methods for TSV conversion. - Added `InvariantSnapshot` to encapsulate JSON and Java invariants in a structured format. - Created `JavaDeclarationSignature` to represent Java declaration signatures with normalization functionality. - Implemented `JavaInvariantUtils` for processing Java files, extracting declarations, and computing snapshots. - Developed `JsonInvariantUtils` for parsing JSON files, computing snapshots, and validating joinpoint hierarchies. - Added `ManifestUtils` for computing and managing artifact manifests, including hash generation and comparison methods.
…d extend golden file regeneration to all integrations tests.
…essary return type adjustments and imports
…tion framework - Added DotGenerator for generating DOT files representing join point hierarchy. - Introduced EntityGenerator for creating user-defined entity and enum classes. - Created GeneratorConfig for managing code generation configurations. - Developed ProviderDefGenerator for generating provider definition interfaces. - Implemented RegistryGenerator for runtime provider lookup. - Added SpecMerger to merge base and weaver-specific specifications. - Created WeaverAbstractGenerator for generating abstract weaver classes. - Introduced JavaSourceBuilder for building Java source code with proper formatting. - Added TypeMapper for mapping LangSpec2 types to Java types. - Updated WeaverInterface with BaseJoinPointSpec and JoinPoint2 for new join point system. - Enhanced WeaverEngine to support the new provider registry pattern. - Updated build.gradle and settings.gradle to include LangSpec2 dependency.
…ed keywords and sanitizing Java identifiers
… with duplicate checks
…ture for attribute and action signatures
…ntinue the migration towards the new WeaverGen2
Replace Jest and ts-jest with Vitest's native Node TypeScript runner, add shared Vitest setup helpers, and configure Vitest-aware linting and Prettier.
Replace ESLint and Prettier scripts/configuration with Oxlint and Oxfmt, retain TSDoc validation through the compatible plugin bridge, and update lint-disable directives.
Run Lara tests in one shared fork with a Weaver environment that initializes before every test and stops Java only after Vitest has completed worker reporting. Replace per-project setup/config files and preserve legacy file isolation.
Expose a fixed-path validator for weaver package distributions and cover missing, symlinked, malformed, and valid java-binaries layouts.
fileURLToPath() produced a plain Windows path (D:\...), which the ESM loader misread as the protocol 'vitest-environment-d:' when spawning forks workers. Passing an href file:// URL works on all platforms.
Vitest only treats the environment value as a path when it starts with '.' or '/'; absolute POSIX paths leaked a file:// scheme that crashed dependency detection, and Windows drive paths were misread as the protocol 'vitest-environment-d:'. Compute a './'-prefixed path relative to the config root instead, which works on every platform.
ConfigEnv does not expose the project root; Vitest defaults to the process cwd, which is where tests are always launched from.
The function form of defineConfig does not typecheck against Vitest's overloads; the root-relative environment path is computed eagerly instead, since tests always launch from the package directory.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbeb388749
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| with: | ||
| path: lara-framework | ||
| fetch-depth: 0 | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} |
There was a problem hiding this comment.
Checkout the same PR revision in both build jobs
On pull_request runs where the base branch contains commits absent from the PR head, this forces build-java to build the head commit, while the unchanged checkout in build-js uses the pull request's synthetic merge commit. The JS tests then consume Java binaries built from a different Lara revision, so integration failures can be missed or spurious failures can occur; both jobs should use the same revision.
Useful? React with 👍 / 👎.
| const root = process.cwd(); | ||
| const environmentPath = path | ||
| .relative(root, fileURLToPath(new URL("./weaverEnvironment.ts", import.meta.url))) |
There was a problem hiding this comment.
Derive the environment path from Vitest's actual root
When this exported config helper is used with a Vitest root different from process.cwd()—for example, vitest --root Lara-JS launched from the repository root—the generated path is relative to the process directory but Vitest resolves ./... against its configured project root. That produces a duplicated or otherwise incorrect path and prevents the custom environment from loading; the relative path must be based on the effective Vitest root.
Useful? React with 👍 / 👎.
Replaces the vendored copies of resolve-dependency-refs.sh and its test suite with the specs-feup/branch-resolver@v1 composite action, which exports specs_ref/_branch/_default as environment variables. Clava is passed as an evidence repository.
build-js had no ref, so pull_request runs tested the synthetic merge commit while build-java built the PR head; JS tests then consumed Java binaries from a different revision. Pin both jobs to github.event.pull_request.head.sha || github.sha.
A push to a feature branch with an open PR fired both the push run and the pull_request synchronize run for the same commit. Feature branches are covered by pull_request; push now builds only the long-lived branches.
|
573ca99 to
292b88b
Compare




No description provided.