Skip to content

bug(#4987): fixed classedDir in MjSafe#4988

Merged
yegor256 merged 1 commit into
objectionary:masterfrom
maxonfjvipon:bug/#4987/mjsafe-classesdir-default-value
Apr 16, 2026
Merged

bug(#4987): fixed classedDir in MjSafe#4988
yegor256 merged 1 commit into
objectionary:masterfrom
maxonfjvipon:bug/#4987/mjsafe-classesdir-default-value

Conversation

@maxonfjvipon

@maxonfjvipon maxonfjvipon commented Apr 15, 2026

Copy link
Copy Markdown
Member

Closes: #4987

Summary by CodeRabbit

Release Notes

  • Tests

    • Updated test suite to reflect changes in internal package naming conventions and build artifact organization.
  • Chores

    • Modified build configuration to adjust how compiled classes are retained during the build process.
    • Temporarily disabled a test pending resolution of a known issue; scheduled for re-enablement in a future release.

@github-actions github-actions Bot added the core label Apr 15, 2026
@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR adjusts Maven plugin default parameters, updates test configurations and assertions to use shortened object paths (from org.eolang.io.stdout to io.stdout), disables a failing integration test with documentation, and expands binary retention settings in the build configuration.

Changes

Cohort / File(s) Summary
Test Disabling
eo-integration-tests/src/test/java/integration/JarIT.java
Added @Disabled annotation to printsErrorToStderr test and documented disablement via TODO comment indicating future re-enablement.
Maven Plugin Default
eo-maven-plugin/src/main/java/org/eolang/maven/MjSafe.java
Changed default classesDir parameter from ${project.build.directory}/classes/org/eolang to ${project.build.directory}/classes.
Test Artifact Paths
eo-maven-plugin/src/test/java/org/eolang/maven/MjUnspileTest.java
Updated test paths from EOorg/... to org/... for generated and compiled class artifacts in deletesInnerGeneratedClasses test setup.
Object Path Assertions
eo-maven-plugin/src/test/java/org/eolang/maven/ObjectsIndexTest.java, OyIndexedTest.java, OyRemoteTest.java
Updated expected object path strings from org.eolang.io.stdout to io.stdout and similar shortened forms (ms instead of org.eolang.ms, ss instead of org.eolang.ss) in test assertions and helper methods.
Build Configuration
eo-runtime/pom.xml
Expanded keepBinaries configuration from 6 entries to comprehensive set of org/eolang/** class artifacts; added TODO documentation describing intended reduction scope.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

core

Suggested reviewers

  • yegor256

Poem

🐰 Default paths get shorter now,
Tests renamed from EOorg to org somehow,
io.stdout replaces the old way,
Build configs bloom in keepBinaries display,
One test sleeps until better days! 🌟

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes several out-of-scope changes beyond the core MjSafe fix: disabling a JarIT test, updating multiple test files for path changes, and modifying pom.xml keepBinaries configuration. Focus the PR on fixing only the MjSafe classesDir parameter default value; defer test updates and pom.xml changes to separate issues or PRs with clear justification.
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing the incorrect classesDir default value in MjSafe to resolve issue #4987.
Linked Issues check ✅ Passed The PR successfully addresses issue #4987 by changing the classesDir default value from ${project.build.directory}/classes/org/eolang to ${project.build.directory}/classes, matching the requirement.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Performance Analysis

All benchmarks are within the acceptable range. No critical degradation detected (threshold is 100%). Please refer to the detailed report for more information.

Click to see the detailed report
Test Base Score PR Score Change % Change Unit Mode
benchmarks.XmirBench.xmirToEO 180.623 211.731 31.107 17.22% ms/op Average Time

⚠️ Performance loss: benchmarks.XmirBench.xmirToEO is slower by 31.107 ms/op (17.22%)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
eo-integration-tests/src/test/java/integration/JarIT.java (1)

29-31: Minor formatting issue in the TODO link.

The URL https://github.com/objectionary/eo/issues/4987?issue=objectionary%7Ceo%7C4538 appears to have an unusual query parameter (?issue=objectionary|eo|4538). The standard GitHub issue URL format is https://github.com/objectionary/eo/issues/4987. The extra query parameter may be a copy-paste artifact and could cause confusion.

🔧 Suggested fix
-* `@todo` `#4987`:30min Enable JarIt integration tests. The tests were disabled because of this ticket:
-*  https://github.com/objectionary/eo/issues/4987?issue=objectionary%7Ceo%7C4538. When new release
+* `@todo` `#4987`:30min Enable JarIt integration tests. The tests were disabled because of this ticket:
+*  https://github.com/objectionary/eo/issues/4987. When new release
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eo-integration-tests/src/test/java/integration/JarIT.java` around lines 29 -
31, Fix the formatting of the TODO comment in JarIT.java: update the URL in the
puzzle comment that currently reads
"https://github.com/objectionary/eo/issues/4987?issue=objectionary%7Ceo%7C4538"
to the standard GitHub issue URL
"https://github.com/objectionary/eo/issues/4987" (remove the extraneous
"?issue=..." query parameter) so the `@todo/`#4987 comment references the
canonical issue link.
eo-maven-plugin/src/test/java/org/eolang/maven/OyRemoteTest.java (1)

116-130: Misleading variable name: stdout holds a directory path "ss".

The variable is named stdout but contains "ss", which represents a directory being tested. Consider renaming to something like directory or dirPath to match the test's purpose (checking presence of a directory with narrow hash).

✏️ Suggested rename for clarity
     `@Test`
     `@ExtendWith`(WeAreOnline.class)
     void checksPresenceOfDirectoryWithNarrowHash() throws IOException {
-        final String stdout = "ss";
+        final String directory = "ss";
         MatcherAssert.assertThat(
             String.format(
-                "OyRemote with narrow hash should have contained directory %s, but it didn't",
-                stdout
+                "OyRemote with narrow hash should have contained directory %s, but it didn't",
+                directory
             ),
             new OyRemote(
                 new ChNarrow(
                     new ChRemote("master")
                 )
-            ).contains(stdout),
+            ).contains(directory),
             Matchers.is(true)
         );
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eo-maven-plugin/src/test/java/org/eolang/maven/OyRemoteTest.java` around
lines 116 - 130, Rename the misleading variable stdout in the test method
checksPresenceOfDirectoryWithNarrowHash to a name that reflects a directory path
(e.g., directory or dirPath); update its declaration and all uses in the
assertion String.format and the OyRemote.contains call so the test remains
functionally identical (references: method
checksPresenceOfDirectoryWithNarrowHash, variable stdout -> directory/dirPath,
classes OyRemote, ChNarrow, ChRemote).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@eo-integration-tests/src/test/java/integration/JarIT.java`:
- Around line 29-31: Fix the formatting of the TODO comment in JarIT.java:
update the URL in the puzzle comment that currently reads
"https://github.com/objectionary/eo/issues/4987?issue=objectionary%7Ceo%7C4538"
to the standard GitHub issue URL
"https://github.com/objectionary/eo/issues/4987" (remove the extraneous
"?issue=..." query parameter) so the `@todo/`#4987 comment references the
canonical issue link.

In `@eo-maven-plugin/src/test/java/org/eolang/maven/OyRemoteTest.java`:
- Around line 116-130: Rename the misleading variable stdout in the test method
checksPresenceOfDirectoryWithNarrowHash to a name that reflects a directory path
(e.g., directory or dirPath); update its declaration and all uses in the
assertion String.format and the OyRemote.contains call so the test remains
functionally identical (references: method
checksPresenceOfDirectoryWithNarrowHash, variable stdout -> directory/dirPath,
classes OyRemote, ChNarrow, ChRemote).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cdd9b2c8-25ee-4c9d-b323-8d31177afb35

📥 Commits

Reviewing files that changed from the base of the PR and between 31da08e and 6e9a8bf.

📒 Files selected for processing (7)
  • eo-integration-tests/src/test/java/integration/JarIT.java
  • eo-maven-plugin/src/main/java/org/eolang/maven/MjSafe.java
  • eo-maven-plugin/src/test/java/org/eolang/maven/MjUnspileTest.java
  • eo-maven-plugin/src/test/java/org/eolang/maven/ObjectsIndexTest.java
  • eo-maven-plugin/src/test/java/org/eolang/maven/OyIndexedTest.java
  • eo-maven-plugin/src/test/java/org/eolang/maven/OyRemoteTest.java
  • eo-runtime/pom.xml

@maxonfjvipon

Copy link
Copy Markdown
Member Author

@yegor256 please check

@volodya-lombrozo

Copy link
Copy Markdown
Member

@maxonfjvipon I'm getting the following errors locally:


[ERROR] Failures: 
[ERROR]   ObjectsIndexTest.downloadsAndChecksFromRealSource:80 The index must contain the default value
Expected: is <true>
     but: was <false>
[ERROR]   OyIndexedTest.containsInRealIndex:37 OyIndexed must contain stdout object, but it doesn't
Expected: is <true>
     but: was <false>
[ERROR]   OyRemoteTest.checksPresenceOfDirectory:89 OyRemote positively checks the presence of the directory in Objectionary
Expected: is <true>
     but: was <false>
[ERROR]   OyRemoteTest.checksPresenceOfDirectoryWithNarrowHash:118 OyRemote with narrow hash should have contained directory org.eolang.ss, but it didn't
Expected: is <true>
     but: was <false>
[ERROR]   OyRemoteTest.checksPresenceOfProgram:79 OyRemote positively checks the presence of the program in Objectionary
Expected: is <true>
     but: was <false>
[ERROR]   OyRemoteTest.checksPresenceOfProgramWithNarrowHash:100 OyRemote with narrow hash should have contained program org.eolang.io.stdout, but it didn't
Expected: is <true>
     but: was <false>

Will this PR solve them?

@maxonfjvipon

Copy link
Copy Markdown
Member Author

@volodya-lombrozo yes

@yegor256 yegor256 merged commit 58196b2 into objectionary:master Apr 16, 2026
25 checks passed
@0crat

0crat commented Apr 16, 2026

Copy link
Copy Markdown

@maxonfjvipon Great work on your contribution! 🎉 You've earned +12 points (+16 base, -4 for 187 hits-of-code exceeding our 100 limit). Your total score is now +60 - keep the momentum going and don't forget to check your Zerocracy account for updates!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MjSafe classDir option has incorrect default value

4 participants