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

feat: Add NotifyOrchestrationInstance trigger to Api #102

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

ebbeknudsen
Copy link
Contributor

@ebbeknudsen ebbeknudsen commented Jan 15, 2025

Description

  • Update protobuf types to provide methods that serializes and deserializes it's data
  • Add NotifyOrchestrationInstanceTrigger
  • Add INotifyOrchestrationInstanceCommands and implement NotifyOrchestrationInstanceAsync
  • Refactor service bus providers in tests to enable sharing service bus topics between test applications

References

Link to assignment:

Checklist

  • Should the change be behind a feature flag?
  • Can the feature be meaningfully disabled or circumvented if there are issues (e.g., database-breaking changes)?
  • Has it been considered whether data is being delivered to the wrong actor?
  • Subsystem test executed (dev_002/dev_003)
  • Is there time to monitor state of the release to Production?
  • Reference to the task

Copy link
Contributor

@dstenroejl dstenroejl left a comment

Choose a reason for hiding this comment

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

Added some comments.

I did not review the app manages / fixtures changes; I guess it's ok for now. :D

Comment on lines +32 to +34
/// <summary>
/// Start a BRS-026 request.
/// </summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this comment can be removed?

Comment on lines +48 to +51
nameof(majorVersion),
majorVersion,
$"Unhandled major version in received notify service bus message (MessageId={message.MessageId})"),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I prefer the indention to only be 4 chars

Comment on lines +94 to +102
{
Data =
{
{ nameof(message.MessageId), message.MessageId },
{ nameof(message.Subject), message.Subject },
{ "MajorVersion", message.TryGetMajorVersion() },
{ "TargetType", typeof(TMessage).Name },
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

If this belongs to the exception, it needs to be indented 4 chars I believe

Comment on lines +20 to +24
public enum ServiceBusMessageBodyFormat
{
Binary = 1,
Json = 2,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we move this to a separate file?

public static TMessage ParseMessageBody<TMessage>(this ServiceBusReceivedMessage message)
where TMessage : IMessage<TMessage>, new()
{
var bodyFormat = message.GetBodyFormat();
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a lot of validation in various methods, so its a bit difficult to parse if it actually makes sense. But I believe that the GetBodyFormat will throw an exception if the format is unexpected, so I don't think the switch on bodyFormat can ever throw the ArgumentOutOfRangeException.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct, however switch expressions requires a default (_) arm.

@@ -32,4 +32,8 @@
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe remove this from current PR

Comment on lines +11 to +12

<ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe remove this from current PR

Copy link
Contributor

Choose a reason for hiding this comment

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

This filename is incorrect or at least not matching the class name.

Should this perhaps be moved to another PR?

try
{
context.SetCustomStatus(CustomStatus.WaitingForEnqueueActorMessages);
await context.WaitForExternalEvent<int?>(
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for <int?>, or am I missing somthing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The method requires a type parameter, I couldn't find any without one.

Comment on lines +147 to +148
await context.WaitForExternalEvent<int?>(
eventName: RequestCalculatedWholesaleServicesNotifyEventsV1.EnqueueActorMessagesCompleted,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need <int?>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The method requires a type parameter, I couldn't find any without one.

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