Skip to content

[cuegui/pycue] Allow creating new departments from the UI / Python API #2400

Description

@DiegoTavares

Is your feature request related to a problem? Please describe.

Departments cannot currently be created from CueGUI or from pycue. The only entry point is the gRPC DepartmentInterface.AddDepartmentName method, which is not wrapped in pycue and is not exposed by any CueGUI action.

The closest existing mechanism is Group.setDepartment(name) — per proto/src/department.proto:18-22, the backend will auto-create a department when a previously-unseen name is assigned to a group. However:

  • cuegui/cuegui/GroupDialog.py:42-74 populates the department dropdown from opencue.api.getDepartmentNames() — i.e., only whitelisted names. The combo box is not editable, so users cannot type a new name.
  • Even if it were editable, AddDepartmentName would still need to be called first to register the name on the backend's allowed list.

Net result: departments can only be created out-of-band (direct gRPC call or DB edit). There is no end-to-end supported workflow for administrators using the standard tools.

Describe the solution you'd like

  1. pycue — wrap the missing DepartmentInterface methods, either in a new pycue/opencue/wrappers/department.py or extending pycue/opencue/api.py:

    • createDepartment(name)AddDepartmentName
    • deleteDepartment(name)RemoveDepartmentName
  2. CueGUI — add an admin-facing way to create departments. Two viable shapes:

    • A small "Manage Departments" dialog that lists existing departments, lets an admin add a new one, and optionally remove unused ones.
    • Or, a "+" affordance next to the department combo box in GroupDialog that prompts for a new name and registers it before assigning.
  3. As part of the same change, fix Show.getDepartments() (filed separately as bug [cuegui/pycue] Show.getDepartments() wrapper missing — TasksDialog unusable, Department admin RPCs unreachable from Python #2399) so the existing TasksDialog becomes usable — the department admin UX would otherwise be hard to test end-to-end.

Describe alternatives you've considered

  • Making the GroupDialog department combo editable and auto-creating on submit. Simpler UX, but creation becomes a side effect of group editing rather than an explicit admin action, and the underlying pycue wrapper is still needed.
  • Wrapping only the pycue API and letting operators script department creation. Lower implementation effort, but leaves CueGUI users unable to self-serve and leaves the "no UI for it" gap unaddressed.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions