Repository navigation
fix(spaces): send visibility instead of the legacy is_public field - #22
Merged
Merged
Conversation
The backend hard-rejects the legacy is_public field on /synthesis/landscape and /synthesis/github (CreateMapSerializer, 'Use visibility instead.') since the Unified Space Visibility change (#1958, Jul 2026). Every SDK-driven space creation against prod has been 400-ing since. - add _visibility_from_privacy_level(): maps SpacePrivacy.PUBLIC -> 'unlisted' (public is backend-set-only), PRIVATE/SHARED -> 'private'; an explicit visibility= kwarg wins over privacy_level= - both create() and from_github() now send 'visibility' and never 'is_public' - new visibility= kwarg on both methods for callers that want the exact tier - 4 new tests asserting is_public is absent and visibility is correct Verified: full test suite 72 passed (was 68). Fixes the repo_radar daily task silent no-op (MantisAPI #1627 automation refreshing the Mantis Radar space since June).
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
The backend hard-rejects the legacy
is_publicfield on/synthesis/landscapeand/synthesis/github(CreateMapSerializerraisesUse visibility instead.) since the Unified Space Visibility change (MantisAPI #1958, Jul 2026). The SDK still sendsis_publicon both creation paths, so every SDK-driven space creation against prod has been 400-ing for over two months.Most visible symptom: the
repo_radardaily Celery task (MantisAPI #1627) runs "green" every morning at 06:00 UTC while all its map-refresh calls fail with{'is_public': [ErrorDetail(string='Use visibility instead.', code='invalid')]}— the per-source try/except inexamples/repo_radar/repo_radar.pyswallows the 400s and the container exits 0. The "Mantis Radar" space (aliasm4m) still holds data from June 20.Changes
_visibility_from_privacy_level()helper: mapsSpacePrivacy.PUBLIC->unlisted('public' is backend-set-only, not user-settable —Space.USER_SETTABLE_VISIBILITIES = (private, unlisted)),PRIVATE/SHARED->private. Explicitvisibility=kwarg wins overprivacy_level=.create()andfrom_github()now sendvisibilityand neveris_public.visibility=kwarg on both methods for callers that want the exact tier.tests/test_create_space.pyassertingis_publicis absent andvisibilityis correct (default private, public->unlisted mapping, explicit override, from_github path).Verification
Full test suite locally: 72 passed (68 pre-existing + 4 new), including the existing sanitize/poll/error tests. No runtime behavior changes beyond the request payload field.
Semantics note
SpacePrivacy.PUBLICpreviously requestedis_public=true; the closest user-settable equivalent isunlisted(link-shareable, not discoverable). If a truepublicspace is needed, that's a backend-side action now.Downstream: once merged, MantisAPI's
SDK_COMMITpin insrc/mantis4mantis/repo_radar_task.pyneeds bumping to the merge SHA (tracked separately).