-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FAI-6093: Handle different timestamp types in adapter #137
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,7 +188,7 @@ describe('AST utilities', () => { | |
}, | ||
'deployment.refreshedAt': { | ||
path: 'deployment.metadata.refreshedAt', | ||
type: 'timestamp' | ||
type: 'epoch_millis_string' | ||
}, | ||
'commit.sha': { | ||
path: 'commit.sha', | ||
|
@@ -204,7 +204,7 @@ describe('AST utilities', () => { | |
}, | ||
'commit.refreshedAt': { | ||
path: 'commit.metadata.refreshedAt', | ||
type: 'timestamp' | ||
type: 'epoch_millis_string' | ||
} | ||
} | ||
} | ||
|
@@ -374,7 +374,7 @@ describe('AST utilities', () => { | |
nestedPaths: { | ||
changedAt: { | ||
path: 'changedAt', | ||
type: 'timestamp' | ||
type: 'epoch_millis' | ||
}, | ||
'status.category': { | ||
path: 'status.category', | ||
|
@@ -548,90 +548,93 @@ describe('AST utilities', () => { | |
nestedPaths: { | ||
uid: {path: 'uid', type: 'string'}, | ||
description: {path: 'description', type: 'string'}, | ||
createdAt: {path: 'createdAt', type: 'timestamp'}, | ||
createdAt: {path: 'createdAt', type: 'epoch_millis_string'}, | ||
origin: {path: 'metadata.origin', type: 'string'}, | ||
refreshedAt: {path: 'metadata.refreshedAt', type: 'timestamp'}, | ||
refreshedAt: { | ||
path: 'metadata.refreshedAt', | ||
type: 'epoch_millis_string', | ||
}, | ||
releases: { | ||
path: 'releases.nodes', | ||
nestedPaths: { | ||
'release.uid': { | ||
path: 'release.uid', | ||
type: 'string' | ||
type: 'string', | ||
}, | ||
'release.releasedAt': { | ||
path: 'release.releasedAt', | ||
type: 'timestamp' | ||
type: 'epoch_millis_string', | ||
}, | ||
'release.origin': { | ||
path: 'release.metadata.origin', | ||
type: 'string' | ||
type: 'string', | ||
}, | ||
'release.refreshedAt': { | ||
path: 'release.metadata.refreshedAt', | ||
type: 'timestamp' | ||
} | ||
} | ||
type: 'epoch_millis_string', | ||
}, | ||
}, | ||
}, | ||
tasks: { | ||
path: 'tasks.nodes', | ||
nestedPaths: { | ||
'task.uid': { | ||
path: 'task.uid', | ||
type: 'string' | ||
type: 'string', | ||
}, | ||
'task.typeCategory': { | ||
path: 'task.type.category', | ||
type: 'string' | ||
type: 'string', | ||
}, | ||
'task.typeDetail': { | ||
path: 'task.type.detail', | ||
type: 'string' | ||
type: 'string', | ||
}, | ||
'task.origin': { | ||
path: 'task.metadata.origin', | ||
type: 'string' | ||
type: 'string', | ||
}, | ||
'task.refreshedAt': { | ||
path: 'task.metadata.refreshedAt', | ||
type: 'timestamp' | ||
type: 'epoch_millis_string', | ||
}, | ||
'task.parent.uid': { | ||
path: 'task.parent.uid', | ||
type: 'string' | ||
type: 'string', | ||
}, | ||
'task.parent.createdAt': { | ||
path: 'task.parent.createdAt', | ||
type: 'timestamp' | ||
type: 'epoch_millis_string', | ||
}, | ||
'task.additionalFields': { | ||
path: 'task.additionalFields', | ||
nestedPaths: { | ||
name: {path: 'name', type: 'string'}, | ||
value: {path: 'value', type: 'string'} | ||
} | ||
value: {path: 'value', type: 'string'}, | ||
}, | ||
}, | ||
'task.statusChangelog': { | ||
path: 'task.statusChangelog', | ||
nestedPaths: { | ||
changedAt: { | ||
path: 'changedAt', | ||
type: 'timestamp' | ||
type: 'epoch_millis', | ||
}, | ||
'status.category': { | ||
path: 'status.category', | ||
type: 'string' | ||
type: 'string', | ||
}, | ||
'status.detail': { | ||
path: 'status.detail', | ||
type: 'string' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
type: 'string', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
}); | ||
}); | ||
|
@@ -757,7 +760,7 @@ describe('query adapter', () => { | |
status: {category: 'c1a', detail: 'd1a'} | ||
}, | ||
{ | ||
changedAt: 1667871145261, | ||
changedAt: '2022-11-08T01:32:25.261Z', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test a mix of epoch millis and ISO timestamps that are inside embedded object lists are converted to epoch millis. |
||
status: {category: 'c1b', detail: 'd1b'} | ||
} | ||
] | ||
|
@@ -774,7 +777,7 @@ describe('query adapter', () => { | |
status: {category: 'c2a', detail: 'd2a'} | ||
}, | ||
{ | ||
changedAt: 1667871145261, | ||
changedAt: '2022-11-08T01:32:25.261Z', | ||
status: {category: 'c2b', detail: 'd2b'} | ||
} | ||
] | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment is out-of-date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's accurate? This is pointing out an inconsistency in the v1 schema where refreshedAt is serialized as a timestamp, but is typed as a string. If we left the type as a string instead of overriding it, then we wouldn't convert the ISO timestamp to an epoch millis string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I was being too literal. The override type is now
epoch_millis_string
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. True.