-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Ingestion update finalize(MAPCO-4442) #24
Conversation
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.
Good job!
src/job/models/jobHnadler.ts
Outdated
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.
file name typo
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.
changed
src/job/models/jobHnadler.ts
Outdated
|
||
protected async markFinalizeStepAsCompleted<T>(jobId: string, taskId: string, step: keyof T, finalizeTaskParams: T): Promise<T> { | ||
const updatedParams: T = { ...finalizeTaskParams, [step]: true }; | ||
await this.queueClient.jobManagerClient.updateTask(jobId, taskId, { parameters: updatedParams }); |
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.
Add debug log for step 'x' marked as completed after update action
src/job/models/jobHnadler.ts
Outdated
} | ||
|
||
protected async markFinalizeStepAsCompleted<T>(jobId: string, taskId: string, step: keyof T, finalizeTaskParams: T): Promise<T> { | ||
const updatedParams: T = { ...finalizeTaskParams, [step]: true }; |
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.
Define type FinalizeTaskParams and use it instead of the generic T
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.
export type FinalizeTaskParams = IngestionNewFinalizeTaskParams | IngestionUpdateFinalizeTaskParams | IngestionSwapUpdateFinalizeTaskParams;
<T extends FinalizeTaskParams>
src/job/models/jobHnadler.ts
Outdated
import { Logger } from '@map-colonies/js-logger'; | ||
import { layerNameSchema } from '../../utils/zod/schemas/jobParametersSchema'; | ||
|
||
export abstract class JobHandler { |
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.
remove abstract
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.
removed
}); | ||
expect(catalogClientMock.update).toHaveBeenCalledWith(job); | ||
expect(jobManagerClientMock.updateTask).toHaveBeenCalledWith(job.id, task.id, { parameters: { updatedInCatalog: true } }); | ||
expect(queueClientMock.ack).toHaveBeenCalledWith(job.id, task.id); |
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.
Please add updateJob
toHaveBeenCalledTimes(1)
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.
already exists (changed hierarchy for clarity )
Further information:
*Handling
finalize
task forIngestion_Update
*Remove configuration for isNewTarget flag (useNewTargetFlag)