Skip to content

Duplicate paths for files with dots in filename (e.g. version numbers) #266

@raifdmueller

Description

@raifdmueller

Description

Files with version numbers in their name (e.g. DACLI_TEST_RESULTS_v0.4.27.md and DACLI_TEST_RESULTS_v0.4.28.md) are mapped to the same path DACLI_TEST_RESULTS_v0.4. The version number after the last dot is interpreted as a file extension and stripped.

Reproduction

# Two files with version numbers
ls DACLI_TEST_RESULTS_v0.4.27.md DACLI_TEST_RESULTS_v0.4.28.md

# Both get the same path
dacli --format json structure --max-depth 0 2>/dev/null | python3 -c "
import json,sys
data = json.load(sys.stdin)
for s in data['sections']:
    if 'TEST_RESULTS_v0.4' in s['path']:
        print(f\"{s['path']} -> {s['location']['file']}\")
"
# Output:
# DACLI_TEST_RESULTS_v0.4 -> .../DACLI_TEST_RESULTS_v0.4.28.md
# DACLI_TEST_RESULTS_v0.4 -> .../DACLI_TEST_RESULTS_v0.4.27.md

# Only the first file is reachable:
dacli section "DACLI_TEST_RESULTS_v0.4"
# -> Returns v0.4.28 content

# The second file is NOT reachable:
dacli section "DACLI_TEST_RESULTS_v0.4.27"
# -> error: PATH_NOT_FOUND

Impact

  • The second file is unreachable via its path
  • Subsections with the same name (e.g. :zusammenfassung, :fazit) are also duplicated
  • dacli --verbose validate shows the duplicates as WARNING on stderr
  • Affects any files with dots in the filename (version numbers are a common use case)

Expected Behavior

Each file should have a unique path. Possible solutions:

  • Only strip known file extensions (.md, .adoc, .asciidoc)
  • Or include the full filename (without extension) in the path

Environment

  • dacli version: 0.4.26
  • OS: Linux (WSL2)

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