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

Enable configuration of clients independent of local environment. #202

Closed
hgo-ds opened this issue Oct 23, 2023 · 11 comments
Closed

Enable configuration of clients independent of local environment. #202

hgo-ds opened this issue Oct 23, 2023 · 11 comments
Assignees
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request linked_to_feature Issue is linked to a feature

Comments

@hgo-ds
Copy link

hgo-ds commented Oct 23, 2023

As a consumer of the IRS registry client library org.eclipse.tractusx.irs:irs-registry-client
I want to be able to setup Clients which are part of the IRS-Library independent of the configured Spring-Profile,
so that using IRS registry client library in a local setup can be configured as in real deployment and can connect to a real or mocked service.

Hints / Details

Outcome / Acceptance Criteria

  • Usage and implementation of clients is independent of the configured Spring-Profile.
@jzbmw jzbmw added this to IRS Oct 24, 2023
@github-project-automation github-project-automation bot moved this to inbox in IRS Oct 24, 2023
@jzbmw jzbmw added the enhancement New feature or request label Nov 2, 2023
@jzbmw
Copy link
Contributor

jzbmw commented Nov 8, 2023

@hgo-ds we have some questions regarding this request:

  • Is the issue of the Profile the naming convention?
  • Is it possible for you to overwrite the bean with primary annotation?

is the Problem, that we use the local profile in a way that we use ist to mock or test topics?

@jzbmw jzbmw added the dependencies Pull requests that update a dependency file label Nov 8, 2023
@jzbmw
Copy link
Contributor

jzbmw commented Nov 8, 2023

Tasks

  • define, clarify new Application Profiles with ( stub, test, stubtest, local)
  • refactor Profile's
  • refactor documentation regarding profiling within IRS
  • clarify @ds-mwesener with Trace-X if it affects their deployment
  • check environments if there are dependencies

@jzbmw jzbmw moved this from inbox to backlog in IRS Nov 8, 2023
@ds-mwesener
Copy link
Contributor

ds-mwesener commented Nov 8, 2023

As we do not use profiles at all, there is currently no impact on trace-x. Either way the provided suggestion would not cause any issues.

@mkanal
Copy link
Contributor

mkanal commented Nov 8, 2023

My rough suggestion would be to completely remove the use of "local" profiles etc. in the code and to establish a dedicated feature flag for the desired function, e.g. "enableDigitalTwinRegistryClientStub", preferably with a meaningful default value.

These feature flags are added as properties to the respective application.yaml files as required and can therefore be used independently of the respective profile.

Implementation in the code then with @ConditionalOnProperty on the bean that you want to activate here.

--

This does not prevent the use of profiles in the Spring environment, on the contrary, the configuration of the respective features is only lifted or collected in a central location (.yaml file) and the user has all the freedom independent of the configured profile.

This would be a relief IMHO, especially for libraries that are used in third-party applications.

Translated with www.DeepL.com/Translator (free version)

@hgo-ds
Copy link
Author

hgo-ds commented Nov 9, 2023

@jzbmw
Basically, using @Profile within the code to control behavior of the library i.e. to establish mocks for certain setups like tests is the issue.
As the desired implementation for our use case is also part of the library, using primary is no option.
The naming itself is not the issue, it's just the kind how it is implemented.

My detail thoughts are covered here #202 (comment)

@mkanal
Copy link
Contributor

mkanal commented Nov 9, 2023

Due to the @Profile-IRS fuzziness, however, we are unfortunately not able to start a "real" TRX in the local environment with profile local (and the associated configuration via application-local.yaml) as the DigitalTwinRegistryClientLocalStub is then instantiated in the IRS instead of the DigitalTwinRegistryClientImpl, for example.

@jzbmw jzbmw moved this from backlog to next in IRS Nov 28, 2023
@ds-jhartmann
Copy link
Contributor

Planning 2

  • check if we can move the stubs to the IRS module
  • if not, rename the profile to something unique

@ds-psosnowski ds-psosnowski self-assigned this Dec 4, 2023
@ds-psosnowski ds-psosnowski moved this from next to wip in IRS Dec 4, 2023
@ds-psosnowski ds-psosnowski moved this from wip to review in IRS Dec 12, 2023
ds-jhartmann pushed a commit that referenced this issue Dec 13, 2023
…m DigitalTwinRegistryClientLocalStub in registry-client and moved bean creation to irs-api
ds-jhartmann pushed a commit that referenced this issue Dec 13, 2023
ds-jhartmann pushed a commit that referenced this issue Dec 13, 2023
…tion-of-clients-independent-of-local-environment

feat(irs-registry-client-irs-api):[#202] removed auto-detect bean from DigitalTwinRegistryClientLocalStub in registry-client and moved bean creation to irs-api
@ds-psosnowski
Copy link
Contributor

@hgo-ds Hello
All profile-conditional bean creation in irs-registry-client has been moved to irs-api .
Please check and let us know if this is working as you expected. Library version is 1.5.0

ds-jhartmann pushed a commit that referenced this issue Dec 21, 2023
…istry-client-version

feat(irs-registry-client):[#202] increased irs registry client version
@jzbmw jzbmw moved this from review to done in IRS Dec 22, 2023
@jzbmw jzbmw closed this as completed Dec 22, 2023
@hgo-ds
Copy link
Author

hgo-ds commented Jan 5, 2024

Thanks @ds-psosnowski for providing the fix.

Unfortunately, it's not released yet.

https://repo1.maven.org/maven2/org/eclipse/tractusx/irs/irs-registry-client/

Only available in Repo: orgeclipsetractusx-1039 (staging: closed) https://oss.sonatype.org/#nexus-search;gav~~irs-registry-client~1.5.0~~

First tests with release 1.5.0-SNAPSHOT where fine so far.

What is the timetable for the release of the artifact?
Is there anything we can do?

@ds-jhartmann
Copy link
Contributor

Hi @hgo-ds
seems like something went wrong in the staging process. I started the workflow again and it was successful this time. The artifact should be available within the next 1 or 2 hours.
Sorry for the inconvenience.

@hgo-ds
Copy link
Author

hgo-ds commented Jan 8, 2024

This is looking very fine now, thanks for support @ds-jhartmann.

Tests are in progress.

@mkanal mkanal added the linked_to_feature Issue is linked to a feature label Jan 15, 2024
ds-jhartmann added a commit that referenced this issue Feb 22, 2024
chore(charts):[-] Add missing /models segment to semantics hub url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request linked_to_feature Issue is linked to a feature
Projects
Status: done
Development

No branches or pull requests

6 participants