test: verify database stack migration - #46
Conversation
SummaryThis PR adds a new Note: The PR title and description reference a database stack migration verification (sc_rds DatabaseStack on dev18), but the actual code change is unrelated to databases — it's a new utility module. This appears to be either a mislabeled PR or the description was copied from elsewhere. Clarify with the author what this PR is actually testing. ❌ The last analysis has failed. See analysis details on SonarQube Cloud What reviewers should knowWhat to review:
Gotcha: The PR metadata doesn't match the code. Either this is intentionally testing webhook/enablement mechanisms with dummy code, or there's confusion about what this PR contains. Clarify the actual intent before approving.
|
| if len(s) <= max_length: | ||
| return s | ||
| return s[: max_length - len(suffix)] + suffix |
There was a problem hiding this comment.
Bug: When max_length < len(suffix), the slice index becomes negative, so Python interprets it as an offset from the end of the string. The result is a string that exceeds max_length.
Example: truncate("hello", 2, "...") → s[:-1] + "..." → "hell..." (7 chars, not 2).
Add a guard before the slice to handle this case:
| if len(s) <= max_length: | |
| return s | |
| return s[: max_length - len(suffix)] + suffix | |
| if len(s) <= max_length: | |
| return s | |
| if max_length <= len(suffix): | |
| return suffix[:max_length] | |
| return s[: max_length - len(suffix)] + suffix |
- Mark as noise
SummaryThis PR adds a new Note: The PR title and description reference database stack migration verification, but the actual changes are a new string utilities module. This appears to be a test/validation PR (as indicated by the commit message "trigger webhook for enablement test"), so the metadata and code changes may not be directly related. What reviewers should knowWhat to review:
Context for reviewers:
|
Test PR to verify sc_rds DatabaseStack works on dev18.