Skip to content

[PHEE-417] Make the configuration records required again - #5

Merged
tdaly61 merged 1 commit into
openMF:devfrom
GiulioRinalduzzi:refactor/phee-417-bulk-processor-failfast
Oct 7, 2026
Merged

tdaly61 merged 1 commit into
openMF:devfrom
GiulioRinalduzzi:refactor/phee-417-bulk-processor-failfast

Conversation

@GiulioRinalduzzi

Copy link
Copy Markdown
Contributor

Follow-up to #4. The two configuration records that #4 added bind the configuration but do not check it, so a missing key no longer stops startup. This PR makes every key in them required again, as it was before #4, and adds the binding test the rest of the PHEE-417 series has.

What was wrong

#4 was merged before the series went back to @Validated + @NotNull, so its records (OperationsAppProperties and IdentityAccountMapperProperties) have neither. So today, on dev, a missing key binds to null and the processor starts. The URL it builds then ends in null, and the problem shows up only at the first call.

Before #4, these twelve keys were read through nineteen bare @Value declarations, none of them with a default, so a missing key stopped startup.

What changes

  • Both records are @Validated. Every component is @NotNull, and the operations-app endpoints group is @Valid, so the check also reaches the keys inside it.
  • spring-boot-starter-validation is added, with the version from the BOM. Nothing on the classpath provided Bean Validation, and without it @Validated does nothing.
  • ConfigurationPropertiesTest now also sets operations-app.username and password in its shared configuration, because they are required.
  • New ShippedConfigBindsTest, the same kind of test as in the channel, ams-mifosx, mm-gsma, mojaloop and connector-bulk PRs.

No code that reads the records changes, and no property name changes. The other @Value in this processor are not touched here.

Result

How it was checked

Build. ./gradlew clean build with JDK 21.0.10: green, including spotless and checkstyle. 9 tests: 4 new in ShippedConfigBindsTest, 3 in ConfigurationPropertiesTest, plus one each in BulkProcessorApplicationTests and CucumberContext.

The new test. ShippedConfigBindsTest binds the two records from the real application.yaml and checks the URLs they build. That includes the identity_account_mapper keys, which the file spells with underscores. It checks that each record, on its own and with nothing configured, refuses to start and names its prefix. It checks that a key missing inside the endpoints group stops startup, and that an empty String is accepted. To check that the tests can fail, they were run against two broken copies of the code. Without @Validated on IdentityAccountMapperProperties, everyRecordRefusesToStartWhenItsSectionIsMissing fails. Without @Valid on the endpoints group, aMissingKeyInsideAGroupStopsStartup fails.

What the deployment passes (gazelle3). The ph-ee-bulk-processor Deployment, from its CR, sets 34 variables and mounts the ph-ee-config configmap with profile bb. Two of them are empty, IDENTITY_MAPPER_CONTACTPOINT and CONFIG_ORDERING_FIELD. Both are strings, and neither is read by these records. Of the keys these records read, the Deployment sets OPERATIONS_APP_CONTACTPOINT and OPERATIONS_APP_ENDPOINTS_BATCH_TRANSACTION, and the rest comes from application.yaml.

Temporary pods on gazelle3. Each pod used the Deployment's own image (eclipse-temurin:21), environment and configmap, copied as they are, with the jar mounted. There was one change: ZEEBE_BROKER_CONTACTPOINT pointed at an address that does not answer, so a test pod could not take a real job. These records have no number or boolean field, so the negative check removes a key instead of emptying one. Both jars were started with a copy of the shipped application.yaml without operations-app.endpoints.auth, a key the Deployment does not set. The real Deployment was not touched, and every pod was deleted afterwards.

Jar Configuration Result
this branch the Deployment's started in 63.1s, Routes startup (started:59), no error, no job taken
dev the Deployment's started in 60.0s, Routes startup (started:59)
this branch the Deployment's, without operations-app.endpoints.auth did not start: Property: operations-app.endpoints.auth, Reason: must not be null, exit 1
dev the Deployment's, without operations-app.endpoints.auth started, 59 routes: the defect this PR fixes

Ticket: PHEE-417.

The two records added in openMF#4 (operations-app and
identity-account-mapper) bind configuration without checking it. A
missing key binds to null and the processor starts; the URL it builds
then ends in "null", and the problem shows up only at the first call.
The baseline read these twelve keys through nineteen bare @value
declarations with no default, so a missing key stopped startup.

Both records are now @validated, every component is @NotNull, and the
operations-app endpoints group is @Valid, so the check also reaches the
keys inside it. A missing key stops startup again, and the error names
the property. Every field is a String, so an empty value is still
accepted, as before.

spring-boot-starter-validation is added because nothing on the
classpath provided Bean Validation; without it @validated is ignored.
The version comes from the BOM.

ConfigurationPropertiesTest now also sets operations-app.username and
password in its shared configuration, because they are required.

ShippedConfigBindsTest binds the two records from the real
application.yaml, including the identity_account_mapper keys spelled
with underscores. It checks that each record on its own refuses to
start when nothing is configured, that a key missing inside the
endpoints group stops startup, and that an empty String is accepted.

The other @value in this processor are not touched here.
@GiulioRinalduzzi
GiulioRinalduzzi requested a review from a team October 6, 2026 16:03
@tdaly61
tdaly61 merged commit 53bccf9 into openMF:dev Oct 7, 2026
1 check passed
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