Skip to content

Raise notification on job completion and improve S3 wiring#45

Merged
donaldgray merged 6 commits into
mainfrom
feature/complete_notification
May 26, 2026
Merged

Raise notification on job completion and improve S3 wiring#45
donaldgray merged 6 commits into
mainfrom
feature/complete_notification

Conversation

@donaldgray
Copy link
Copy Markdown
Member

Summary

  • Adds SNS job completion notifications — publishes a message to a configurable topic ARN when a job completes or fails; no-ops when unconfigured (NullJobNotifier)
  • Improves S3 service registration to use idiomatic AddAWSService<IAmazonS3>() with IOptions<S3TextStoreOptions> injection, removing the duplicate S3StorageOptions class
  • AWS services (S3 and SNS) are now conditionally registered to avoid the SDK credential chain hanging in test environments
  • Extracts service registrations from Program.cs into ServiceCollectionExtensions alongside the existing Hangfire extensions
  • Adds dotnet format analyzers CI step to enforce editorconfig rules (e.g. csharp_prefer_braces) that the pre-commit hook misses
  • Documents S3 storage configuration in docs/builder-api.md

Test plan

  • Unit tests pass: dotnet test src/TextServices.sln
  • CI format and analyzer checks pass
  • With TextServices:Notifications:TopicArn unset, jobs complete without error (NullJobNotifier)
  • With a valid SNS topic ARN configured, a notification is published on job completion and failure
  • With TextServices:Storage:S3:BucketName set, S3TextStore is used; without it, FileSystemTextStore is used
  • Tests do not hang (AWS credential chain not triggered without S3/SNS config)

🤖 Generated with Claude Code

donaldgray and others added 6 commits May 26, 2026 12:53
S3StorageOptions was a duplicate of S3TextStoreOptions introduced when
wiring up config. Register S3TextStoreOptions via Configure<> so
S3TextStore can accept IOptions<S3TextStoreOptions> and be created via
ActivatorUtilities, consistent with SnsJobNotifier. Also conditionally
register AWS services to avoid credential chain hanging in tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Consolidates all IServiceCollection extension methods into a single
ServiceCollectionExtensions class, replacing the separate
HangfireServiceCollectionExtensions file. Adds AddAwsServices,
AddFetchingServices, AddTextStorage, and AddNotificationServices to
keep Program.cs a clean list of Add* calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add dotnet format analyzers step to CI to enforce editorconfig rules
(e.g. csharp_prefer_braces = when_multiline) that the pre-commit hook
misses. Fix the existing violation in ServiceCollectionExtensions.cs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@donaldgray donaldgray merged commit e687d50 into main May 26, 2026
4 checks passed
@donaldgray donaldgray deleted the feature/complete_notification branch May 26, 2026 14:07
@donaldgray donaldgray linked an issue May 27, 2026 that may be closed by this pull request
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.

Raise notification on completion

1 participant