-
Notifications
You must be signed in to change notification settings - Fork 0
Send-only endpoint attribute with declarative connection configuration #113
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
Open
andreasohlund
wants to merge
24
commits into
main
Choose a base branch
from
send-only-endpoints
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,520
−534
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a51e2b0
First approach with incorectly reused generator
andreasohlund 5858056
Fixup
andreasohlund 12c835b
Add separate SendOnlyEndpointGenerator
andreasohlund bc00999
Separate generator for send only
andreasohlund 6fec1dd
Fix formatting issues in approved test files and ensure proper closur…
andreasohlund 65a2564
Fix function generator file formatting
andreasohlund 334a3b6
Refactor usings in tests and remove global usings for clarity
andreasohlund b87c5eb
Refactor attribute handling and diagnostics in endpoint generators
danielmarbach 5ee24c7
Implement IDiagnosticsSpec interface and refactor diagnostic collecti…
danielmarbach e33aa99
Add tests for SendOnlyEndpointGenerator and validate endpoint generat…
danielmarbach 2393be0
Add AssertRunsAreEqual to all generator approval tests
danielmarbach a4e76b3
Remove unused using directive from FunctionEndpointGenerator
danielmarbach 0c7f320
Inline SendOnlyEndpointDefinition into static Select lambda
danielmarbach 129707c
Hardcode registration method name in SendOnlyEndpointDefinition
danielmarbach d68f79c
Remove file specification and unnecessary using
danielmarbach 32ed16d
Remove the send-only API name
danielmarbach c340d96
Inline trigger definition to have a pure incremental pipeline
danielmarbach 18f5c88
Comment for ourselves in the future
danielmarbach 020fb12
Reduce complexity in the configuration analyzer because now that we h…
danielmarbach 9f1395f
fix connection setting assignment
danielmarbach 496f20d
Approve
danielmarbach 135bcb9
Support inferring the connection automatically
danielmarbach 41cc7cd
Trigger
danielmarbach 3684839
Rename NServiceBusSendOnlyEndpointAttribute to NServiceBusSendOnlyFun…
danielmarbach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| namespace IntegrationTestApp; | ||
|
|
||
| using IntegrationTest.Shared; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
|
|
||
| public static class ClientEndpoint | ||
| { | ||
| [NServiceBusSendOnlyFunction("client", Connection = "AzureWebJobsServiceBus")] | ||
| public static void ConfigureClient(EndpointConfiguration endpointConfiguration, IServiceCollection services) | ||
| { | ||
| services.AddSingleton(new MyComponent("client")); | ||
|
|
||
| var transport = new AzureServiceBusServerlessTransport(TopicTopology.Default); | ||
|
|
||
| var routing = endpointConfiguration.UseTransport(transport); | ||
|
|
||
| routing.RouteToEndpoint(typeof(SubmitOrder), "sales"); | ||
| endpointConfiguration.UseSerialization<SystemJsonSerializer>(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
291 changes: 45 additions & 246 deletions
291
src/NServiceBus.AzureFunctions.Analyzer/ConfigurationAnalyzer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| namespace NServiceBus.AzureFunctions.Analyzer; | ||
|
|
||
| using Core.Analyzer; | ||
| using Microsoft.CodeAnalysis; | ||
|
|
||
| interface IDiagnosticsSpec | ||
| { | ||
| ImmutableEquatableArray<Diagnostic> Diagnostics { get; } | ||
| } |
24 changes: 24 additions & 0 deletions
24
src/NServiceBus.AzureFunctions.Analyzer/DiagnosticsSpecExtensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| namespace NServiceBus.AzureFunctions.Analyzer; | ||
|
|
||
| using System.Collections.Immutable; | ||
| using Core.Analyzer; | ||
| using Microsoft.CodeAnalysis; | ||
|
|
||
| static class DiagnosticsSpecExtensions | ||
| { | ||
| public static IEnumerable<Diagnostic> ToDiagnostics<T>(this ImmutableArray<T> results) where T : IDiagnosticsSpec | ||
| { | ||
| // DiagnosticWithInfo implements structural equality (Location, Info, AdditionalLocations) | ||
| // so HashSet deduplicates correctly. ImmutableEquatableArray enables incremental caching: | ||
| // unchanged documents reuse the same SyntaxTree references, so diagnostics compare equal | ||
| // across steps. Within an edited file, new tree references cause re-reporting, which is | ||
| // correct and cheap. | ||
| var diagnostics = new HashSet<Diagnostic>(); | ||
| foreach (var result in results) | ||
| { | ||
| diagnostics.UnionWith(result.Diagnostics); | ||
| } | ||
|
|
||
| return diagnostics.ToImmutableEquatableArray(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavidBoike this needs some editorial love