Skip to content

EES-5962 On Release Slug changed - Event Handler Function #5750

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

Merged
merged 3 commits into from
Apr 3, 2025

Conversation

leeoades
Copy link
Collaborator

@leeoades leeoades commented Apr 2, 2025

For the final part of this ticket, added a new event handler function app for receiving and handling OnReleaseSlugChanged events.

Added On Release Slug changed event handler function.
Added event handler OnReleaseSlugChanged.
Made all properties for the dtos nullable since the serialiser will not respect the "required" keyword.
Added null guards where appropriate
Added Tests for all of the functions.

Comment on lines -46 to -48
<ItemGroup>
<Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
</ItemGroup>
Copy link
Collaborator

Choose a reason for hiding this comment

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

According to the docs on functions running with the isolated worker model, we should add this. Just wondering what's the reason for removing it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, this is odd. It's causing an error on my solution analysis. I've restored it.

image

Comment on lines -5 to +9
public required string PublicationSlug { get; init; }
public required Guid ReleaseId {get;init;}
public required string ReleaseSlug { get; init; }
public required Guid ReleaseVersionId { get; init; }
public required string BlobName { get; init; }
public string? PublicationSlug { get; init; }
public Guid? ReleaseId {get;init;}
public string? ReleaseSlug { get; init; }
public Guid? ReleaseVersionId { get; init; }
public string? BlobName { get; init; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like these could stay as required and non optional, because I think the only place where we create one we are guaranteed to have all the values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These messages come from the queue so there's no guarantee of their contents. Better to code defensively and acknowledge that than to assume it will always be ok (== guarantee that it won't always be!)

leeoades added 2 commits April 3, 2025 14:42
…lls into the properties whether you like it or not)

Added On Release Slug changed event handler function.
Also made all properties for the dtos nullable since the serialiser will not respect the "required" keyword.
Added event handler OnReleaseSlugChanged.
Added Tests for all of the functions.
@leeoades leeoades force-pushed the EES-5962-on-release-slug-changed-functions branch from 6d01098 to f31e75f Compare April 3, 2025 13:58
@leeoades leeoades merged commit 3a63ec7 into dev Apr 3, 2025
4 checks passed
@leeoades leeoades deleted the EES-5962-on-release-slug-changed-functions branch April 3, 2025 14:28
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