-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support remote config from extraction pipelines [DEGR-2723] #63
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
- Coverage 71.93% 71.33% -0.60%
==========================================
Files 28 28
Lines 3976 4012 +36
Branches 451 454 +3
==========================================
+ Hits 2860 2862 +2
- Misses 914 948 +34
Partials 202 202
|
kbrattli
changed the title
Helper function for adding remote config [DEGR-2723]
check for new remote config + helper function for adding remote config [DEGR-2723]
Aug 11, 2023
kbrattli
commented
Nov 14, 2023
The version needs to be updated - maybe a major update? |
polomani
reviewed
Nov 28, 2023
polomani
reviewed
Nov 28, 2023
polomani
reviewed
Nov 28, 2023
polomani
reviewed
Nov 28, 2023
polomani
reviewed
Nov 28, 2023
polomani
reviewed
Nov 28, 2023
polomani
reviewed
Nov 28, 2023
@@ -1 +1 @@ | |||
1.0.0-alpha-013 | |||
1.0.0-alpha-014 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
1.0.0-alpha-014 | |
2.0.0-alpha-001 |
polomani
changed the title
check for new remote config + helper function for adding remote config [DEGR-2723]
Support remote config from extraction pipelines [DEGR-2723]
Nov 28, 2023
abdullah-cognite
approved these changes
Nov 28, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Symmtry (TESTED AND WORKS): https://github.com/cognitedata/symmetry-connector-dotnet/pull/23
SimConnect (TESTED AND WORKS): https://github.com/cognitedata/simconnect-dotnet/pull/137
DWSIM (TESTED AND WORKS): https://github.com/cognitedata/dwsim-connector-dotnet/pull/34
PetroSim (TESTED AND WORKS): https://github.com/cognitedata/petrosim-connector-dotnet/pull/30
https://cognitedata.atlassian.net/browse/DEGR-2723
ConnectorBase.cs
This allows us to check for if the Remote Config from fusion.cognite has been updated. Every connector has to be updated but it is small change, simply do this:
Then add this in the run():
taskList.Add(CheckForNewConfig(linkedToken));
. Important to check that every task uses linkedToken and not token in Run(), if one of them uses token,CheckForNewConfig
will not work.Also remember to change ConnectorRuntime.cs in every connector. Look here for guidance: https://github.com/cognitedata/symmetry-connector-dotnet/pull/23. The important idea is that the NewConfigException needs to propagate the whole way up to get catched and then can restart the connector. So if you add a new catch for general exception, it is important that you write:
catch (Exception e) when (e is not NewConfigDetected)
ExtractionPipeline.cs
This helper function first extracts the local config, then it will retrieve the "minimum config" aka the "cognite and type" part of the cognite. Then if type is remote, addRemoteConfig will get the FullConfig from Monitor Extraction Pipelines. To do this it has to be linked to a Extraction Pipeline with for example:
if type is local, then it will just get the local config instead.
This function has to be used in every
ConnectorRuntime.cs
see below for example, also add the exception handling.