Skip to content

Expand pattern matching to filename & extension - #1977

Open
JosephVolosin wants to merge 6 commits into
developfrom
feat/pattern-update
Open

Expand pattern matching to filename & extension#1977
JosephVolosin wants to merge 6 commits into
developfrom
feat/pattern-update

Conversation

@JosephVolosin

Copy link
Copy Markdown
Contributor

This PR is the UI implementation of the ValueSchema change here: NASA-AMMOS/plandev-actions#21

To handle the change of pattern to extensionPattern and the inclusion of filenamePattern, the if logic is slightly changed and a new function that preforms a regex search is added.

For more context, see this issue: #1872

@JosephVolosin
JosephVolosin requested a review from a team as a code owner July 23, 2026 20:52

@duranb duranb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you provide some unit tests for this function?

@JosephVolosin

Copy link
Copy Markdown
Contributor Author

Can you provide some unit tests for this function?

Added!

@sonarqubecloud

Copy link
Copy Markdown

@duranb

duranb commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Can you provide some unit tests for this function?

Added!

Thank you! Is there a case where the pattern needs to match multiple parts of the name? For example, is there a naming convention where the filename could be seq_1_nav.seq and the pattern wants to match seq_ and _nav without the number? Is it also okay that this can potentially ignore the file extension?

@JosephVolosin

Copy link
Copy Markdown
Contributor Author

Can you provide some unit tests for this function?

Added!

Thank you! Is there a case where the pattern needs to match multiple parts of the name? For example, is there a naming convention where the filename could be seq_1_nav.seq and the pattern wants to match seq_ and _nav without the number? Is it also okay that this can potentially ignore the file extension?

I think multiple parts is a valid case. With this change, a pattern like this seq_.+?(?=_)_nav should work and properly match files with both seq and nav, with varying content in-between.

I also think its okay that this can potentially ignore the file extension as there's another option specifically for the extension, but maybe we should just condense those two to the same option so it's more clear?

@duranb

duranb commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

I think multiple parts is a valid case. With this change, a pattern like this seq_.+?(?=_)_nav should work and properly match files with both seq and nav, with varying content in-between.

I believe this would require a change that wraps the string in a RegExp object before passing it into search(). Would you mind also adding a test case for that as well?

I also think its okay that this can potentially ignore the file extension as there's another option specifically for the extension, but maybe we should just condense those two to the same option so it's more clear?

No, I think the separation is good as is. It was just more for me to understand.

@JosephVolosin
JosephVolosin deployed to test-workflow August 26, 2026 20:17 — with GitHub Actions Active
@sonarqubecloud

Copy link
Copy Markdown

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