Skip to content

fix: JSON should be set to "success": false when any transactions failed#4201

Merged
Klaim merged 8 commits intomamba-org:mainfrom
Klaim:json-success-false
Mar 31, 2026
Merged

fix: JSON should be set to "success": false when any transactions failed#4201
Klaim merged 8 commits intomamba-org:mainfrom
Klaim:json-success-false

Conversation

@Klaim
Copy link
Copy Markdown
Member

@Klaim Klaim commented Mar 19, 2026

Description

I found some cases while working on #4126 where the JSON output would set "success": true while MTransaction::execution actually failed, leading to potentially succeeding integration tests which check for that value.

This PR attempts to make the JSON output correct and reveal tests that are actually not passing.

Type of Change

  • Bugfix
  • Feature / enhancement
  • CI / Documentation
  • Maintenance

Checklist

  • My code follows the general style and conventions of the codebase, ensuring consistency
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run pre-commit run --all locally in the source folder and confirmed that there are no linter errors.
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

@github-actions github-actions bot added the release::bug_fixes For PRs fixing bugs label Mar 19, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.75%. Comparing base (115e080) to head (8922f36).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
libmamba/include/mamba/core/output.hpp 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4201      +/-   ##
==========================================
- Coverage   53.54%   52.75%   -0.79%     
==========================================
  Files         239      239              
  Lines       29275    29278       +3     
  Branches     3107     3108       +1     
==========================================
- Hits        15675    15446     -229     
- Misses      13597    13829     +232     
  Partials        3        3              

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

@Klaim Klaim mentioned this pull request Mar 19, 2026
11 tasks
@Klaim Klaim force-pushed the json-success-false branch from 3b13f8c to 6084967 Compare March 25, 2026 18:24
@jjerphan
Copy link
Copy Markdown
Member

jjerphan commented Mar 26, 2026

The failure of TestMultiplePkgCaches::test_no_writable_extracted_dir_corrupted comes from those changes from #4123 (mamba does not actually support read-only caches, does it?) and which should be reverted IMO.

See: #4213

@jjerphan jjerphan mentioned this pull request Mar 26, 2026
11 tasks
@Klaim Klaim force-pushed the json-success-false branch from a1bfd28 to 6084967 Compare March 27, 2026 13:48
`TestMultiplePkgCaches::test_no_writable_extracted_dir_corrupted`

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@Klaim
Copy link
Copy Markdown
Member Author

Klaim commented Mar 27, 2026

@jjerphan Weird: that ci failure wasnt visible in your pr but it's the same sequence of commits here. I'm suspecting a timing issue, although the test is about detecting a "hang". I'll re-run to be sure but I think maybe that timeout is optimistically short?

@jjerphan
Copy link
Copy Markdown
Member

We can increase the value for the timeout (we have done that several time in the past).

@Klaim Klaim marked this pull request as ready for review March 30, 2026 10:00
Copy link
Copy Markdown
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

Thank you.

Are there way we can test it?

@Klaim
Copy link
Copy Markdown
Member Author

Klaim commented Mar 30, 2026

Are there way we can test it?

I'm not sure if we actually can test it in a way that's always correct. A command that should always fail in the transaction execution?
Any suggestion?

Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan
Copy link
Copy Markdown
Member

What if we SIGINT an installation of an environment?

@Klaim
Copy link
Copy Markdown
Member Author

Klaim commented Mar 30, 2026

What if we SIGINT an installation of an environment?

If I understand correctly, that would rely on timing to trigger the exception in the MTransaction::execution function, it wouldnt be very reliable?

How about attempting to get a package from an impossible url? I suspect that might fail before that function though. Maybe with an incorrect build id?

@jjerphan
Copy link
Copy Markdown
Member

jjerphan commented Mar 30, 2026

We should be able to use an explicit environment specification with a faulty package.

@Klaim
Copy link
Copy Markdown
Member Author

Klaim commented Mar 30, 2026

We should be able to use an explicit environment specification with a faulty package.

I suspect we might have one somewhere in the tests, I'll look into it or create it👍🏼

@JohanMabille JohanMabille mentioned this pull request Mar 31, 2026
11 tasks
Copy link
Copy Markdown
Member

@JohanMabille JohanMabille left a comment

Choose a reason for hiding this comment

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

LGTM once the linter is fixed.

@Klaim Klaim merged commit c527708 into mamba-org:main Mar 31, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release::bug_fixes For PRs fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants