fix: validate config string formats - #3669
Open
Dexter2099 wants to merge 2 commits into
Open
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnables JSON Schema format checking for plugin configuration validation and updates tests/fixtures to use and assert correct RFC3339 File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The new
invalid_date_time_formattest asserts the exact jsonschema error string ("'not-a-date' is not a 'date-time'"), which may be brittle across jsonschema versions or implementations; consider matching on a more stable substring or pattern instead of the full message. - Enabling
format_checkerchanges validation behavior for existing configs that previously passed; if this is expected, consider whether there should be a way to opt out or gate this behavior for plugins that intentionally use non‑RFC3339 date strings.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `invalid_date_time_format` test asserts the exact jsonschema error string (`"'not-a-date' is not a 'date-time'"`), which may be brittle across jsonschema versions or implementations; consider matching on a more stable substring or pattern instead of the full message.
- Enabling `format_checker` changes validation behavior for existing configs that previously passed; if this is expected, consider whether there should be a way to opt out or gate this behavior for plugins that intentionally use non‑RFC3339 date strings.
## Individual Comments
### Comment 1
<location path="tests/core/test_streams.py" line_range="37" />
<code_context>
from tests.core.conftest import SimpleTestTap
-CONFIG_START_DATE = "2021-01-01"
+CONFIG_START_DATE = "2021-01-01T00:00:00Z"
</code_context>
<issue_to_address>
**suggestion (testing):** Consider centralizing the test `start_date` value to avoid drift between tests and fixtures
Since this value must stay in sync with the fixture’s `start_date`, consider defining it once (e.g., as a shared fixture or constant in `conftest.py`) and importing it here. That will prevent format drift across tests and simplify future format changes.
Suggested implementation:
```python
from singer_sdk.helpers.types import Context, Record
from tests.core.conftest import CONFIG_START_DATE, SimpleTestTap
```
To fully implement the centralization, you should also:
1. Define `CONFIG_START_DATE = "2021-01-01T00:00:00Z"` (or whatever value you prefer) in `tests/core/conftest.py`.
2. Ensure any fixtures or helper functions in `tests/core/conftest.py` that use a start date reference this `CONFIG_START_DATE` constant so the tests and fixtures remain synchronized.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3669 +/- ##
=======================================
Coverage 94.36% 94.36%
=======================================
Files 74 74
Lines 6296 6296
Branches 770 770
=======================================
Hits 5941 5941
Misses 266 266
Partials 89 89
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Dexter2099
force-pushed
the
codex/validate-config-string-formats
branch
from
June 5, 2026 22:41
08ee240 to
245d8fc
Compare
Documentation build overview
33 files changed ·
|
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.
Fixes #1451.
Summary
date-timeconfig value raisesConfigValidationError.date-timevalue forstart_date.Validation
uv run pytest tests/core/test_tap_class.py::test_config_errors -quv run pytest tests/core/test_tap_class.py tests/core/test_target_class.py tests/core/test_plugin_base.py tests/core/test_plugin_config.py tests/core/test_jsonschema_helpers.py -quv run pytest tests/core -qpre-commit run --files singer_sdk/plugin_base.py tests/core/test_tap_class.py tests/core/conftest.py tests/core/test_streams.pyNOX_DEFAULT_VENV_BACKEND=uv nox -rs tests-3.11 -- tests/coreSummary by Sourcery
Validate plugin configuration values against their declared JSON Schema formats.
Bug Fixes:
date-timevalues.Tests:
date-timeconfiguration values and update shared test fixtures to use a valid RFC3339 timestamp.