Skip to content

Replace all wildcard instances in variable names#342

Merged
mpkorstanje merged 1 commit into
mainfrom
javascript-fix-escapes
May 19, 2026
Merged

Replace all wildcard instances in variable names#342
mpkorstanje merged 1 commit into
mainfrom
javascript-fix-escapes

Conversation

@mpkorstanje
Copy link
Copy Markdown
Member

@mpkorstanje mpkorstanje commented May 19, 2026

⚡️ What's your motivation?

For GoCD env var can have a dynamic "material" name. E.g. GO_SCM_*_PR_URL or GO_SCM_*_PR_BRANCH. We replace this wildcard with a .* and then look for a matching environment variable using the resulting regex.

For Java and JavaScript we only replace the first occurrence of *. CodeQL thinks this is probably a mistake. Though in practice there is only ever one wildcard.

The other implementations also do replace all occurrences so for consistency Java and JavaScript should do the same.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

For GoCD env var can have a dynamic "material" name. E.g.
`GO_SCM_*_PR_URL` or `GO_SCM_*_PR_BRANCH`. We replace this wildcard
with a `.*` and then look for a matching environment variable using the
resulting regex.

For Java and JavaScript we only replace the first occurrence of `*`.
CodeQL thinks this is probably a mistake. Though in practice there is
only ever one wildcard.

The other implementations also do replace all occurrences so for
consistency Java and JavaScript should do the same.
@mpkorstanje mpkorstanje force-pushed the javascript-fix-escapes branch from 9d3c37e to c27626f Compare May 19, 2026 14:21
@mpkorstanje mpkorstanje marked this pull request as ready for review May 19, 2026 14:22
@mpkorstanje mpkorstanje merged commit 8cb5bc1 into main May 19, 2026
33 checks passed
@mpkorstanje mpkorstanje deleted the javascript-fix-escapes branch May 19, 2026 14:24
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.

1 participant