Skip to content

Conversation

@bzwei
Copy link
Collaborator

@bzwei bzwei commented Mar 24, 2025

Fix an internal 500 error when calling api to update an activation on k8s

AAP-42437

If no new name or k8s_service_name is provided when request updating the activation, the values from the existing activation are pulled. They are needed for validation.
In addition, when the k8s_service_name is cleared through the update request, it will be regenerated with the default value.

To test the fix

  1. Update an activation without changing name on k8s, it no longer raises a 500 internal error.
  2. Create an activation with a customized k8s_service_name and clear it through an update, verify the activation's k8s_service_name is assigned to a default value generated based on the activation name.

@bzwei bzwei requested a review from a team as a code owner March 24, 2025 13:48
@bzwei bzwei added the run-e2e label Mar 24, 2025
@sonarqubecloud
Copy link

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.56%. Comparing base (3bc5173) to head (b1ae98b).

@@            Coverage Diff             @@
##             main    #1243      +/-   ##
==========================================
+ Coverage   94.50%   94.56%   +0.05%     
==========================================
  Files         309      309              
  Lines       18047    18059      +12     
==========================================
+ Hits        17055    17077      +22     
+ Misses        992      982      -10     
Flag Coverage Δ
unit-int-tests-3.11 94.50% <100.00%> (+<0.01%) ⬆️
unit-int-tests-3.12 94.56% <100.00%> (?)

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

Files with missing lines Coverage Δ
src/aap_eda/api/serializers/activation.py 96.09% <100.00%> (+0.01%) ⬆️
src/aap_eda/api/views/activation.py 97.66% <100.00%> (+0.05%) ⬆️
tests/integration/api/test_activation.py 98.76% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zkayyali812
Copy link
Collaborator

Hey @bzwei, did you test this on OCP to validate that this fixes the ATF tests?

@bzwei
Copy link
Collaborator Author

bzwei commented Mar 24, 2025

Hey @bzwei, did you test this on OCP to validate that this fixes the ATF tests?

Not directly on OCP. I can reproduce the issue with pytest and verify the fix with the pytest too.

@bzwei bzwei merged commit a058f41 into ansible:main Mar 24, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants