Skip to content

Workflow fix - #111

Closed
lm-sousa wants to merge 147 commits into
java-deprecationfrom
workflow-fix
Closed

Workflow fix#111
lm-sousa wants to merge 147 commits into
java-deprecationfrom
workflow-fix

Conversation

@lm-sousa

Copy link
Copy Markdown
Member

No description provided.

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.
… and SuperAbstractJoinPointGenerator; add TypeTraversalUtils for type checks
…or and SuperAbstractJoinPointGenerator; enhance type conversion in ConvertUtils
…'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.
…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.
…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.
Copilot AI lite review requested due to automatic review settings August 28, 2026 20:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +20 to +22
const root = process.cwd();
const environmentPath = path
.relative(root, fileURLToPath(new URL("./weaverEnvironment.ts", import.meta.url)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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.
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@lm-sousa lm-sousa closed this Sep 2, 2026
@lm-sousa
lm-sousa deleted the workflow-fix branch September 2, 2026 23:41
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.

2 participants