Skip to content

feat: add support for required keys on entity attributes#105

Merged
aaron-steinfeld merged 2 commits intomainfrom
required-keys
Apr 16, 2021
Merged

feat: add support for required keys on entity attributes#105
aaron-steinfeld merged 2 commits intomainfrom
required-keys

Conversation

@aaron-steinfeld
Copy link
Copy Markdown
Contributor

@aaron-steinfeld aaron-steinfeld commented Apr 16, 2021

Description

This adds support for requiring keys on v2 entity types that are ingested based on config during enrichment. Previously, any time a valid ID can be generated, an entity would be formed (so, for example, if an id is based on a hash of several attributes and only one is present, it would still form an entity). Now, we can require any number of attributes to be present to give more control over entity definition. A better version of this would be full blown predicate support, but given that entity type service doesn't have those constructs today, it felt like overkill to build that out just yet... instead, I wrapped the concept such that other types of conditions could be added in the future.

Testing

Updated UTs, validated behavior e2e

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@github-actions

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2021

Codecov Report

Merging #105 (2cf9a68) into main (c5b929b) will increase coverage by 0.04%.
The diff coverage is 50.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #105      +/-   ##
============================================
+ Coverage     59.43%   59.47%   +0.04%     
- Complexity      289      290       +1     
============================================
  Files            39       39              
  Lines          2931     2949      +18     
  Branches        370      371       +1     
============================================
+ Hits           1742     1754      +12     
- Misses         1019     1024       +5     
- Partials        170      171       +1     
Flag Coverage Δ Complexity Δ
integration 59.47% <50.00%> (+0.04%) 49.00 <0.00> (ø)
unit 39.42% <50.00%> (+0.17%) 278.00 <3.00> (+1.00)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...tity/type/service/v2/model/EntityTypeDocument.java 72.05% <50.00%> (-1.95%) 17.00 <3.00> (+1.00) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5b929b...2cf9a68. Read the comment docs.

@aaron-steinfeld aaron-steinfeld marked this pull request as ready for review April 16, 2021 05:17
@github-actions

This comment has been minimized.

@aaron-steinfeld aaron-steinfeld merged commit 9b7c7b6 into main Apr 16, 2021
@aaron-steinfeld aaron-steinfeld deleted the required-keys branch April 16, 2021 13:21
@github-actions
Copy link
Copy Markdown

Unit Test Results

  30 files  ±0    30 suites  ±0   24s ⏱️ +4s
140 tests ±0  140 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9b7c7b6. ± Comparison against base commit c5b929b.

suddendust pushed a commit to suddendust/entity-service that referenced this pull request Sep 5, 2025
* test update

* test update

* updated test case in mongo

* removed unnecessary dependencies

* changed idea file
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.

2 participants