fix: render solid rule borders in disabled-SSL warning banner#2229
Open
anxkhn wants to merge 4 commits into
Open
fix: render solid rule borders in disabled-SSL warning banner#2229anxkhn wants to merge 4 commits into
anxkhn wants to merge 4 commits into
Conversation
When SSL verification is disabled, create_ssl_context logs a warning
banner meant to be framed by three 60-character rules of '='. Each
rule was written as a string literal immediately followed by "=" * 60,
e.g. "\n" "=" * 60. Python applies implicit string-literal
concatenation before the "*" repetition, so this parsed as
("\n=") * 60 and produced a jagged column of single '=' signs on their
own lines instead of one solid rule.
Add an explicit "+" before each "=" * 60 so the repetition applies to
"=" alone. All three borders now render as solid 60-character rules.
Add a regression test asserting the disabled-verification warning
contains exactly three solid 60-character rules and no stray
single-'=' rows.
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the disabled-SSL-verification warning banner in create_ssl_context so its framing rules render as solid 60-character = lines (rather than a jagged column caused by implicit string-literal concatenation precedence), and adds a regression test to lock in the correct formatting.
Changes:
- Adjust warning-banner string construction in
create_ssl_contextto ensure"=" * 60repeats only"="(not"\n="). - Add a regression test that captures the warning via
caplogand asserts exactly three 60-character=runs are present (and no stray single-=rows).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/packages/kagent-adk/src/kagent/adk/models/_ssl.py | Fixes operator-precedence/implicit-concatenation issue so the warning banner borders render as solid rules. |
| python/packages/kagent-adk/tests/unittests/models/test_ssl.py | Adds a caplog-based regression test to verify the banner contains exactly three solid 60-character rule borders. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
makes sense, but we probably don't really need a unit test for this |
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
peterj
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python applies implicit string-literal concatenation before the
*repetition,so
"\n" "=" * 60parses as("\n=") * 60, i.e. sixty\n=pairs, rather than anewline followed by a 60-character rule. All three rules in the banner (top,
separator, and bottom) are affected, so the logged warning looks like this:
The fix
Add an explicit
+before each"=" * 60so the repetition applies to"="alone. All three borders now render as solid 60-character rules:
The change is limited to the string framing; no logging behavior, return value,
or TLS logic changes.
Testing
Added
test_ssl_context_disabled_warning_banner_borders, which captures thewarning via
caplogand asserts the banner contains exactly three solid60-character
=rules and no stray single-=rows. It fails on the current codeand passes with the fix.
ruff checkandruff format --diffare clean on both changed files.