refactor(python): run aggregate tools on upstream PySNC GlideAggregate#9
Merged
Merged
Conversation
Swap the internals of sn_count / sn_aggregate onto client.GlideAggregate, removing the hand-rolled Stats API plumbing (_stats_request / _parse_stats / _group_key) now that the capability lives upstream. Function signatures and the int / dict / structured-dict return contracts are unchanged. Pin pysnc to the fork branch carrying the contribution (ServiceNow/PySNC#146) until it merges and ships in a release; revert to a version pin then. Parity verified at the real call sites (export-runtime, debug-pc-auto-request) against dev392282: assets/summary.json is byte-identical modulo the export timestamp; distribution.json differs only by data drift since the last snapshot. Earlier dogfood showed 6/6 parity vs the old implementation. Closes #8. Refs ServiceNow/PySNC#146 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 30, 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.
Summary
sn_count/sn_aggregate(scripts/python/aggregate.py) ontoclient.GlideAggregate(...), removing the hand-rolled Stats API plumbing (_stats_request/_parse_stats/_group_key). Signatures and the int / dict / structured-dict return contracts are unchanged.pysncto the fork branch carrying the upstream contribution (feat: add GlideAggregate (Stats API) support ServiceNow/PySNC#146) until it merges and ships in a release.GlideAggregatecontinuously through the repo's real consumers while the upstream PR is in review.Validation
Verified against dev392282 at the real call sites:
assets/summary.json— byte-identical modulo the_exported_attimestamp (model-category names + install-status labels unchanged). Thedisplay_value=true→allchange in the upstream class produced identical output here.distribution.json— differs only by data drift since the 2026-05-15 snapshot (total_active639→645,unclassified627→633, both +6); structure unchanged.debug-pc-auto-request.py— runs clean (active 645, identity split 633/10/1/1).scratch/pysnc-contribution/dogfood-findings.md).Notes / caveats
pysncfrom the fork. The fork's version string is also1.2.1, so a runner that already has a published1.2.1cached will report "already satisfied" and skip the git ref — a fresh install pulls it correctly. Worth keeping in mind for CI cache behavior.GlideAggregateships in a releasedpysnc, swap the git ref back to a normal version pin.Closes #8. Refs ServiceNow/PySNC#146