Skip to content

fix(conversion): resolve local includes relative to parent definition - #295

Merged
aler9 merged 4 commits into
bluenviron:mainfrom
krmartin100:fix/relative-include-paths
Sep 28, 2026
Merged

aler9 merged 4 commits into
bluenviron:mainfrom
krmartin100:fix/relative-include-paths

Conversation

@krmartin100

Copy link
Copy Markdown
Contributor

Fix relative paths in nested XML dialect includes

When a dialect includes sub/child.xml and that file includes
sibling.xml, the latter must be resolved relative to sub/child.xml,
not to the process working directory.

@aler9

aler9 commented Sep 22, 2026

Copy link
Copy Markdown
Member

Hello, fix tests and this will be merged.

@krmartin100
krmartin100 force-pushed the fix/relative-include-paths branch from f649634 to 3bdf64a Compare September 22, 2026 12:35
@krmartin100

krmartin100 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Hello, fixed the tests and force-pushed the updated commit.

@krmartin100
krmartin100 force-pushed the fix/relative-include-paths branch from 3bdf64a to 87cd3e4 Compare September 23, 2026 08:31
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.48%. Comparing base (ad04b34) to head (2121e6a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/conversion/conversion.go 85.71% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #295      +/-   ##
==========================================
+ Coverage   86.00%   86.48%   +0.48%     
==========================================
  Files         696      696              
  Lines        5458     5492      +34     
==========================================
+ Hits         4694     4750      +56     
+ Misses        764      742      -22     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@krmartin100

Copy link
Copy Markdown
Contributor Author

Hello @aler9, can we merge this?

* prevent parsing the same file twice
@aler9

aler9 commented Sep 28, 2026

Copy link
Copy Markdown
Member

i had to improve the PR to deal with a couple of things:

  • dialects were allowed to read files outside their root folder. This is considered a security flaw and is now prevented.
  • some files could be parsed twice when imported from different locations (for instance secondary.xml from root and ../secondary.xml from another folder). This is now prevented and every file is parsed exactly once.

@aler9

aler9 commented Sep 28, 2026

Copy link
Copy Markdown
Member

other than that, this has been merged, thanks!

@aler9
aler9 merged commit 61a09b3 into bluenviron:main Sep 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants