Skip to content

metadata_ lines with semicolons raise ArgumentError: Unparseable semicolon predicate #68

@trespilhas

Description

@trespilhas

metadata_ lines with semicolons raise ArgumentError: Unparseable semicolon predicate

Summary

The text file parser treats ; as a predicate separator on all lines, including metadata_* lines. When a metadata value contains a semicolon (e.g. metadata_continuing_business_justification), the parser raises:

ArgumentError: Unparseable semicolon predicate "..." in ...

Steps to Reproduce

Create a .txt entitlement file with:

metadata_continuing_business_justification = Need access; required for project work

Run the entitlements CI. The parser calls parsed_predicate on the value required for project work, which fails because it's not a valid predicate expression.

Root Cause

In lib/entitlements/data/groups/calculated/text.rb, the semicolon-predicate bypass only checks for key == "description". Metadata lines have free-form text values (like description) but are not exempted, so their values are split on ; and fed to parsed_predicate.

Proposed Fix

Extend the existing description exemption to also cover metadata_ prefixed keys:

if key == "description" || key.start_with?("metadata_")
  result[key][operator] << { key: val }
else
  result[key][operator] << parsed_predicate(val)
end

This preserves semicolons in metadata values while still stripping inline # comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions