fix: match credential type names with substring search (AAP-81333) - #1677
fix: match credential type names with substring search (AAP-81333)#1677abhishek-paygavhan wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe credential type name filter now performs case-insensitive substring matching. Integration tests cover substring, prefix, and non-matching queries. ChangesCredential type filtering
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to Credential type searches now support case-insensitive substring matching while retaining prefix matches, with coverage for the changed behavior and no current merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The credential type dropdown sent name=<term>, which used istartswith and missed types such as "Red Hat Ansible Automation Platform" when users searched for "Ansible". Use icontains so the filter matches anywhere in the name. Co-authored-by: Cursor <cursoragent@cursor.com>
4188704 to
e443ca4
Compare
|
Hello EDA maintainers, Could you please review this PR and approve the pending CI workflows when you have a chance? All 59 credential-type integration tests and local lint checks passed. The commit is now signed and shows as Verified on GitHub. Could you also advise whether the CodeRabbit docstring coverage warning requires changes? The newly added test already includes a docstring. Thank you for your time and guidance. |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1677 +/- ##
=======================================
Coverage 93.39% 93.39%
=======================================
Files 247 247
Lines 11698 11698
=======================================
Hits 10925 10925
Misses 773 773
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|



Summary
Update the EDA credential type name filter from
istartswithtoicontainsso searches match text anywhere in a credential type name, regardless of case.Jira: https://redhat.atlassian.net/browse/AAP-81333
What is being changed?
namefilter lookup insrc/aap_eda/api/filters/credential_type.pytoicontains.Why is this change needed?
Searching for
Ansibledoes not returnRed Hat Ansible Automation Platformbecause the previous filter only matched names beginning with the search term.Users should be able to find credential types using partial names without manually browsing the full list.
How does this change address the issue?
The existing
?name=<term>parameter now performs case-insensitive substring matching. Searching forAnsiblecan therefore matchRed Hat Ansible Automation Platform, while prefix searches continue to work.Dependencies, blockers, and compatibility
namefilter intentionally returns a broader set of matches than the previous prefix-only behavior.Testing
Targeted regression test passed:
test_list_credential_types_filter_name_contains.Complete credential-type integration test file passed: 59 passed.
Lint checks passed, including the database migration consistency check.
Verify the Create Credential workflow in the AAP UI: Automation Decisions → Infrastructure → Credentials → Create Credential. Search for
Ansiblein the Credential Type dropdown and confirm thatRed Hat Ansible Automation Platformappears.Verify lowercase and uppercase search terms in the UI.
Previous PRs
This PR replaces #1674 and #1675, which were closed before local validation was completed. The backend tests and lint checks listed above have now been completed successfully.
Summary by CodeRabbit