Skip to content

PEG-2766 Migrate progression from cp-file-service to Azure Blob Storage#322

Open
allanmckenzie wants to merge 2 commits into
team/PEG-2766from
byo-file-store
Open

PEG-2766 Migrate progression from cp-file-service to Azure Blob Storage#322
allanmckenzie wants to merge 2 commits into
team/PEG-2766from
byo-file-store

Conversation

@allanmckenzie
Copy link
Copy Markdown

Summary

  • Replaces cp-file-service (shared PostgreSQL BLOB store) with direct Azure Blob Storage SDK v12 across progression-event-processor and progression-command-api
  • Each uploaded file uses its UUID as the blob name in the shared progression-files container
  • fileServiceId field name is preserved in all schemas for backward compatibility with unmigrated producers

Changes

progression-event-processor (previous commit)

  • FileService, FileUtil, DocumentGeneratorService, NotificationService migrated from FileStorer/FileRetriever to BlobContainerClient
  • CourtRegisterEventProcessor, NotificationNotifyEventProcessor, OnlinePleaEventProcessor, SystemDocGeneratorEventProcessor updated
  • AzureBlobConfiguration + AzureBlobContainerClientProducer CDI beans added (JDK HTTP transport; avoids WildFly Netty conflict)

progression-command-api (this commit)

  • ProgressionServiceFileInterceptor replaces InputStreamFileInterceptor — streams multipart upload bytes directly to Azure, injects UUID as fileServiceId
  • CDI ambiguity fix: removed duplicate producer beans from progression-command-api; single-WAR deployment now has one @Produces BlobContainerClient (WELD-001409)
  • AzureBlobContainerClientProducer catch block aligned with platform pattern (HttpResponseException 409 = container exists, rethrow others)
  • FILE_STORE_HEALTHCHECK_NAME added to ignored healthchecks provider

Infrastructure

  • runIntegrationTests.sh updated to start Azurite Docker profile (--profile azurite) — required for blob storage operations during IT runs

Test plan

  • All 29 modules build and unit tests pass (mvn clean test)
  • WAR deploys to WildFly without WELD-001409 error
  • 337/342 integration tests pass — 5 pre-existing failures on this branch unrelated to file store migration (AddDefendantsToCourtProceedings, AddDefendantsToHearing, ReceiveRepresentationOrder, RequestFirstHearingCaseSummons — schema/data issues present before this work)
  • Azure Blob container progression-files created on startup via createIfNotExists()

Outstanding (not blocking merge)

  • AKS JNDI config: azure.filestore.endpoint + container name not yet in AKS manifests
  • IaC: Azure RBAC for progression-files container not yet provisioned (BYOFS-1.1)
  • file-alfresco and file-api deps in progression-command-api/pom.xml — confirm whether still needed before removing

…Azure Blob Storage SDK v12

Replaces FileStorer/FileRetriever (PostgreSQL-backed cp-file-service) with a BYO
Azure Blob Storage container. Each uploaded file uses its UUID as the blob name,
with fileName/templateName stored as blob metadata.

Key changes:
- New AzureBlobConfiguration and AzureBlobContainerClientProducer CDI beans
  (JDK HTTP transport; @dependent producer to avoid WELD-001410 on final class)
- FileService, FileUtil, DocumentGeneratorService, CourtRegisterEventProcessor,
  OnlinePleaEventProcessor, NotificationNotifyEventProcessor and
  SystemDocGeneratorEventProcessor all migrated to BlobContainerClient
- All unit tests updated to mock BlobContainerClient/BlobClient instead of FileStorer
- Root pom.xml: parent bumped to service-parent-pom 17.104.3; azure-core-http-jdk-httpclient
  version property + dependencyManagement entry added
…DI ambiguity

- Add ProgressionServiceFileInterceptor: replaces InputStreamFileInterceptor,
  uploads multipart file bytes directly to Azure Blob Storage via BlobContainerClient,
  injects UUID as fileServiceId in the command envelope
- Add ProgressionCommandApiInterceptorChainProvider registering the interceptor at
  priority 6000
- Remove duplicate AzureBlobContainerClientProducer and AzureBlobConfiguration from
  progression-command-api (were causing WELD-001409 ambiguous dependency on the
  single-WAR deployment); event-processor's producer now serves the entire WAR
- Fix AzureBlobContainerClientProducer catch block: HttpResponseException + 409 check
  matches the platform pattern (other migrated contexts); rethrows non-409 errors
- Add FILE_STORE_HEALTHCHECK_NAME to ProgressionIgnoredHealthcheckNamesProvider
- Update runIntegrationTests.sh to start azurite Docker profile alongside es profile
- Add progression-domain-message as POJO generator plugin dep in command-handler pom
  to resolve listing schema $ref at code generation time
- Add unit tests: ProgressionServiceFileInterceptorTest,
  ProgressionCommandApiInterceptorChainProviderTest, AzureBlobConfigurationTest,
  AzureBlobContainerClientProducerTest (updated for HttpResponseException pattern)
@allanmckenzie allanmckenzie requested a review from a team as a code owner May 27, 2026 10:39
@allanmckenzie allanmckenzie requested review from juzerdhanerawala, sridhar-gopu-hmcts and sriniJavaGit and removed request for a team May 27, 2026 10:39
@cpp-github-management
Copy link
Copy Markdown

Failed

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.

1 participant