Skip to content

Conversation

@DibyojyotiS
Copy link
Contributor

Description

This PR adds audit fields to the config-service to track config creation and modification by users. Specifically, this feature adds:

  • created_by: Email of the user who originally created the config
  • last_modified_by: Email of the user who last modified the config

These fields are now exposed in all config service responses (UpsertConfigResponse, GetConfigResponse, ContextSpecificConfig, and UpsertAllConfigsResponse.UpsertedConfig) to provide better auditability and tracking of config changes.

Key Implementation Details:

  • The created_by field is set when a config is initially created and remains immutable during updates
  • The last_modified_by field is updated on every modification
  • Changes span across the entire config service stack:
    • Proto definitions updated to include audit fields in responses
    • ConfigDocument model extended with createdByUserEmail field
    • ConfigObject interface extended with getCreatedBy() and getLastModifiedBy() methods
    • DocumentConfigStore logic updated to preserve creator email on updates
    • All response builders updated to populate audit fields

Testing

  • Unit tests added: Comprehensive test coverage including:
    • testCreatorEmailIsSetOnCreate(): Verifies creator email is set on config creation
    • testCreatorEmailIsPreservedOnUpdate(): Ensures creator email remains unchanged during updates
  • Existing tests updated: All existing tests updated to validate new audit fields:
    • IdentifiedObjectStoreTest.java
    • IdentifiedObjectStoreWithFilterTest.java
    • DefaultObjectStoreTest.java
    • ContextuallyIdentifiedObjectStoreTest.java
    • DocumentConfigStoreTest.java
    • ConfigDocumentTest.java

All tests pass successfully.

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

Documentation

Proto file comments have been added to document the new audit fields.

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Test Results

151 tests  +11   151 ✅ +11   1m 7s ⏱️ +3s
 31 suites ± 0     0 💤 ± 0 
 31 files   ± 0     0 ❌ ± 0 

Results for commit 21136bc. ± Comparison against base commit d41389b.

♻️ This comment has been updated with latest results.

@DibyojyotiS DibyojyotiS marked this pull request as ready for review December 1, 2025 09:30
@DibyojyotiS DibyojyotiS requested a review from a team as a code owner December 1, 2025 09:30
…ail)

changes: default substititions only at read
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 91.50943% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.60%. Comparing base (68982ae) to head (1915819).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...onfig/service/store/DocumentConfigStoreConfig.java 64.70% 2 Missing and 4 partials ⚠️
...race/config/service/store/DocumentConfigStore.java 90.90% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #323      +/-   ##
============================================
- Coverage     75.73%   75.60%   -0.13%     
- Complexity      556      598      +42     
============================================
  Files            63       65       +2     
  Lines          2839     3033     +194     
  Branches        134      147      +13     
============================================
+ Hits           2150     2293     +143     
- Misses          607      647      +40     
- Partials         82       93      +11     
Flag Coverage Δ
integration 75.60% <91.50%> (-0.13%) ⬇️
unit 73.61% <91.50%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

refactor: split buildConfigDocument into create and update methods
@DibyojyotiS DibyojyotiS requested review from a team and skjindal93 and removed request for skjindal93 December 9, 2025 08:56
@DibyojyotiS DibyojyotiS enabled auto-merge (squash) December 17, 2025 09:48
…ate-last-modified-date-last-modified-by-audit-details
@singhalprerana singhalprerana changed the title AAP-9761: Changes to add Created Date, Last Modified Date, last Modified by Audit details Changes to add Created Date, Last Modified Date, last Modified by Audit details Dec 17, 2025
@DibyojyotiS DibyojyotiS merged commit 2f7c343 into main Dec 17, 2025
9 checks passed
@DibyojyotiS DibyojyotiS deleted the AAP-9761-config-svc-changes-to-add-created-date-last-modified-date-last-modified-by-audit-details branch December 17, 2025 10:37
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.

5 participants