Skip to content
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

Merged
merged 16 commits into from
Oct 29, 2024

Conversation

almog8k
Copy link
Collaborator

@almog8k almog8k commented Oct 28, 2024

Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Further information:
*Handling finalize task for Ingestion_Update
*Remove configuration for isNewTarget flag (useNewTargetFlag)

Copy link
Contributor

@CL-SHLOMIKONCHA CL-SHLOMIKONCHA left a comment

Choose a reason for hiding this comment

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

Good job!

Copy link
Contributor

Choose a reason for hiding this comment

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

file name typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed


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 });
Copy link
Contributor

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

}

protected async markFinalizeStepAsCompleted<T>(jobId: string, taskId: string, step: keyof T, finalizeTaskParams: T): Promise<T> {
const updatedParams: T = { ...finalizeTaskParams, [step]: true };
Copy link
Contributor

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

Copy link
Collaborator Author

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>

import { Logger } from '@map-colonies/js-logger';
import { layerNameSchema } from '../../utils/zod/schemas/jobParametersSchema';

export abstract class JobHandler {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove abstract

Copy link
Collaborator Author

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);
Copy link
Contributor

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)

Copy link
Collaborator Author

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 )

@almog8k almog8k merged commit c7efd4e into master Oct 29, 2024
8 checks passed
@almog8k almog8k deleted the ingestion-update-finalize branch October 29, 2024 13:55
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