Repository navigation
feat(LAB-4585): designate workflow steps by id, or by name and group - #2095
aurelienlombard wants to merge 6 commits into
Conversation
🧪 Local test — LAB-4585Summary: the step designation ( ✅ What worksUnit tests: 842 passed, 1 skipped ( Test data: a workflow V3 project with two groups
Released 26.2.0 against the new backend: a step name two groups share is refused with "give its id" ( 🐛 Bug: Pylint fails in CI
Not tested
tested at e64be2f · backend kili!14636 @ daf03becd4 |
aurelienlombard
left a comment
There was a problem hiding this comment.
Review Summary
Verdict: Needs changes
| Severity | Count |
|---|---|
| Required | 1 |
| Suggestion | 1 |
Tested locally: 842 passed · 10-call matrix against kili!14636, 10/10 as expected · released SDK 3/3 — report
The designation by id, or by name and group, behaves as specified on every call the matrix made; CI's Pylint is red on three messages this PR adds.
reviewing-feature · e64be2f
| if ( | ||
| asset_status_in is not None | ||
| or asset_step_name_in is not None | ||
| or asset_step_id_in is not None |
There was a problem hiding this comment.
[REQUIRED] CI's Pylint fails here: R0916 too-many-boolean-expressions (6/5), same at line 533, and R0912 too-many-branches (13/12) on copy_workflow_from_project (use_cases/project_workflow/__init__.py:178, from the multi-group refusal). Green on main.
Suggested fix: collect the workflow filters in a tuple and test any(f is not None for f in (...)), and move the group check of copy_workflow_from_project into a small _validate_source_has_one_group(source_steps) next to _validate_destination_is_workflow_v2.
There was a problem hiding this comment.
✔ addressed in aaa8f65 — asset_step_id_in no longer joins the condition that fetches the project steps (it does not need them, its exclusivity check sits before), and the single-group check is _validate_source_has_one_group. Pylint green in CI on 3.10, 3.12 and 3.13.
| step_name_and_status_not_in: Optional[list[tuple[str, StatusInStep]]] = None, | ||
| step_name_in: Optional[list[str]] = None, | ||
| step_name_not_in: Optional[list[str]] = None, | ||
| step_id_in: Optional[list[str]] = None, |
There was a problem hiding this comment.
[SUGGESTION] step_id_* are inserted before step_status_in, which shifts the position of every later parameter of a public legacy method (also lines 241, 318, 716, and asset_step_id_in in label.py 79, 235, 278 and the forwarding methods). append_labels and the GeoJSON / shapefile methods append theirs at the end; doing the same here keeps any positional call working.
There was a problem hiding this comment.
✔ addressed in aaa8f65 — the step id filters are the last parameters, keyword-only after the * of every assets / count_assets / labels / count_labels / predictions / inferences signature: no existing positional slot moves.
🧪 Local test — LAB-4585 (re-review)
Regression: 842 passed, 1 skipped; pyright 0 errors. CI: tests, pyright, Pylint, pre-commit, build and docs green; markdown-link-check red as on tested at aaa8f65 · backend kili!14636 @ 18741d92b1 |
🧪 Local test — LAB-4585 (third pass)
Release notes: release after kili!14636 is deployed (label creation on a step sends tested at df0afca · backend kili!14636 @ a51ed19237 |
5487dc2 to
4af9105
Compare
Step names are unique per group only. The workflow methods take step_id, or step_name with group_name when several groups use it, never both; the SDK resolves names to ids, also for update_project_workflow's updates and deletes. create_steps takes step_group_id. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
add_review_step takes group_name, sent as the group's id, and finds send_back_to_step within that group. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
append_labels and labels.create_* take step_id, or step_name with group_name, resolved to the id the request sends (appendManyLabels stepId). labels.create_default no longer forces the step named Default. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
step_id_in, step_id_not_in, step_id_and_status_in(_not_in) and asset_step_id_in, keyword-only and exclusive with their name filters. A step name several groups use matches each of them; group_name_in narrows. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
copy_workflow_from_project writes a single-group workflow, so a source with several groups would lose which step belongs to which. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
On workflow V3, a group's allowed jobs are enforced by the labeling app only, not on labels created through the SDK. Consensus can only be set on the labeling step of the first group. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4af9105 to
1f10444
Compare
Closes LAB-4585. Backend: kili!14636.
Step names are unique per group only. A step is now given by
step_id, or bystep_namewithgroup_namewhen several groups use the name, never both; the SDK resolves names to ids before sending.Changes (one commit each)
add/remove_reviewers_to_step,add/remove_labelers_to_step(andprojects.workflow.*),update_labeling_step_properties,update_review_step_properties,rename_step.update_project_workflowresolves updates and deletes given by name (a delete can be{"name", "group_name"});create_stepstakesstep_group_id;get_stepslists each step's group.add_review_steptakesgroup_name: the step is added at the end of that group, andsend_back_to_stepis found within it.append_labels, its shapefile/GeoJSON variants andlabels.create_*, sent asstepId.labels.create_defaultno longer forces the step named "Default".step_id_in,step_id_not_in,step_id_and_status_in,step_id_and_status_not_in, andasset_step_id_inon labels. They are keyword-only and exclusive with the name filters. A name several groups use now matches each group's step (step_name_and_status_inkept only the last one);group_name_innarrows it.copy_workflow_from_projectrefuses a source with several groups instead of flattening them.Compatibility
step_namestays positional, and the arguments after it get a default with a required check.stepIdinput.🤖 Generated with Claude Code