Skip to content

[Bug] kit-translate: environment values are truncated at the first #, including quoted values #559

Open

Description

@basiliskus

kit_spec_env removes everything from the first # (sub(/[[:space:]]*#.*/, "", v)) before unquoting, so a # that is part of the value is lost:

environment:
  B: "a#b"
  C: 'x #y'
  D: http://e.example.org/#frag

Observed at v4.0.1:

B  a
C  x
D  http://e.example.org/

This breaks URL fragments, git+https://…#ref= pins, and hex colors passed through environment, silently. acq kit validate reports OK.

Related: #412 (multiline environment values, closed), the same line-based parser.

Expected: inside a quoted value, # is literal; in an unquoted value, only # (whitespace then #) starts a comment, as in YAML. If that is out of scope for the line-based parser, reject # in values in acq kit validate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions