Skip to content

Do not delete already existing composefile when editing it fails - #23

Merged
ycedres merged 2 commits into
mainfrom
bugfix/18/dockercompose
Oct 7, 2026
Merged

ycedres merged 2 commits into
mainfrom
bugfix/18/dockercompose

Conversation

@m-czernek

Copy link
Copy Markdown
Contributor

Not sure why but this line fell out during the migration - https://github.com/saltstack/salt/blob/3006.x/salt/modules/dockercompose.py#L353

This commit brings it back.

What issues does this PR fix or reference?

Fixes: #18

Previous Behavior

A failed edit to a compose file deletes it unconditionally.

New Behavior

A failed edit to a compose file only deletes it if it didn't exist before.

Merge requirements satisfied?

[NOTICE] Bug fixes or new features require tests.

Commits signed with GPG?

Yes/No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.19512% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.90%. Comparing base (cebd4c0) to head (284cad5).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
tests/unit/modules/test_dockercompose.py 12.82% 34 Missing ⚠️
src/saltext/dockermod/modules/dockercompose.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   42.10%   41.90%   -0.21%     
==========================================
  Files          26       26              
  Lines        6545     6629      +84     
  Branches     1138     1146       +8     
==========================================
+ Hits         2756     2778      +22     
- Misses       3542     3601      +59     
- Partials      247      250       +3     
Flag Coverage Δ
Linux 41.89% <12.19%> (-0.21%) ⬇️
project 37.76% <0.00%> (+0.05%) ⬆️
py310 41.84% <12.19%> (-0.21%) ⬇️
py311 41.84% <12.19%> (-0.21%) ⬇️
py314 41.84% <12.19%> (-0.21%) ⬇️
salt_3006_27 41.84% <12.19%> (-0.21%) ⬇️
salt_3008_2 41.84% <12.19%> (-0.21%) ⬇️
tests 49.54% <12.82%> (-0.83%) ⬇️

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

☔ 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.

@ycedres
ycedres merged commit 0fe7109 into main Oct 7, 2026
12 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.

[BUG] dockercompose.service_* functions delete an existing compose file when the edited file fails to load

2 participants