Skip to content

Refactor data raw#920

Open
darinkrauss wants to merge 1 commit intodarin/refactor-data-sourcefrom
darin/refactor-data-raw
Open

Refactor data raw#920
darinkrauss wants to merge 1 commit intodarin/refactor-data-sourcefrom
darin/refactor-data-raw

Conversation

@darinkrauss
Copy link
Contributor

  • 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
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.DataSetIDsFilter.DataSetID and updates Mongo query mapping accordingly.
  • Introduces Archivable/Archived filter flags plus ArchivableTime/ArchivedTime fields 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())
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