Skip to content

CFE-4708: Added support for a path-variable in def.json to specify files to ship beyond just extension-matching - #336

Open
SimonThalvorsen wants to merge 1 commit into
cfengine:masterfrom
SimonThalvorsen:CFE-4708
Open

CFE-4708: Added support for a path-variable in def.json to specify files to ship beyond just extension-matching#336
SimonThalvorsen wants to merge 1 commit into
cfengine:masterfrom
SimonThalvorsen:CFE-4708

Conversation

@SimonThalvorsen

Copy link
Copy Markdown
Contributor

Ticket: CFE-4708
Changelog: Added support for input-files-paths to be placed input_paths_extra to allow specified files to ship independent of what is specified in input_name_patterns[_extra]

@SimonThalvorsen

Copy link
Copy Markdown
Contributor Author

@SimonThalvorsen
SimonThalvorsen force-pushed the CFE-4708 branch 2 times, most recently from 8ea72b6 to 0b141b0 Compare August 24, 2026 12:00
@SimonThalvorsen
SimonThalvorsen marked this pull request as draft August 24, 2026 15:18
@SimonThalvorsen
SimonThalvorsen marked this pull request as ready for review August 26, 2026 06:59
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.15%. Comparing base (41de10d) to head (17e1595).

Files with missing lines Patch % Lines
cfbs/build.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #336      +/-   ##
==========================================
+ Coverage   66.73%   67.15%   +0.42%     
==========================================
  Files          23       23              
  Lines        4623     4634      +11     
==========================================
+ Hits         3085     3112      +27     
+ Misses       1538     1522      -16     
Files with missing lines Coverage Δ
cfbs/build.py 76.08% <92.85%> (+5.21%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SimonThalvorsen
SimonThalvorsen marked this pull request as draft August 26, 2026 13:54
@SimonThalvorsen
SimonThalvorsen force-pushed the CFE-4708 branch 3 times, most recently from d1f33df to fcb86db Compare September 3, 2026 15:30
@SimonThalvorsen
SimonThalvorsen marked this pull request as ready for review September 3, 2026 15:30
…les to ship beyond just extension-matching

Ticket: CFE-4708
Changelog: Added support for input-files-paths to be placed `input_paths_extra` to allow specified files to ship
independent of what is specified in `input_name_patterns[_extra]`

Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
Comment thread cfbs/build.py
# relative path.
relative_paths = [path.replace(os.sep, "/") for path in localized_paths]
extras = merge_json(
extras, {"vars": {"default:update_def.input_paths_extra": relative_paths}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be some validation that the masterfiles version that is part of the current project supports this facility?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, would work fine for "normal" files on any version, but it does not have a check for that, so this step should have a guard. Can add tomorrow, out of office for the day

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it will only work when masterfiles carries that patch we made. So if this feature is being used and the masterfiles module is not version 3.29.0 or greater it would fail. We can backport the change in masterfiles but still then they woul dhave to be using masterfiles 3.27.2 or greater in the 3.27 seiries, 3.24.5 or greater in the 3.24 series or 3.29.0 or greater

Comment thread tests/test_build.py


def test_localize_file_inputs_rejects_path_traversal(tmp_path, monkeypatch):
"""An absolute (or '..'-laden) response would otherwise let os.path.join

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lade, that verb is new to me

Comment thread tests/test_build.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants