Open
Conversation
Contributor
darinkrauss
commented
Mar 18, 2026
- Refactor data raw
- Rename Filter.DataSetIDs to Filter.DataSetID
- Add Archivable and Archived filter flags
- Add ArchivableTime and ArchivedTime fields
- Update ID validation
- Add and update tests
- Refactor data raw - Rename Filter.DataSetIDs to Filter.DataSetID - Add Archivable and Archived filter flags - Add ArchivableTime and ArchivedTime fields - Update ID validation - Add and update tests
There was a problem hiding this comment.
Pull request overview
Refactors the data/raw domain model and persistence to support new archiving semantics, while updating validation and tests to match the new shapes.
Changes:
- Renames
Filter.DataSetIDs→Filter.DataSetIDand updates Mongo query mapping accordingly. - Introduces
Archivable/Archivedfilter flags plusArchivableTime/ArchivedTimefields across create/update/raw flows. - Updates DataRaw ID validation (format + date parsing) and expands/updates test coverage.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
test/optional.go |
Adds constant generators to improve deterministic optional/random test data creation. |
data/raw/test/raw.go |
Updates test factories/object-mappers for new filter flags and archive timestamps. |
data/raw/store/structured/mongo/mongo.go |
Extends Mongo list/create/update logic and document shape for new archive fields. |
data/raw/raw.go |
Refactors core types/validation, adds archive-related helpers, updates DataRaw ID validation. |
data/raw/raw_test.go |
Updates and expands unit tests for new fields/validation behaviors. |
data/raw/service/client_test.go |
Adjusts client test to use new RandomUpdate test helper. |
private/plugin/abbott |
Bumps submodule reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+213
to
+214
| ArchivableTime: test.Conditional(test.Constant(processedTime), archived || test.RandomBool()), | ||
| ArchivedTime: test.Conditional(test.Constant(processedTime), archived), |
| object["userId"] = test.NewObjectFromString(datum.UserID, objectFormat) | ||
| object["dataSetId"] = test.NewObjectFromString(datum.DataSetID, objectFormat) | ||
| if len(datum.Metadata) > 0 { | ||
| if datum.Metadata != nil { |
Comment on lines
+103
to
+105
| query["archivableTime"] = bson.M{"$exists": true, "$lt": now} | ||
| if !*filter.Archivable { | ||
| query["archivableTime"] = bson.M{"$not": query["archivableTime"]} |
Comment on lines
+188
to
+189
| func (r *Raw) IsArchivable() bool { | ||
| return r.ArchivableTime != nil && r.ArchivableTime.Before(time.Now()) |
This file contains hidden or 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
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.