Skip to content

Check if the copy file source is absolute#261

Open
sudhackar wants to merge 1 commit intocanonical:mainfrom
sudhackar:copy-file-path-fix
Open

Check if the copy file source is absolute#261
sudhackar wants to merge 1 commit intocanonical:mainfrom
sudhackar:copy-file-path-fix

Conversation

@sudhackar
Copy link
Copy Markdown
Member

From the mm discussion
https://github.com/canonical/ubuntu-image/blob/main/internal/imagedefinition/README.rst

    copy-file: (optional)
      -
        # The path to the file to copy.
        # The given path will be interpreted as relative to the
        # path of the image definition file if is not absolute.
        source: <string>

mentions

if is not absolute

but the code actually never checks that the path is absolute or not and always use it relative
from :

source := filepath.Join(confDefPath, c.Source)
dest := filepath.Join(targetDir, c.Dest)
if debug {

Simple PR that fixes this.

Signed-off-by: Sudhakar Verma <sudhakar.verma@canonical.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 10, 2024

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.77%. Comparing base (bb3a3fe) to head (0830a68).
⚠️ Report is 162 commits behind head on main.

Files with missing lines Patch % Lines
internal/statemachine/helper.go 25.00% 2 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (bb3a3fe) and HEAD (0830a68). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (bb3a3fe) HEAD (0830a68)
unittests 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #261       +/-   ##
===========================================
- Coverage   93.96%   83.77%   -10.20%     
===========================================
  Files          18       18               
  Lines        3429     4375      +946     
===========================================
+ Hits         3222     3665      +443     
- Misses        133      632      +499     
- Partials       74       78        +4     
Flag Coverage Δ
unittests 83.77% <25.00%> (-10.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

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.

1 participant