Process editor enhancement - #70
Open
yoavnash wants to merge 68 commits into
Open
Conversation
- Remove dead-code group objects with underscore IDs (interally_public, externally_public) that conflicted with config defaults (hyphens) - Add refresh_public_groups(config) so DSMS can update the module-level INTERNALLY/EXTERNALLY_PUBLIC_GROUP constants after its own config is set, fixing the import-time staleness bug - Fix min_access_level / max_access_level to return Role (not int) and raise a clear ValueError for operations with no role mapping (e.g. CREATE) - Fix inverted comments in serialize_role_json - Cache user_groups and users on the DSMS instance (pattern matches ktypes); add refresh_user_groups() and refresh_users() invalidation methods - Fix get_user_by_id: accept dsms as first argument (consistent with all other util functions) and return a typed User object instead of a raw dict - Expose get_user_by_id as DSMS.get_user(user_id)
test_access_extended.py: - Role hierarchy ordering and >= comparison - min/max_access_level return Role instances (not int) - min/max_access_level raise ValueError for unmapped operations (CREATE) - Error message lists valid operations - serialize_role_json: JSON mode → int, Python mode → name string - model_dump(mode='json') produces integer roles for wire format - model_dump(mode='python') produces string role names - Round-trip from backend dict (int roles) through model and back - user_by_role property - None user_access/group_access converted to [] test_groups.py: - Group model: basic, subgroups, deeply nested - GroupList: flat flattening, flat returns BaseGroup, by_id, by_name (including subgroup traversal) - User model: basic, with groups - UserList: by_id, by_username, by_name, __getitem__, missing key - INTERNALLY/EXTERNALLY_PUBLIC_GROUP IDs use hyphens - refresh_public_groups with custom config and without arg - DSMS.user_groups caches result; refresh_user_groups() re-fetches - DSMS.users caches result; refresh_users() re-fetches - DSMS.get_user() returns typed User object; raises on 404
The backend update endpoint accepts visibility as a top-level field, separate from access_properties. Previously utils._get_kitems_diffs embedded visibility inside the access_properties dict, causing all SDK-driven visibility changes to be silently ignored by the server. Also documents the visibility field in KItemAccessProperties schema docs, fixes the role range from 1-4 to 1-3 (ADMIN removed), and adds two unit tests covering the promoted-visibility and unchanged-visibility cases.
- DSMS: add create_group, update_group, delete_group, get_group_members, add_group_member, remove_group_member with cache invalidation - utils.py: add corresponding HTTP helpers for all six operations - groups/models.py: remove GroupListBase (empty list subclass); flat now returns List[BaseGroup] directly; clean up docstrings - groups/__init__.py: remove GroupListBase from exports - properties/__init__.py: remove dead UserGroup import and export - kitem.py: update docstring to reference access_properties instead of the removed user_groups/UserGroup field - tests/test_groups.py: 14 new tests covering all CRUD methods and the GroupListBase removal
Removes BaseAccessProperty, UserAccessProperty, GroupAccessProperty and the user_access/group_access fields. Replaces them with a single grants: List[AccessGrant] where each grant carries id, type (user|group), and role. Duplicate detection now keyed on (id, type) pairs. Properties by_user/by_group/user_by_role/group_by_role replaced by by_id, by_role, and operation_by_principal. Updates both test files accordingly.
- Delete dsms/knowledge/groups/public.py (never deployed) - Remove INTERNAL_GROUP, PUBLIC_GROUP, refresh_public_groups from groups __init__ - Remove id_internal, id_public, label_internal, label_public from BaseConfiguration - Remove refresh_public_groups call from DSMS.__init__
Follow-up to 8c8ba77: test_groups.py still imported from the deleted dsms/knowledge/groups/public module. Drop the import and the 6 tests that covered those constants.
- Add optional visibility parameter to dsms.search() and _search() - Accepts 'private', 'internal', or 'public'; defaults to None (no filter) - Passes visibility in the POST payload to the backend search endpoint
…ntry Guard the error_message construction with the select_options check so choices.keys() is never called on None when no select options are defined.
Adds KItem.populate_schema() to apply simplified-input transforms from k-type semantic schema specs, schema_to_oold() in the semantics module, a shorthand dict syntax for schema_data on KItem construction, and a tutorial notebook demonstrating the full workflow.
…stem env Three related fixes: - schema_to_oold: replace non-existent Schema.from_url with a direct requests fetch of specs/transform.simplified.jsonata from the raw GitHub URL; fall back to pass-through on HTTP 404 - setup.cfg: upgrade pylint 3.2.0→3.3.9 so too-many-positional-arguments in .pylintrc is recognised (added in pylint 3.3.0) - .pre-commit-config.yaml: switch pylint hook from language: python to language: system so local runs use the same installed environment as CI, eliminating stale-cache version drift
…ditor-enhancement
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.
Uh oh!
There was an error while loading. Please reload this page.