Skip to content

Conversation

@arjun11-malik
Copy link
Contributor

@arjun11-malik arjun11-malik commented Aug 4, 2025

Issue

Fixes Issue #649

Solution

Replaced the improper usage of event.set_results(success=False) with event.fail("...").
Also added a unit test for get-cluster-status action to cover both success and failure scenarios.

Checklist

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.37%. Comparing base (e7c1809) to head (7fe7885).
⚠️ Report is 190 commits behind head on main.

Files with missing lines Patch % Lines
lib/charms/mysql/v0/mysql.py 75.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #663      +/-   ##
==========================================
- Coverage   66.25%   63.37%   -2.88%     
==========================================
  Files          17       20       +3     
  Lines        3180     4623    +1443     
  Branches      424      759     +335     
==========================================
+ Hits         2107     2930     +823     
- Misses        935     1445     +510     
- Partials      138      248     +110     

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

@arjun11-malik arjun11-malik changed the title Fix: replace event.set_results(success=False) with event.fail() in get-cluster-status Bug: replace event.set_results(success=False) with event.fail() in get-cluster-status Aug 4, 2025
@arjun11-malik arjun11-malik changed the title Bug: replace event.set_results(success=False) with event.fail() in get-cluster-status bug : replace event.set_results(success=False) with event.fail() in get-cluster-status Aug 4, 2025
@paulomach paulomach added the bug Something isn't working as expected label Aug 4, 2025
status = self._mysql.get_cluster_status()

if not status:
event.fail("Failed to read cluster status. See logs for more information.")
Copy link
Contributor

Choose a reason for hiding this comment

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

@arjun11-malik make sure that the output change is not being misinterpreted on the the failing tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ve double-checked every integration test that invokes get-cluster-status—they only wait for the action to complete and then read out results["status"]. None of them inspect the old success=False payload or rely on its exact shape, so switching to event.fail() on empty status won’t change their behavior.

@astrojuanlu astrojuanlu force-pushed the bugfix/get-cluster-status-fail branch from 7fe7885 to 4f9ad9d Compare October 22, 2025 08:56
@sinclert-canonical
Copy link
Contributor

Arjun is no longer in the company, and the bug-fix has been picked up by @astrojuanlu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants