Add new date fields from API to variant analysis types
This will add some new date fields that have been added in the API to the variant analysis types and factories. They are stored as strings since storing them as `Date` would make the types inconsistent if they are serialized to JSON (`JSON.stringify` -> `JSON.parse` would result in strings rather than dates).
This commit is contained in:
@@ -24,7 +24,10 @@ export interface VariantAnalysis {
|
||||
actor_id: number,
|
||||
query_language: VariantAnalysisQueryLanguage,
|
||||
query_pack_url: string,
|
||||
created_at: string,
|
||||
updated_at: string,
|
||||
status: VariantAnalysisStatus,
|
||||
completed_at?: string,
|
||||
actions_workflow_run_id?: number,
|
||||
failure_reason?: VariantAnalysisFailureReason,
|
||||
scanned_repositories?: VariantAnalysisScannedRepository[],
|
||||
|
||||
@@ -15,8 +15,11 @@ export interface VariantAnalysis {
|
||||
repositoryLists?: string[],
|
||||
repositoryOwners?: string[],
|
||||
},
|
||||
createdAt: string,
|
||||
updatedAt: string,
|
||||
executionStartTime: number;
|
||||
status: VariantAnalysisStatus,
|
||||
completedAt?: string,
|
||||
actionsWorkflowRunId?: number,
|
||||
failureReason?: VariantAnalysisFailureReason,
|
||||
scannedRepos?: VariantAnalysisScannedRepository[],
|
||||
|
||||
@@ -56,7 +56,10 @@ export function processUpdatedVariantAnalysis(
|
||||
query: previousVariantAnalysis.query,
|
||||
databases: previousVariantAnalysis.databases,
|
||||
executionStartTime: previousVariantAnalysis.executionStartTime,
|
||||
createdAt: response.created_at,
|
||||
updatedAt: response.updated_at,
|
||||
status: processApiStatus(response.status),
|
||||
completedAt: response.completed_at,
|
||||
actionsWorkflowRunId: response.actions_workflow_run_id,
|
||||
scannedRepos: scannedRepos,
|
||||
skippedRepos: skippedRepos
|
||||
|
||||
@@ -21,6 +21,8 @@ describe(VariantAnalysisAnalyzedRepos.name, () => {
|
||||
},
|
||||
databases: {},
|
||||
executionStartTime: 1611234567890,
|
||||
createdAt: '2021-01-21T13:09:27.890Z',
|
||||
updatedAt: '2021-01-21T13:09:27.890Z',
|
||||
status: VariantAnalysisStatus.InProgress,
|
||||
scannedRepos: [
|
||||
{
|
||||
|
||||
@@ -20,6 +20,8 @@ describe(VariantAnalysisOutcomePanels.name, () => {
|
||||
},
|
||||
databases: {},
|
||||
executionStartTime: 1611234567890,
|
||||
createdAt: '2021-01-21T13:09:27.890Z',
|
||||
updatedAt: '2021-01-21T13:09:27.890Z',
|
||||
status: VariantAnalysisStatus.InProgress,
|
||||
scannedRepos: [
|
||||
{
|
||||
|
||||
@@ -28,6 +28,8 @@ export function createMockApiResponse(
|
||||
actor_id: faker.datatype.number(),
|
||||
query_language: VariantAnalysisQueryLanguage.Javascript,
|
||||
query_pack_url: 'https://example.com/foo',
|
||||
created_at: faker.date.recent().toISOString(),
|
||||
updated_at: faker.date.recent().toISOString(),
|
||||
status: status,
|
||||
actions_workflow_run_id: faker.datatype.number(),
|
||||
scanned_repositories: scannedRepos,
|
||||
|
||||
@@ -27,6 +27,8 @@ export function createMockVariantAnalysis(
|
||||
repositories: ['1', '2', '3'],
|
||||
},
|
||||
executionStartTime: faker.datatype.number(),
|
||||
createdAt: faker.date.recent().toISOString(),
|
||||
updatedAt: faker.date.recent().toISOString(),
|
||||
status: status,
|
||||
actionsWorkflowRunId: faker.datatype.number(),
|
||||
scannedRepos: scannedRepos,
|
||||
|
||||
Reference in New Issue
Block a user