Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run the MergeYaml recipe in Moderne CLI #5134

Open
fcebk17 opened this issue Mar 5, 2025 · 0 comments
Open

Failed to run the MergeYaml recipe in Moderne CLI #5134

fcebk17 opened this issue Mar 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@fcebk17
Copy link

fcebk17 commented Mar 5, 2025

What version of OpenRewrite are you using?

I am using

  • Moderne CLI 3.26.2

How are you running OpenRewrite?

I want to add snippets to application.yml. Below is the command I use in Moderne CLI.

mod run . --recipe MergeYaml --recipe-option "key=$.server.servlet" --recipe-option "yaml='application-display-name:"application"'"

What is the smallest, simplest way to reproduce the problem?

server:
  port: 8080
  servlet:
    context-path: /api

What did you expect to see?

server:
  port: 8080
  servlet:
    context-path: /api
    application-display-name: application

What did you see instead?

server:
  port: 8080
  servlet:
    context-path: /api

What is the full stack trace of any errors you encountered?

popocorn@popocorn:~/output/AdminService$ mod run . --recipe MergeYaml --recipe-option "key=$.server.servlet" --recipe-option "yaml='application-display-name:"application"'"
 @@@@          @@
 @    @@@   @@  @
 @      @  @@   @
 @@@@@@@@@@@@@@@@
 @     @ @      @
 @   @@  @@@@@@@@
 @ @@    @      @
 @@@@@@@@@@@@@@@@
Moderne CLI 3.26.2

> Selecting repositories

> Sirajuddin135/E-Commerce-Application@main
Selected 1 repository (0.01s)

> Running recipe org.openrewrite.yaml.MergeYaml

Mar 05, 2025 5:52:13 PM io.micrometer.core.instrument.binder.jvm.JvmGcMetrics isGarbageCollectorNotificationsAvailable
WARNING: GC notifications will not be available because no GarbageCollectorMXBean of the JVM provides any. GCs=[young generation scavenger, complete scavenger]
> Sirajuddin135/E-Commerce-Application@main
    ! Recipe run produced an error. Since this is the first error, its stack trace will be shown at the completion of the run. An error log was created at file:///home/popocorn/output/AdminService/.moderne/run/20250305175213-Jr0YV/run-error.log
    No changes
 
No results found; 1 repository generated errors (2s)

24s saved by using previously built LSTs

FAILURE: mod failed with an exception

* Where:
org.openrewrite.polyglot.RemoteException: java.lang.ClassCastException: class org.openrewrite.tree.ParseError cannot be cast to class org.openrewrite.yaml.tree.Yaml$Documents (org.openrewrite.tree.ParseError and org.openrewrite.yaml.tree.Yaml$Documents are in unnamed module of loader 'app')
  org.openrewrite.polyglot.RemoteProgressBarReceiver.maybeThrow(RemoteProgressBarReceiver.java:136)
  org.openrewrite.polyglot.RemoteProgressBarReceiver.close(RemoteProgressBarReceiver.java:130)
  io.moderne.cli.commands.Run.runRecipe(Run.java:355)
  io.moderne.cli.commands.Run.runAndShowNextSteps(Run.java:129)
  io.moderne.cli.commands.Run.run(Run.java:114)
  io.moderne.cli.commands.StandardCommand.call(StandardCommand.java:136)
  io.moderne.cli.commands.StandardCommand.call(StandardCommand.java:39)
  picocli.CommandLine.executeUserObject(CommandLine.java:2045)
  ...

* What went wrong:
A repository failed to run. The exception for the failure on Sirajuddin135/E-Commerce-Application@main is shown above.

* Try:
> Report to [email protected]


MOD FAILED in (2s)

Are you interested in contributing a fix to OpenRewrite?

@fcebk17 fcebk17 added the bug Something isn't working label Mar 5, 2025
@fcebk17 fcebk17 changed the title Failed to run the MergeYamlrecipe in Moderne CLI Failed to run the MergeYaml recipe in Moderne CLI Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant