Merged
Conversation
peter-o-addo
marked this pull request as ready for review
July 15, 2026 12:04
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extracts a duplicated “DSN delimiter” validator (_dsn_safe) from several SEP app models into a shared dsn_safe() helper in app/core/utils/fields.py, and updates the checksums/archives/alters apps to use the shared implementation, with new unit tests covering the helper.
Changes:
- Add
dsn_safe(value: str) -> strtoapp/core/utils/fields.pyto reject,and=with a unified error message. - Remove per-app
_dsn_safecopies and switch validators in checksums/archives/alters models to call the shared helper. - Add unit tests in
tests/app/core/utils/test_fields.pyfor the new helper.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/core/utils/fields.py | Adds shared dsn_safe() helper for DSN/CLI delimiter guarding. |
| app/sep/apps/checksums/models.py | Replaces local _dsn_safe with shared dsn_safe in list validators. |
| app/sep/apps/archives/models.py | Replaces local _dsn_safe with shared dsn_safe in destination schema/host validators. |
| app/sep/apps/alters/models.py | Replaces local _dsn_safe with shared dsn_safe in schema/table validators. |
| tests/app/core/utils/test_fields.py | Adds focused unit coverage for dsn_safe(). |
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
yyyyyyyan
approved these changes
Jul 15, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
yyyyyyyan
enabled auto-merge (squash)
July 15, 2026 17:32
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.



Summary
Extract the duplicated
_dsn_safedelimiter guard into a shareddsn_safehelper inapp/core/utils/fields.pyso checksums, archives, and alters reuse one validator for free-typed schema/table/host names.app/core/utils/fields.py: add shareddsn_safe(value: str) -> strthat rejects,and=with a unified "DSN delimiters" error messageapp/sep/apps/checksums/models.py,app/sep/apps/archives/models.py,app/sep/apps/alters/models.py: remove local_dsn_safecopies; import and call the shared helper from existingfield_validatorwrappers (ints andNonestill pass through unchanged)tests/app/core/utils/test_fields.py: addTestDsnSafeunit tests for the shared helper; existing checksums, archives, and alters model/schema tests still passTested
/apps/checksums/new): After filling Task Name, Execution Host, and Database Host, typingbad,namein Databases blocks submit with "DSN delimiters", whilemydb(or an inventory pick) saves OK./apps/archives/new): With sourcesrc_db/src_tbl, destination tabledst_tbl, and WHEREid < 100, typinga,bin Destination Schema shows "DSN delimiters", while leaving Destination Schema empty saves OK./schema-change/alters/new): With task, executor, MySQL service, and alterADD COLUMN x INTfilled, typinga=bin Schema (orbad,namein Table) shows "DSN delimiters", while Schemaappand Tableuserssave OK.Checklist
make test)make run-pre-commit)make makemigrations)changelog.d/if the change is user-facing (make changelog-add), or confirmed N/A (internal-only change, or a same-release-cycle fix for an unreleased sibling ticket)