Skip to content

Fix #233: Add backend validation for environment variable names - #548

Merged
pdettori merged 5 commits into
rossoctl:mainfrom
RyanJenkins99:fix/233-env-var-validation
Feb 10, 2026
Merged

pdettori merged 5 commits into
rossoctl:mainfrom
RyanJenkins99:fix/233-env-var-validation

Conversation

@RyanJenkins99

Copy link
Copy Markdown
Contributor

Problem

Closes #233

Users could enter invalid environment variable names like MCP_TRANSPORT=http which would be accepted by the backend but fail silently in Kubernetes, causing "Deployment not found" errors.

Solution

Added backend validation to reject invalid env var names before deployment:

  • Must start with letter or underscore
  • Can only contain letters, digits, and underscores
  • Returns clear error messages on invalid input

Testing

  • ✅ Manual: Tested invalid names (MCP_TRANSPORT=http, MY-VAR, 123VAR) - rejected
  • ✅ Manual: Tested valid names (API_KEY, _PRIVATE) - accepted
  • ✅ Automated: Added test suite with 14 test cases

Changes

  • Modified: agents.py, tools.py - added validation
  • Added: test_env_var_validation.py - test coverage

@pdettori

Copy link
Copy Markdown
Member

@RyanJenkins99 thanks for your PR - before we can review it, could you please amend your commit to pass the DCO check ? Instructions are in the link to the DCO check

@RyanJenkins99
RyanJenkins99 force-pushed the fix/233-env-var-validation branch from 11e8d21 to 452ecef Compare January 27, 2026 09:47
@RyanJenkins99

Copy link
Copy Markdown
Contributor Author

@pdettori thanks for letting me know! That change has been made.

@pdettori

Copy link
Copy Markdown
Member

@RyanJenkins99 thanks, could you please fix the linting error ?

@pdettori

Copy link
Copy Markdown
Member

Check this doc to run the lint as pre-commit hook.

@RyanJenkins99
RyanJenkins99 force-pushed the fix/233-env-var-validation branch from efb59c1 to 18df834 Compare January 30, 2026 10:14
@pdettori

Copy link
Copy Markdown
Member

@RyanJenkins99 could you please check CI linting issues and rebase?

@evaline-ju evaline-ju moved this from Backlog to In progress in Rossoctl Issue Prioritization Feb 2, 2026
RyanJenkins99 added a commit to RyanJenkins99/kagenti that referenced this pull request Feb 5, 2026
…#549

PR rossoctl#549 should only contain description field changes for agents/tools
deployed from images vs built from source. The environment variable
validation logic from PR rossoctl#548 was incorrectly included and has been
removed.

Changes removed:
- Backend validation in agents.py and tools.py
- Frontend validation in ImportAgentPage.tsx and ImportToolPage.tsx
- Test file test_env_var_validation.py

The description field changes from PR rossoctl#549 are preserved.

Signed-off-by: Ryan Jenkins <[email protected]>
@RyanJenkins99
RyanJenkins99 force-pushed the fix/233-env-var-validation branch from 18df834 to ee1c694 Compare February 9, 2026 16:48
pdettori pushed a commit to pdettori/rossoctl that referenced this pull request Feb 10, 2026
…#549

PR rossoctl#549 should only contain description field changes for agents/tools
deployed from images vs built from source. The environment variable
validation logic from PR rossoctl#548 was incorrectly included and has been
removed.

Changes removed:
- Backend validation in agents.py and tools.py
- Frontend validation in ImportAgentPage.tsx and ImportToolPage.tsx
- Test file test_env_var_validation.py

The description field changes from PR rossoctl#549 are preserved.

Signed-off-by: Ryan Jenkins <[email protected]>

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm - thank you @RyanJenkins99 !

@pdettori
pdettori merged commit a185106 into rossoctl:main Feb 10, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Rossoctl Issue Prioritization Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: Deployment Not Found

2 participants