Skip to content

Add NATS support for Async Minion and secretName for remote artifact import - #148

Open
versussun wants to merge 3 commits into
microcks:mainfrom
versussun:main
Open

Add NATS support for Async Minion and secretName for remote artifact import#148
versussun wants to merge 3 commits into
microcks:mainfrom
versussun:main

Conversation

@versussun

Copy link
Copy Markdown

Description

  • Add WithNatsConnection() extension to configure the Microcks Async Minion against a NATS broker (server, port, optional username/password), following the same pattern as the existing MQTT connection helper, and mark NATS as supported (✅) in the README features table.
  • Add a secretName parameter to ImportRemoteArtifactAsync / IDownloadArtifactEndpoint.DownloadArtifactAsync so remote artifact imports can authenticate against a Microcks-registered secret, and pass it through from RemoteArtifact annotations in MicrocksApplicationEventingSubscriber.
  • Document NATS usage (connection setup, required AsyncAPI nats binding, credentials, contract testing example) in the README.
  • Add unit tests covering NATS-only configuration, NATS with credentials, and NATS combined with Kafka in ASYNC_PROTOCOLS.

Related issue(s)

Test results

dotnet test → 40 passed, 1 failed, 41 total.

Failed: Microcks.Aspire.Tests.Features.Async.Kafka.MicrocksKafkaTests.WhenBadMessageIsSent_ThenReturnsCorrectStatus
Pre-existing test, unrelated to this change (file not touched by this PR). Fails consistently locally
due to a fixed 500ms delay + events.Count >= 4 timing assumption that appears sensitive to local
container/environment speed; reproduced identically in isolation.

All new NATS-related unit tests pass:

  • WhenOnlyNatsIsConfigured_ThenAsyncProtocolsContainsNats
  • WhenNatsIsConfiguredWithCredentials_ThenUsernameAndPasswordAreSet
  • WhenNatsAndKafkaAreConfigured_ThenAsyncProtocolsContainsAll

Copilot AI lite review requested due to automatic review settings August 11, 2026 07:21
@github-actions

Copy link
Copy Markdown

👋 @versussun

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly.

Hope you have a great time there!

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.

Pull request overview

This PR extends the Microcks Aspire integration by adding NATS support for the Async Minion configuration and by enhancing remote artifact import to optionally authenticate using a Microcks-registered secret.

Changes:

  • Added WithNatsConnection() to configure Async Minion environment variables for NATS and appended NATS to ASYNC_PROTOCOLS.
  • Extended remote artifact import APIs to accept a secretName and wired it through from remote artifact annotations to the download endpoint call.
  • Updated README documentation to describe NATS usage and marked NATS as supported in the features table; added unit tests for NATS protocol configuration.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Microcks.Aspire.Tests/Features/Async/MicrocksAsyncProtocolsConfigurationTests.cs Adds unit tests validating NATS environment variable/protocol list configuration.
src/Microcks.Aspire/MicrocksAsyncMinionExtensions.cs Introduces WithNatsConnection() and ASYNC_PROTOCOLS updates for NATS.
src/Microcks.Aspire/MicrocksApplicationEventingSubscriber.cs Passes SecretName through when importing remote artifacts.
src/Microcks.Aspire/Clients/MicrocksClient.cs Threads secretName through to the download endpoint call.
src/Microcks.Aspire/Clients/IMicrocksClient.cs Updates public client API to include secretName for remote artifact import.
src/Microcks.Aspire/Clients/IDownloadArtifactEndpoint.cs Adds optional secretName query parameter to the download API call.
README.md Documents NATS usage and updates supported protocols table.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Microcks.Aspire/MicrocksAsyncMinionExtensions.cs
Comment thread README.md
var builder = DistributedApplication.CreateBuilder(args);

// Add a NATS broker
var nats = builder.AddNats("nats");
Comment thread src/Microcks.Aspire/Clients/IMicrocksClient.cs
versussun and others added 2 commits August 11, 2026 10:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Вячеслав <versussun@gmail.com>
@versussun

Copy link
Copy Markdown
Author

@SebastienDegodez @lbroudoux Guys please aproove PR. It blocks me. Because I need secret authorization. I`ve checked it in Azure DevOps and it is working fine. And also can you push it to NUGET. Please.

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