fix: ignore version value in public API snapshot#677
Merged
Conversation
Member
Author
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
.github/scripts/check_public_api.py:22
**No automated test for the placeholder substitution**
The checklist notes that tests were not added. Per the team's stated preference for parameterised tests, it would be worth adding a test that constructs a mock griffe attribute object with `path = "posthog.version.VERSION"` and a concrete value (e.g. `"7.19.1"`) and asserts that `_attribute_details` returns a string containing `= <version>`. If `ATTRIBUTE_VALUE_PLACEHOLDERS` is extended in the future, a parameterised test over the dict would catch regressions automatically.
Reviews (1): Last reviewed commit: "fix: ignore version value in public API ..." | Re-trigger Greptile |
Contributor
posthog-python Compliance ReportDate: 2026-06-18 12:11:54 UTC ✅ All Tests Passed!45/45 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 16/16 tests passed View Details
|
ioannisj
approved these changes
Jun 18, 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.
💡 Motivation and Context
The public API snapshot currently records the literal SDK version value from
posthog.version.VERSION, so routine version bumps can fail the public API check even though the public API shape has not changed.This updates snapshot generation to render that value as
<version>so version-only changes do not cause public API snapshot drift. The focused regression test now runs in the public API CI job instead of the full package test suite.While validating CI, the normal Python test jobs were also hanging at process shutdown because test-created clients registered
atexitjoins and then tried to flush background queues with invalid test API keys. The test suite now disables those clientatexitregistrations so pytest can exit cleanly after assertions pass.💚 How did you test it?
python .github/scripts/test_check_public_api.pyuv run python .github/scripts/check_public_api.py --writeuv run python .github/scripts/check_public_api.pyuv run pytest --collect-only posthog/testuv run pytest --verbose --timeout=30📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with pi. The change is intentionally scoped to the public API snapshot script: only the
posthog.version.VERSIONattribute value is templated, while the symbol remains part of the snapshot so public API additions/removals are still detected. A regression test now covers every configured attribute placeholder as part of the public API CI check.