Skip to content

Conversation

backport-action
Copy link
Collaborator

Description

Backport of #36872 to stable/8.6.

relates to #36869

@backport-action

This comment was marked as resolved.

korthout and others added 10 commits August 21, 2025 18:22
Adds a new module that can be used to specify ArchUnit tests for the
orchestration cluster.

These tests have access to the entire production code through a
dependency on dist (io.camunda:camunda-zeebe).

The tests need to be run by surefire rather than failsafe to ensure
correct execution and access to loaded classes. With failsafe, tests are
executed but failures are not detected somehow. I did not understand why
this is. Note that the parent module (io.camunda:camunda-qa) attempts to
run all tests with failsafe rather than surefire so the archunit-tests's
pom explicitly re-configures this.

The choice to create a new module was made as it:
- allows to easily run these tests together
- depending on dist ensures it runs on all production code, including
  modules added later without needing to change dependencies
- helps others to find a fitting place for their ArchUnit tests
- groups together ArchUnit tests for easily gaining an overview

The downsides are:
- long feedback loop - I value this less than the long term ease of
  maintenance.
- doesn't run on non-prod code - No need to solve this now.

See: https://camunda.slack.com/archives/C08F5RD5X8B/p1755527617038109
(cherry picked from commit 4399511)
The ConditionalOnProperty annotation requires kebab-case in its
attributes in order to correctly match them using relaxed binding to
spring loaded properties. In other words, to match to both my-example
and myExample, the @ConditionalOnProperty must refer to my-example. If
it refers to myExample, then it only works explicitly on myExample and
relaxed binding to my-example doesn't work.

To avoid this, we add an ArchUnit test that verifies that none of the
attributes of ConditionalOnProperty use camelCase. It does this simply
by checking for capitalized letters. If it fails, the error message
includes all the needed details, like the location of the forbidden
annotation, the specific attribute, and the failure.

To overcome the problem, simply switch to using kebab-case in the
attributes of ConditionalOnProperty.

(cherry picked from commit d67a9f8)
ConditionalOnProperty requires specifying names of properties using
kebab-case.

This ensures that camunda.tasklist.webapp-enabled can be used rather
than requiring camunda.tasklist.webappEnabled explicitly.

Note that the docs document it as camunda.tasklist.webappEnabled, but
this change is backward compatible, as camunda.tasklist.webappEnabled
can still be matched due to relaxed binding. We decided to use
kebab-case for configs in the docs, but they have not been adjusted yet.

(cherry picked from commit d6f200e)
ConditionalOnProperty requires specifying names of properties using
kebab-case.

This ensures that camunda.operate.webapp-enabled can be used rather
than requiring camunda.operate.webappEnabled explicitly.

Note that the docs document it as camunda.operate.webappEnabled, but
this change is backward compatible, as camunda.operate.webappEnabled
can still be matched due to relaxed binding. We decided to use
kebab-case for configs in the docs, but they have not been adjusted yet.

(cherry picked from commit d8b567a)
ConditionalOnProperty requires specifying names of properties using
kebab-case.

This ensures that camunda.tasklist.importer-enabled can be used rather
than requiring camunda.tasklist.importerEnabled explicitly.

Note that the docs document it as camunda.tasklist.importerEnabled, but
this change is backward compatible, as camunda.tasklist.importerEnabled
can still be matched due to relaxed binding. We decided to use
kebab-case for configs in the docs, but they have not been adjusted yet.

(cherry picked from commit feaf933)
ConditionalOnProperty requires specifying names of properties using
kebab-case.

This ensures that camunda.operate.importer-enabled can be used rather
than requiring camunda.operate.importerEnabled explicitly.

Note that the docs document it as camunda.operate.importerEnabled, but
this change is backward compatible, as camunda.operate.importerEnabled
can still be matched due to relaxed binding. We decided to use
kebab-case for configs in the docs, but they have not been adjusted yet.

(cherry picked from commit b50ce94)
ConditionalOnProperty requires specifying names of properties using
kebab-case.

This ensures that camunda.tasklist.feature-flag.process-public-endpoints
can be used rather than requiring
camunda.tasklist.featureFlag.processPublicEndpoints explicitly.

(cherry picked from commit eba1343)
Without this, the qa modules are not used during `./mvnw test` or
`./mvnw verify`.

(cherry picked from commit 3a39089)
The condition checks against uppercase characters only. This
means it accepts kebab-case and not camelCase or PascalCase.
Just staying not camelCase is thus not entirely correct.

We can easily resolve this by removing the mention of camelCase
here. Note that the validation already describes the actual
violation (no uppercase allowed).

I also took the chance to align both descriptions.

(cherry picked from commit 833b6b7)
This change moves the RequireKebabCaseInConditionalOnPropertyArchTest to
the io.camunda package as it covers all those classes.

This makes it easier for other ArchTests to also align to the structure
of the codebase that they work with. The end goal is a module that
organizes its test in way where it's easy to see at a glance what code
is covered by these tests.

(cherry picked from commit 42ce60f)
@korthout korthout force-pushed the backport-36872-to-stable/8.6 branch from df83c59 to 0580312 Compare August 21, 2025 16:23
@github-actions github-actions bot added component/zeebe Related to the Zeebe component/team component/operate Related to the Operate component/team component/tasklist Related to the Tasklist component/team component/optimize Related to Optimize component/team labels Aug 21, 2025
@korthout korthout marked this pull request as ready for review August 21, 2025 16:36
@korthout korthout requested a review from mustafadagher August 22, 2025 07:01
@korthout
Copy link
Member

@mustafadagher Note the need for c6b2eb3

This reverts commit b7abc95.

This is necessary as it was breaking the release dry-run.
@korthout korthout force-pushed the backport-36872-to-stable/8.6 branch from c6b2eb3 to 44e81a7 Compare August 25, 2025 10:37
@korthout korthout mentioned this pull request Aug 25, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/operate Related to the Operate component/team component/optimize Related to Optimize component/team component/tasklist Related to the Tasklist component/team component/zeebe Related to the Zeebe component/team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants