Skip to content

Conversation

@oliveregger
Copy link
Member

@oliveregger oliveregger commented Jan 7, 2026

Summary by Sourcery

Stabilize locale handling in the base worker context and update release documentation for version 4.0.16.

Enhancements:

  • Track and compare the worker context locale to avoid redundant locale changes while still logging effective locale updates.

Documentation:

  • Update changelog entry for release 4.0.16 with correct date and issue references.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 7, 2026

Reviewer's Guide

Stabilizes locale handling in the FHIR R5 BaseWorkerContext by persisting and only propagating locale changes when the value actually changes, and updates the 4.0.16 release changelog metadata for date and issue references.

Sequence diagram for locale update propagation in BaseWorkerContext.setLocale

sequenceDiagram
  actor Client
  participant BaseWorkerContext
  participant SuperWorkerContext
  participant Logger

  Client->>BaseWorkerContext: setLocale(locale)
  alt this.locale is null
    BaseWorkerContext->>BaseWorkerContext: this.locale = locale
    BaseWorkerContext->>SuperWorkerContext: setLocale(locale)
  else this.locale not null and different from locale
    BaseWorkerContext->>BaseWorkerContext: this.locale = locale
    BaseWorkerContext->>SuperWorkerContext: setLocale(locale)
    alt locale not null
      BaseWorkerContext->>Logger: info(changing locale to languageTag)
    else locale is null
      BaseWorkerContext->>Logger: info(resettting locale)
    end
  else this.locale equals locale
    Note over BaseWorkerContext: No call to SuperWorkerContext.setLocale
  end
Loading

Class diagram for updated BaseWorkerContext locale handling

classDiagram
  class BaseWorkerContext {
    - ContextUtilities cutils
    - List~String~ suppressedMappings
    - Locale locale
    + BaseWorkerContext()
    + void copy(BaseWorkerContext other)
    + void setLocale(Locale locale)
  }

  class SuperWorkerContext {
    + void setLocale(Locale locale)
  }

  BaseWorkerContext --|> SuperWorkerContext
Loading

File-Level Changes

Change Details Files
Persist and selectively propagate locale changes in the FHIR R5 BaseWorkerContext.
  • Introduce a Locale field on BaseWorkerContext to store the current worker context locale.
  • Extend the copy(BaseWorkerContext) method to copy the stored locale from the source context.
  • Wrap setLocale(Locale) with logic that only calls the superclass when the locale actually changes, logging locale updates and resets while preserving existing null-handling behavior.
matchbox-engine/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java
Correct 4.0.16 changelog metadata.
  • Update the 4.0.16 release header to use the full 2026/01/07 date.
  • Normalize issue references in the 4.0.16 section to consistently include the leading # symbol.
docs/changelog.md
No-op or placeholder update for HTTP tests.
  • Touch or re-save the JMeter HTTP test file without semantic changes (no diff content provided).
jmeter/test.http

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In setLocale, consider simplifying the change-detection logic by using an early return with Objects.equals(this.locale, locale) and only updating/logging when the value actually changes, which will make the method more readable and less nested.
  • The info log message "changing locale to" concatenates without a separating space; update the string (e.g., "changing locale to ") to avoid slightly awkward log output.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `setLocale`, consider simplifying the change-detection logic by using an early return with `Objects.equals(this.locale, locale)` and only updating/logging when the value actually changes, which will make the method more readable and less nested.
- The info log message "changing locale to" concatenates without a separating space; update the string (e.g., "changing locale to ") to avoid slightly awkward log output.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@azhar-saleem-infoway
Copy link

azhar-saleem-infoway commented Jan 7, 2026

Hi Oliver,

I am with Canada Health Infoway and we are very interested in this release as it updates the HL7 Validator to v6.7.10.
We need this for our Projectathon in February so the earlier this gets released, the sooner with can start testing.

Thanks for getting this done!

Azhar

@oliveregger
Copy link
Member Author

Hi Oliver,

I am with Canada Health Infoway and we are very interested in this release as it updates the HL7 Validator to v6.7.10. We need this for our Projectathon in February so the earlier this gets released, the sooner with can start testing.

Thanks for getting this done!

Azhar

it should go out tomorrow, final testing stage ...

@oliveregger oliveregger merged commit 81d3a31 into main Jan 8, 2026
9 checks passed
@qligier qligier deleted the oe_rel4016 branch January 8, 2026 20:13
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.

4 participants