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

Fix #1979, implement abstract config registry module #1980

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

jphickey
Copy link
Contributor

Describe the contribution
Adds a new module called "config" that tracks simple key/value pairs. All values are const.

As a proof of concept, all version information is mirrored into this key store, and ES is updated to use this instead
of the GLOBAL_CONFIGDATA when generating events.

Fixes #1979

Testing performed
Build and sanity check CFE, run all tests.

Expected behavior changes
Slightly different version display during startup (module names are ALL_CAPS, mainly). Otherwise pretty transparent.

System(s) tested on
Ubuntu

Additional context
This attempts to balance the advantages/disadvantages of having a string-based key/value store and an integer-based key/value store. In this implementation, the table is primarily indexed by an integer, which is assigned at compile time, so its fast (direct lookup from key to table entry). But the downside to this is that it creates a compile-time dependency on the assigned integer IDs. So, the keys also have string names associated with them, such that an app can find a key by name, to avoid having a hard compile-time dependency on a particular configuration item, such as if its an optional component.

This also has the side effect of improving branch/line coverage in ES where it was reading the "const" configdata objects. Due to the fact that configdata is declared "const", it means that coverage test can also only run with one copy. Therefore, it could not cover all the branches as a result.

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey force-pushed the fix-1979-generic-config-registry branch 2 times, most recently from 6bf02de to 44ce239 Compare September 27, 2021 18:30
@jphickey jphickey force-pushed the fix-1979-generic-config-registry branch 2 times, most recently from bac5691 to 145cecb Compare September 27, 2021 19:38
@jphickey
Copy link
Contributor Author

Pushed to fix up a few stray items, also corrects the cut/paste error in CMakeLists.txt

@jphickey jphickey force-pushed the fix-1979-generic-config-registry branch 3 times, most recently from 111fa4b to e96837f Compare September 29, 2021 17:31
Adds a new module called "config" that tracks simple
key/value pairs.  All values are const.

As a proof of concept, all version information is mirrored
into this key store, and ES is updated to use this instead
of the GLOBAL_CONFIGDATA when generating events.
@jphickey jphickey force-pushed the fix-1979-generic-config-registry branch from e96837f to df5e143 Compare September 29, 2021 17:33
@jphickey jphickey marked this pull request as ready for review October 5, 2021 18:10
@astrogeco
Copy link
Contributor

CCB:2021-10-13 APPROVED

@astrogeco astrogeco added the CCB:Approved Indicates code review and approval by community CCB label Oct 13, 2021
astrogeco added a commit to astrogeco/cFE that referenced this pull request Nov 3, 2021
…istry

Fix nasa#1979, implement abstract config registry module
astrogeco added a commit to astrogeco/cFE that referenced this pull request Nov 3, 2021
…gistry

Fix nasa#1979, implement abstract config registry module
@astrogeco astrogeco merged commit 05ca2f6 into nasa:main Dec 6, 2021
@jphickey jphickey deleted the fix-1979-generic-config-registry branch January 18, 2022 19:50
@skliper skliper added this to the Draco milestone Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB draco-rc1 enhancement
Projects
None yet
4 participants