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

Java app build extension #348

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Java app build extension #348

wants to merge 1 commit into from

Conversation

aaronpowell
Copy link
Member

This uses an event to run the mvnw build (or it can be customised via options), so it is only used when the app host is running the resource

Closes #339

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration
    • Docs are written
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

This uses an event to run the mvnw build (or it can be customised via options), so it is only used when the app host is running the resource

Fixes #339
@aaronpowell aaronpowell added the integration A new .NET Aspire integration label Dec 24, 2024
@aaronpowell aaronpowell deployed to azure-artifacts December 24, 2024 00:45 — with GitHub Actions Active
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.EventStore 100% 100% 46
CommunityToolkit.Aspire.Hosting.ActiveMQ 60% 24% 104
CommunityToolkit.Aspire.Hosting.ActiveMQ.MassTransit 1% 0% 14
CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder 100% 100% 22
CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps 100% 100% 28
CommunityToolkit.Aspire.Hosting.Bun 81% 71% 54
CommunityToolkit.Aspire.Hosting.Deno 84% 75% 72
CommunityToolkit.Aspire.Hosting.EventStore 90% 71% 62
CommunityToolkit.Aspire.Hosting.Golang 94% 50% 16
CommunityToolkit.Aspire.Hosting.Java 62% 69% 68
CommunityToolkit.Aspire.Hosting.Meilisearch 61% 27% 94
CommunityToolkit.Aspire.Hosting.NodeJS.Extensions 90% 68% 92
CommunityToolkit.Aspire.Hosting.Ollama 65% 64% 198
CommunityToolkit.Aspire.Hosting.Python.Extensions 67% 46% 56
CommunityToolkit.Aspire.Hosting.Rust 94% 83% 16
CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects 72% 64% 58
CommunityToolkit.Aspire.MassTransit.RabbitMQ 100% 100% 30
CommunityToolkit.Aspire.Meilisearch 97% 92% 68
CommunityToolkit.Aspire.OllamaSharp 87% 82% 68
Summary 74% (2383 / 3206) 63% (579 / 916) 1166

Minimum allowed line rate is 60%

State = new($"mvnw exited with {mvnw.ExitCode}", KnownResourceStates.FailedToStart)
}).ConfigureAwait(false);

throw new InvalidOperationException($"mvnw build failed with exit code {mvnw.ExitCode}");

Choose a reason for hiding this comment

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

Why throw?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's how I've seen other hooks implemented in the past.

Choose a reason for hiding this comment

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

Where does this show up? Wouldn't it be better to show it in the dashboard? Also what happens when the build fails? Do I need to restart the entire apphost to rebuild or can I trigger it from the dashboard? (custom command)

Worth thinking through that I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

The notification service reporting shows up on the dashboard and I think the exception bubbles to the console of the resource that it was relative for.

A custom command would be a good idea to run a rebuild, I'll add that.

private static IResourceBuilder<JavaAppExecutableResource> WithJavaDefaults(
this IResourceBuilder<JavaAppExecutableResource> builder,
JavaAppExecutableResourceOptions options) =>
builder.WithOtlpExporter()

Choose a reason for hiding this comment

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

Does this work without making https work?

Copy link
Member Author

Choose a reason for hiding this comment

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

Without HTTPS on the dashboard?

Choose a reason for hiding this comment

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

Yea does this work right now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I assume so 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration A new .NET Aspire integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Java as a build dependency
2 participants