Skip to content

fprime-merge-dictionary fails for every explicit --name #6060

Description

@sylvesterkaczmarek

Problem

On nasa/fprime-gds devel at dae5a6342c1e0716b174aebdf72be79f117f7d03, every invocation of fprime-merge-dictionary with --name fails before the dictionaries are read.

fprime-merge-dictionary --name Combined --output combined.json first.json second.json

Actual error:

[ERROR] match() missing 1 required positional argument: 'string'

parse_arguments() calls re.match with the identifier pattern but omits args.name. Invocations without --name avoid the error and use the generated deployment name.

Expected behavior

A valid identifier such as Combined should become metadata.deploymentName in the merged dictionary. Invalid identifiers should receive the existing validation error before any output file is written. The complete string must match, so names such as Combined-extra or Combined followed by a newline cannot pass through a prefix-only match.

Reproduction and proposed change

I reproduced this with two temporary JSON dictionaries containing compatible metadata and distinct commands, using the real module CLI in subprocesses. Fifteen of sixteen new regression cases fail against unchanged code; the no-name control passes. Supplying the name to re.fullmatch fixes the CLI while retaining the intended ASCII identifier syntax.

The new tests also check input immutability, preservation of an existing output on validation failure, and metadata compatibility with/without --permissive. Python 3.12.11 on macOS; no flight deployment is involved.

Activity

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions