Skip to content

Hotfix: drop name field in run guardrail endpoint#86

Open
nishika26 wants to merge 2 commits intomainfrom
hotfix/drop_name
Open

Hotfix: drop name field in run guardrail endpoint#86
nishika26 wants to merge 2 commits intomainfrom
hotfix/drop_name

Conversation

@nishika26
Copy link
Copy Markdown
Contributor

@nishika26 nishika26 commented Apr 11, 2026

Notes

  • Bug Fixes
    • Improved validator configuration processing to ensure consistent payload normalization when validators are submitted through the API.
    • In simpler words now that we have included name as well in the config of validator config, then name will be in the response body of the get validator config endpoint as well. Nowin kaapi backend's code, according to the given validator config id, we fetch the validator config and pass it to run guardrails endpoint, we have to specify the fields this endpoint should ignore so that we have to only process values needed to run the validator, that is why making this change was needed

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

📝 Walkthrough

Walkthrough

A single field (name) is added to the list of validator attributes that are removed from incoming API payloads during normalization in the GuardrailRequest schema class.

Changes

Cohort / File(s) Summary
Validator Payload Normalization
backend/app/schemas/guardrail_config.py
Added name field to the drop_fields set in normalize_validators_from_config_api, expanding the list of attributes stripped during validator dict normalization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A tiny tweak, so small and neat,
The name field removed, mission complete!
One line added, no fuss or strife—
Cleaner validators, simpler life! 🌿✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Hotfix: drop name field in run guardrail endpoint' is clear, specific, and directly matches the main change: removing the name field from validator normalization in the guardrail endpoint.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/drop_name

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nishika26 nishika26 self-assigned this Apr 12, 2026
@nishika26 nishika26 added bug Something isn't working ready-for-review labels Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant