Skip to content
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

Minimize usage of uninitialized BrokerCfg objects #10356

Closed
wants to merge 1 commit into from

Conversation

npepinpe
Copy link
Member

Description

This PR attempts to minimize usages of uninitialized BrokerCfg objects. Previously, you would create a configuration, then have to call init for it to be usable. The idea here is to try and enforce that you cannot create an unusable BrokerCfg object in general.

Unfortunately many, many places in tests do so, and sometimes create instances via reflection. I've left these for now, but open to suggestions on how best to tackle this.

This also removes the usage of two beans to initialize the BrokerCfg as introduced in #10354.

Related issues

related #9996
depends on #10354

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

Attempts to limit usages of uninitialized `BrokerCfg` objects by
removing the public init call and instead forcing callers to use the
constructor. The default constructor is kept for testing purposes, as
many places in the tests still use uninitialized configuration objects.
We could think about removing these in the future, or adding a warning.
@npepinpe npepinpe changed the base branch from main to 9996-atomix-cluster September 14, 2022 19:58
@npepinpe npepinpe closed this Sep 14, 2022
@npepinpe npepinpe deleted the 9996-brokercfg branch September 14, 2022 20:13
@npepinpe
Copy link
Member Author

Scratch that, this is a chicken and egg kind of thing, where you first have to set all properties and only then can you call init, so this approach is wrong here.

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.

None yet

1 participant