[ 
https://issues.apache.org/jira/browse/GROOVY-12403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18114710#comment-18114710
 ] 

ASF GitHub Bot commented on GROOVY-12403:
-----------------------------------------

codecov-commenter commented on PR #2927:
URL: https://github.com/apache/groovy/pull/2927#issuecomment-5650593037

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2927?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `87.96296%` with `26 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 71.4157%. Comparing base 
([`3246257`](https://app.codecov.io/gh/apache/groovy/commit/32462579e2689374115525c2ac3e50a1ad86dfb5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`fb2a8fc`](https://app.codecov.io/gh/apache/groovy/commit/fb2a8fc20f4de9520a125568cc39bc42471f91bc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 8 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2927?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...main/groovy/org/apache/groovy/groovysh/Main.groovy](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&filepath=subprojects%2Fgroovy-groovysh%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fapache%2Fgroovy%2Fgroovysh%2FMain.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWdyb292eXNoL3NyYy9tYWluL2dyb292eS9vcmcvYXBhY2hlL2dyb292eS9ncm9vdnlzaC9NYWluLmdyb292eQ==)
 | 62.2222% | [12 Missing and 5 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...apache/groovy/groovysh/ExtraConsoleCommands.groovy](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&filepath=subprojects%2Fgroovy-groovysh%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fapache%2Fgroovy%2Fgroovysh%2FExtraConsoleCommands.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWdyb292eXNoL3NyYy9tYWluL2dyb292eS9vcmcvYXBhY2hlL2dyb292eS9ncm9vdnlzaC9FeHRyYUNvbnNvbGVDb21tYW5kcy5ncm9vdnk=)
 | 89.4118% | [5 Missing and 4 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2927/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2927        +/-   ##
   ==================================================
   + Coverage     71.1971%   71.4157%   +0.2186%     
   - Complexity      37729      37819        +90     
   ==================================================
     Files            1584       1586         +2     
     Lines          136500     136610       +110     
     Branches        25361      25382        +21     
   ==================================================
   + Hits            97184      97561       +377     
   + Misses          30546      30231       -315     
   - Partials         8770       8818        +48     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2927?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...vy/org/apache/groovy/groovysh/GroovyshOptions.java](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&filepath=subprojects%2Fgroovy-groovysh%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fapache%2Fgroovy%2Fgroovysh%2FGroovyshOptions.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWdyb292eXNoL3NyYy9tYWluL2dyb292eS9vcmcvYXBhY2hlL2dyb292eS9ncm9vdnlzaC9Hcm9vdnlzaE9wdGlvbnMuamF2YQ==)
 | `100.0000% <100.0000%> (ø)` | |
   | 
[...org/apache/groovy/groovysh/jline/GroovyEngine.java](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&filepath=subprojects%2Fgroovy-groovysh%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fapache%2Fgroovy%2Fgroovysh%2Fjline%2FGroovyEngine.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWdyb292eXNoL3NyYy9tYWluL2dyb292eS9vcmcvYXBhY2hlL2dyb292eS9ncm9vdnlzaC9qbGluZS9Hcm9vdnlFbmdpbmUuamF2YQ==)
 | `24.8199% <100.0000%> (+7.1337%)` | :arrow_up: |
   | 
[...apache/groovy/groovysh/ExtraConsoleCommands.groovy](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&filepath=subprojects%2Fgroovy-groovysh%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fapache%2Fgroovy%2Fgroovysh%2FExtraConsoleCommands.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWdyb292eXNoL3NyYy9tYWluL2dyb292eS9vcmcvYXBhY2hlL2dyb292eS9ncm9vdnlzaC9FeHRyYUNvbnNvbGVDb21tYW5kcy5ncm9vdnk=)
 | `89.4118% <89.4118%> (ø)` | |
   | 
[...main/groovy/org/apache/groovy/groovysh/Main.groovy](https://app.codecov.io/gh/apache/groovy/pull/2927?src=pr&el=tree&filepath=subprojects%2Fgroovy-groovysh%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fapache%2Fgroovy%2Fgroovysh%2FMain.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWdyb292eXNoL3NyYy9tYWluL2dyb292eS9vcmcvYXBhY2hlL2dyb292eS9ncm9vdnlzaC9NYWluLmdyb292eQ==)
 | `75.6757% <62.2222%> (+59.8654%)` | :arrow_up: |
   
   ... and [18 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2927/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> Restore groovysh embedding extension points
> -------------------------------------------
>
>                 Key: GROOVY-12403
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12403
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>
> h3. Context
> The Gremlin Console (Apache TinkerPop) embeds groovysh. In Groovy 4, a host 
> could install an {{ImportCustomizer}} and 
> {{ASTTransformationCustomizer(ThreadInterrupt)}} on Groovysh's 
> {{CompilerConfiguration}}, and extend the command set. The Groovy 5 rewrite 
> onto JLine 3 (GROOVY-8162) removed those seams.
> Reported on the dev list: 
> [https://lists.apache.org/thread/c66x4p4mhvmk7dojhddywzsgr4gpngs5]
> h3. What's missing
> # *Compiler configuration.* {{GroovyEngine}} builds the shell as {{new 
> GroovyShell(classLoader, sharedData)}} with no configuration. 
> {{CompilerConfiguration.DEFAULT}} is immutable, so there is no back door. 
> Executing {{import}} statements works, but the engine records them as 
> snippets and re-prepends them on every evaluation — expensive when the host 
> preloads dozens of star / static-star imports.
> # *Embedding hooks on Main.* The Map overload of {{Main.start}} only takes 
> binding variables. Terminal, registries, prompt, banner, result printing, and 
> error handling are hardcoded. Hosts copy roughly 230 lines of {{Main}} and 
> re-diff them against every Groovy release.
> # *ExtraConsoleCommands visibility.* {{/clear}}, {{/pwd}}, {{/cd}}, the 
> POSIX-style commands, and {{/!}} live in a protected nested class. That 
> compiles from another package in Groovy, but not from Java or under 
> {{@CompileStatic}}.
> # *Class loader access.* The engine class loader field is protected. A getter 
> avoids a subclass whose only job is to read it (Grape + {{ServiceLoader}} 
> plugin install).
> h3. Direction
> Keep the binding map as bindings only. Do *not* add magic keys — they collide 
> with user variables and are awkward from Java.
> * {{GroovyEngine(CompilerConfiguration)}} and a protected {{createShell}} 
> override, so customizers apply at compile time instead of as snippets.
> * {{GroovyshOptions}} plus {{Main.start(GroovyshOptions, ...)}} for extra 
> {{CommandRegistry}} instances, a prompt supplier, result and error handlers, 
> a banner toggle, and an optional {{Terminal}}.
> * {{ExtraConsoleCommands}} as a public top-level class; keep 
> {{Main.ExtraConsoleCommands}} as a deprecated subclass for existing Groovy 
> callers.
> * {{GroovyEngine.getClassLoader()}}.
> Mark {{GroovyshOptions}} incubating so the shape can still settle after a 
> first embedder uses it.
> h3. Example
> {code:groovy}
> def config = new CompilerConfiguration()
> config.addCompilationCustomizers(
>     new ImportCustomizer().addStarImports('java.util.concurrent.atomic'),
>     new ASTTransformationCustomizer(ThreadInterrupt))
> Main.start(GroovyshOptions.builder()
>     .compilerConfiguration(config)
>     .prompt { 'gremlin> ' }
>     .showBanner(false)
>     .build(), args)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to