Skip to content

Expose creation and update timestamp in getAllConfigs API#28

Merged
GurtejSohi merged 2 commits intomainfrom
expose-creation-and-update-timestamp
Feb 26, 2021
Merged

Expose creation and update timestamp in getAllConfigs API#28
GurtejSohi merged 2 commits intomainfrom
expose-creation-and-update-timestamp

Conversation

@GurtejSohi
Copy link
Copy Markdown
Collaborator

@GurtejSohi GurtejSohi commented Feb 26, 2021

Description

Addresses #25

Testing

Unit tests and integration tests

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2021

Codecov Report

Merging #28 (3c48799) into main (24da916) will increase coverage by 0.74%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #28      +/-   ##
============================================
+ Coverage     89.68%   90.42%   +0.74%     
- Complexity      105      109       +4     
============================================
  Files            14       14              
  Lines           378      397      +19     
  Branches         16       18       +2     
============================================
+ Hits            339      359      +20     
  Misses           32       32              
+ Partials          7        6       -1     
Flag Coverage Δ Complexity Δ
integration 90.42% <100.00%> (+0.74%) 0.00 <7.00> (ø)
unit 88.28% <80.00%> (-1.15%) 0.00 <7.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...pertrace/config/service/ConfigServiceGrpcImpl.java 80.55% <100.00%> (+0.27%) 15.00 <2.00> (ø)
.../hypertrace/config/service/ConfigServiceUtils.java 96.42% <100.00%> (+0.27%) 13.00 <0.00> (ø)
...ypertrace/config/service/store/ConfigDocument.java 89.18% <100.00%> (+1.31%) 13.00 <3.00> (+2.00)
...race/config/service/store/DocumentConfigStore.java 100.00% <100.00%> (+1.51%) 13.00 <2.00> (+2.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 24da916...3c48799. Read the comment docs.

@github-actions

This comment has been minimized.


message GetAllConfigsResponse {
// list of config values along with the associated contexts
// list of config values along with the associated contexts, sorted in the ascending order of their creation time
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think usually the client would want the configs to be returned in the order of creation time. So, added this extra condition.

Copy link
Copy Markdown
Contributor

@aaron-steinfeld aaron-steinfeld Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. If we need to add explicit sort support later, we can

int64 creation_timestamp = 3;

// timestamp (in milliseconds since epoch) at which this config was last updated
int64 update_timestamp = 4;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't added these fields to getConfig API because that API can merge the configs belonging to different contexts, each of which will have different creation and update timestamps.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Eventually, we may have to expose an API that doesn't merge and does expose those (wish getConfig had been named getMergedConfig or something...), but no need until we have a use case. The same argument could actually be made for this API since the main use case as I understand it is internal - the sorted results, but I'm fine either way since it's done.

int64 creation_timestamp = 3;

// timestamp (in milliseconds since epoch) at which this config was last updated
int64 update_timestamp = 4;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Eventually, we may have to expose an API that doesn't merge and does expose those (wish getConfig had been named getMergedConfig or something...), but no need until we have a use case. The same argument could actually be made for this API since the main use case as I understand it is internal - the sorted results, but I'm fine either way since it's done.

@github-actions

This comment has been minimized.

@GurtejSohi GurtejSohi merged commit a391942 into main Feb 26, 2021
@GurtejSohi GurtejSohi deleted the expose-creation-and-update-timestamp branch February 26, 2021 15:54
@github-actions
Copy link
Copy Markdown

Unit Test Results

10 files  +1  10 suites  +1   8s ⏱️ +3s
31 tests +2  31 ✔️ +2  0 💤 ±0  0 ❌ ±0 

Results for commit a391942. ± Comparison against base commit 24da916.

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.

Expose creation and update timestamp in get config APIs

2 participants