(INF-2987) Create script to mass import users into CO Manage Registry from files#29
(INF-2987) Create script to mass import users into CO Manage Registry from files#29williamnswanson wants to merge 16 commits into
Conversation
Also remove old commented out version
…d COmanage schema add EOF newline
There was a problem hiding this comment.
Pull request overview
Adds a new bulk-import script to create COmanage Registry CO Person records from JSON input, including related objects (roles, group memberships, SSH keys, Unix cluster accounts/groups), supported by new schema-building helpers and some new COmanage utility APIs.
Changes:
- Added
mass_person_create_modify.pyto read an input data file + mapping file and create/provision CO Person-related records in COmanage. - Added
comanage_person_schema_utils.pywith helpers for constructing Core API v1-style CO Person payloads. - Extended
comanage_utils.pywith Core API v1 people helpers, new retry/fast-fail HTTP handling, and group creation helper.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| mass_person_create_modify.py | New mass import script to create CO People, groups, Unix accounts, and provision them. |
| comanage_utils.py | Adds HTTP fast-fail exception type, Core API people helpers, identifier update helper, and CO group creation helper. |
| comanage_person_schema_utils.py | New module defining payload templates and helper constructors for CO Person-related objects. |
| .gitignore | Ignores Python __pycache__ artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
While we're in the mood of doing LLM-reviews, I had Claude take a look: I gave it the Import script, comanage_utils.py and the schema helper (as well as some links to COmanage Docs and some info on Identifier Assignment), so it's scope is a bit larger than just this PR. Honestly, it's a little brutal 😅? High level Headers / topics Critical: (potential) Run stoppers
High: wrong behavior or fragile control flow
Medium: robustness and modern best practices
Low — cleanliness and small correctness nits @brianhlin @jasoncpatton Any thoughts? Might give it a link to the COmanage Github repo to see if it can make anything of it. |
|
@williamnswanson yeah my gut is that this scriptery isn't invoked enough to be worth spending much effort on. But having Claude make attempts at fixing the various issues might be a decent exercise in of itself? |
Takes a file with a list of maps of key:value pairs and creates a CO Person record in the COmanage Registry (along with CO Roles, CO Group Memberships, SSH Keys, Unix cluster accounts and groups, ect)
The script doesn't currently have a way to know what parts of the mapping file should be used for what attributes of what type of record, so the
build_co_person_record()function will need to be modified to suit the specific import you're trying to do, what data you have for the users, ect.