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

#3920 - Update Expected Name for Disbursement File #3963

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix code scan
lewischen-aot committed Nov 19, 2024

Verified

This commit was signed with the committer’s verified signature.
miscco Michael Schellenberger Costa
commit 8f7c3a5d4a76fe5844928749d7d47a80e1a14fe0
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ export class DisbursementReceiptProcessingService {
async process(auditUserId: number): Promise<ProcessSFTPResponseResult[]> {
// Get the list of all files from SFTP ordered by file name.
const fileSearch = new RegExp(
`^${this.esdcConfig.environmentCode}EDU.PBC.DIS.[\w]*\.[0-9]*`,
`^${this.esdcConfig.environmentCode}EDU.PBC.DIS.[\\w]*\\.[0-9]*`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The intermediate points should also be escaped:

^${this.esdcConfig.environmentCode}EDU\\.PBC\\.DIS\\.[\\w]*\\.[0-9]*

Now that the format is well known, a more precise regex could be used, as below.

^${this.esdcConfig.environmentCode}EDU\\.PBC\\.DIS.[0-9]{8}\\.[0-9]{3}$

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @andrewsignori-aot for the precise regex format. The PR is updated with this regex.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks good, minor observation that the $ at the end was part of it, but it would not be a blocker 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The anchor tag is now added. This $ works 🙂

"i",
);
const filePaths = await this.integrationService.getResponseFilesFullPath(