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

Merge Sequence Editors Time library #1324

Closed
wants to merge 17 commits into from

Conversation

goetzrrGit
Copy link
Contributor

@goetzrrGit goetzrrGit commented Jun 5, 2024

Closes #1318

The eDSL and SeqN editors previously used separate time libraries with overlapping functionality. To streamline code and improve maintainability, I've merged them into a single, unified library.

Note: Ignore the first 3 commits. They will fall-off when I rebase.

@goetzrrGit goetzrrGit requested a review from a team as a code owner June 5, 2024 22:58
@goetzrrGit goetzrrGit added sequencing Anything related to the sequencing domain labels Jun 5, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to have a separate time-utils file when we already have a time utils?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No real reason beside not knowing about the time utils. Also, this is sequence specific times which has its own set of time tag rules.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that was one of my requests in the sequence ticket. Could the exported functions in this file potentially be used outside of the sequence context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They can I need to look at the other time utils and see what I can do.

@duranb duranb mentioned this pull request Jun 6, 2024

export const RELATIVE_TIME = /([0-9]{3}T)?([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]+)?$/g;
export const RELATIVE_SIMPLE = /(\d+)(\.[0-9]+)?$/g;
export enum TimeTypes {
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is a time.ts enum file where this could probably be placed for easier discoverability


export const EPOCH_TIME = /(^[+-]?)([0-9]{3}T)?([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]+)?$/g;
export const EPOCH_SIMPLE = /(^[+-]?)(\d+)(\.[0-9]+)?$/g;
export const RELATIVE_TIME = /^([0-9]{3}T)?([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[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.

Is it necessary for other places to be using these regexs? Could the testTime function be repurposed to instead of taking the regex as a parameter, take the TimeType as a parameter to be used in combination with the new getTimeRegex function?

@@ -13,7 +13,7 @@ export const sequenceProvideCodeActions = (
.map(unbalancedTime => {
const match = unbalancedTime.message.match(/Suggestion:\s*(.*)/);
if (match) {
const extractSuggestedTime = match[1].replace(/\s+/g, '');
const extractSuggestedTime = match[1].replace(/\s+/, '').replace(/\[|\]/g, '');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be combined to match[1].replace(/\s+|[\[|\]]/g, '')?

* For string arguments
* For descriptions
This was causing the custom worker to incorrectly label the tree nodes and break the custom checks.
* Fix regex and remove 'g'
* Added TimeTypes enum instead of passing regex into the utils class
* Add doc info
* Uses the update time-utils 'TimeType' enum for the checks
* Use the regex instead of the `testTime` function
* The time check in the custom worker is using the time-utils for its time validation.
* Remove duplicate/obsolete code
* Updated the Error Codes in the custom worker to match the seqN.txt thus make the whole Aerie sequencing suite uniform
* The custom worker quick action to replace an unbalanced time wasn't replacing the time tag correctly
Not sure why these errors are appearing as I didn't touch these files???
* Add sequence related utilities function to the library
@goetzrrGit goetzrrGit force-pushed the refactor/sequence-time-utils branch from b0b450f to ff76c00 Compare June 17, 2024 17:56
@goetzrrGit
Copy link
Contributor Author

Ditching this pr for a newer one

#1339

@goetzrrGit goetzrrGit closed this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sequencing Anything related to the sequencing domain
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Unify SeqN and TS eDSL Time Validator
3 participants