fix(workflow): resolve hyphens in ${{ params.X }} identifiers#12
Merged
Conversation
The template resolver regex matched only [\w.]+, so any reference
with a hyphen in the identifier — e.g. ${{ params.vendor-no }} —
was left as a literal token in the rendered filter. The bug
silently affected long-running saved queries (vendor-no, customer-id,
header-id) and also any batch workflow using hyphenated param names.
Add hyphen to the identifier character class in both REFERENCE_PATTERN
and FULL_REFERENCE_PATTERN, plus a regression test that exercises both
the embedded and full-string substitution paths.
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.
Summary
The workflow template resolver matched only
[\w.]+in identifier names, so any${{ params.<key> }}reference with a hyphen in the key — e.g.${{ params.vendor-no }}— was left in the rendered filter as a literal token. The bug affects:bcli q) using hyphenated param names likevendor-no,customer-id,header-idbcli batch) using the same template engineWhen the literal
${{ params.X }}reaches BC inside a$filterexpression, the server either 400s with a confusing length/parse error or, in some cases, simply returns no rows — both silent failure modes that are hard to attribute back to the resolver.What changed
\-to the identifier character class in bothREFERENCE_PATTERNandFULL_REFERENCE_PATTERN(src/bcli/workflow/_resolver.py)tests/test_workflow/test_resolver.py::test_hyphenated_param_name)No public API change. Existing all-word param names continue to behave identically.
Test plan
uv run pytest tests/test_workflow/test_resolver.py— 28 passuv run pytest tests/— 529 pass, 1 skippedbcli q purchase-orders-by-vendor vendor-no=V00099 --shownow rendersfilter: buyFromVendorNumber eq 'V00099'(was:filter: buyFromVendorNumber eq '${{ params.vendor-no }}')