Skip to content

Conversation

@tgodara-aws
Copy link
Contributor

Problem

Job history-related code is scattered throughout various files, making it difficult to review and understand.

Solution

Centralize existing history functions in a new file and add helper functions to declutter transformation flow. Update and simplify unit tests accordingly.


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@amazon-inspector-ohio
Copy link

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@amazon-inspector-ohio
Copy link

✅ I finished the code review, and didn't find any security or code quality issues.

const metadata: JobMetadata = {
jobId: jobId,
projectName: transformByQState.getProjectName(),
transformationType: transformByQState.getTransformationType() ?? TransformationType.LANGUAGE_UPGRADE,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious here, so what would happen for SQL conversions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically transformByQState.getTransformationType() should not be undefined at this point, so it will be written as "SQL Conversion" in the metadata file. But the ?? TransformationType.LANGUAGE_UPGRADE is there just in case for some odd reason it is undefined.

`
}

private async refreshJob(jobId: string, currentStatus: string, projectName: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We are taking a lot of stuff out here and moving to a different file for this refactor. Just ensure we don't miss anything or introduce logic that wasn't covered before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup! No major new logic, just moved these functions to a new file where it would make a little more sense and created some helper functions to make things neater. Functionality remains the same for the entire feature.

import { ExportResultArchiveStructure } from '../../../shared/utilities/download'
import { isFileNotFoundError } from '../../../shared/errors'

export interface HistoryObject {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know previously these were in code whisperer constants and now they got moved to this file. Did we want to keep them in code whisperer constants still and import them for use here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm leaving them here for now just because they have the most context within this file and I didn't see any interfaces defined in the constants file, but if they would be better suited in the constants file, I'd be happy to move them.

@tgodara-aws tgodara-aws force-pushed the refactor/transformation-history branch 2 times, most recently from 2e29b54 to 1da46b7 Compare August 8, 2025 05:51
@tgodara-aws tgodara-aws force-pushed the refactor/transformation-history branch from 1da46b7 to c9d234b Compare August 8, 2025 17:18
@tgodara-aws tgodara-aws force-pushed the refactor/transformation-history branch from c9d234b to 7966432 Compare August 8, 2025 17:43
@tgodara-aws tgodara-aws marked this pull request as ready for review August 8, 2025 18:01
@tgodara-aws tgodara-aws requested a review from a team as a code owner August 8, 2025 18:01
Copy link
Contributor

@laileni-aws laileni-aws left a comment

Choose a reason for hiding this comment

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

LGTM

@laileni-aws laileni-aws enabled auto-merge (squash) August 8, 2025 20:48
@laileni-aws laileni-aws merged commit 0e09993 into aws:master Aug 8, 2025
21 of 22 checks passed
laura-codess pushed a commit to laura-codess/aws-toolkit-vscode that referenced this pull request Aug 11, 2025
## Problem
Job history-related code is scattered throughout various files, making
it difficult to review and understand.

## Solution
Centralize existing history functions in a new file and add helper
functions to declutter transformation flow. Update and simplify unit
tests accordingly.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
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.

5 participants