Added factory for config-backed Atum-Agent#439
Conversation
|
Report: Report: server - scala:2.13.13
No changed file in reports. |
There was a problem hiding this comment.
Pull request overview
Adds a factory method to create an AtumAgent instance backed by an explicitly provided Typesafe Config, enabling multiple agents with different dispatcher setups within the same JVM.
Changes:
- Added
AtumAgent.fromConfig(config: Config)to build a dedicated agent usingdispatcherFromConfig(config). - Added a unit test validating
fromConfigconstructs an agent with the expected dispatcher. - Updated
agent/README.mdwith a new “Option 3” showing how to create a config-backed agent.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| agent/src/main/scala/za/co/absa/atum/agent/AtumAgent.scala | Adds fromConfig factory for creating a config-backed agent instance. |
| agent/src/test/scala/za/co/absa/atum/agent/AtumAgentUnitTests.scala | Adds unit test coverage for the new fromConfig factory. |
| agent/README.md | Documents the new config-backed agent creation option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
lsulak
left a comment
There was a problem hiding this comment.
I like this, thank you for your contribution!!
One thing, since you fundamentally changed this: before we had only 1 singleton Atum Agent, now a user can create his own instance. This is not covered with tests, so there is no verification that the returned agent is independent (own context store, own currentUser resolution). Worth adding at least a test showing two agents with different configs coexist.
Thank you, I have amended the test to ensure this was covered as well. |
lsulak
left a comment
There was a problem hiding this comment.
Approving, thanks! With your prior permissions (on a chat), I'm gonna merge this now.
Task:
Adds a factory method to create an
AtumAgentinstance backed by an explicitly providedTypesafe Config, enabling multiple agents with different dispatcher setups within the same JVM.Context:
The above PRs updates the deployment pipeline to extract, package, and publish the external TypeSafe config for the data-measurement Spark plugin and ensure it is shipped to Spark via
--files:This supports the “external first, classpath fallback” strategy within AUL: the plugin first attempts to load
application.confdistributed through Spark--files, and falls back to the classpath config if no external file is available.Essentially, we want to externalize all configuration files. So, it is easier for the Ops teams and Dev teams to make changes to the configuration files without a need to always release a new version of Atum-Services or Unify. But since Atum-Services is in the codebase of Unify, a small change is needed on Atum-Services to be able to externalize these config files.
Closes:
#438
Release Notes:
fromConfigtoAtumAgentREADMEto include Option 3