fix: validate spec:inputs:regex instead of logging a no-op warning#1869
Open
ApoorvaMohan wants to merge 2 commits into
Open
fix: validate spec:inputs:regex instead of logging a no-op warning#1869ApoorvaMohan wants to merge 2 commits into
ApoorvaMohan wants to merge 2 commits into
Conversation
Replace the misleading WARN message with actual regex validation. Valid inputs now pass silently; invalid inputs produce a validation error.
Contributor
There was a problem hiding this comment.
1 issue found across 6 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Invalid regex patterns (e.g. '^[unclosed') now produce a clear configuration error instead of crashing with an uncaught SyntaxError.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Validate spec:inputs:regex instead of logging a no-op warning
Problem
When spec:inputs:regex is used in a GitLab CI configuration, gitlab-ci-local logs a misleading warning:
WARN spec:inputs:regex is currently not supported via gitlab-ci-local. This will just be a no-op.
The input value is never validated against the regex — it just passes through regardless of whether it matches. This means:
Fixes #1864
Fix
Replaced the no-op warning with actual regex validation using JavaScript's RegExp. The input value is now tested against the provided regex pattern:
Changes
src/parser.ts
tests/test-cases/include-inputs/input-templates/regex-validation/ (new)
tests/test-cases/include-inputs/input-templates/regex-validation-pass/ (new)
tests/test-cases/include-inputs/integration.test.ts
Verification
bash
bun run vitest run tests/test-cases/include-inputs/integration.test.ts
All 20 tests pass, including the 2 new regex validation tests.
Summary by cubic
Validate spec:inputs:regex instead of logging a no-op warning. Valid inputs pass silently; invalid inputs or invalid regex patterns now raise clear, GitLab-style errors.
new RegExp(regex)and testString(inputValue).Written for commit 5bd9d65. Summary will update on new commits. Review in cubic