Idea #8703
closed[API] Add "components" hash to Job model
Description
Jobs that want to indicate child work will do so by filling the components hash as follows:
{ "label1": "abcde-j7d0g-abcde...", "label2": "abcde-p5p6p-abcde...", ... }
Interfaces that want to incorporate information about child work (like Workbench) will use this information to find that child work.
Only the API client authorization that holds the job lock can update this field.
Don't forget to add to the API documentation for this new field.
Acceptance criteria¶
- Migration script to add “components” to job model
- up and down migrations must succeed
- all existing tests must pass
- Add a controller test to get a job with components (add a fixture with components)
- Add a controller test, with permission to update:
- add components to a job
- delete one component at a time and verify get succeeds
- Add a controller test, with no permission to update:
- cannot add components to a job
- cannot delete a component from a job
- API doc update
Updated by Brett Smith almost 9 years ago
- Description updated (diff)
- Category set to API
- Story points set to 1.0
Updated by Brett Smith almost 9 years ago
- Target version set to Arvados Future Sprints
Updated by Brett Smith almost 9 years ago
- Target version changed from Arvados Future Sprints to 2016-03-30 sprint
Updated by Radhika Chippada almost 9 years ago
- Assigned To set to Radhika Chippada
Updated by Radhika Chippada almost 9 years ago
- Status changed from New to In Progress
Updated by Peter Amstutz almost 9 years ago
In the tests:
In the running_job_with_components
fixture, is_locked_by_uuid
should be the same as owner_uuid
(zzzzz-tpzed-xurymjxw79nv3jz).
"update job with components with no lock" should use a different user, like :spectator.
"update job with components" should check that :active (zzzzz-tpzed-xurymjxw79nv3jz) can update the job, rather than using an admin user.
"add components to job locked by active user as system user" should also use :active and not system_user.
The acceptance criteria lists "delete one component at a time and verify get succeeds" but the test doesn't do this.
Updated by Radhika Chippada almost 9 years ago
- Made all the test updates suggested above.
- Regarding "update job with components with no lock should use a different user, like :spectator." : We get a 404 for spectator (can't read the job). With the locked_by updated, it now tests correctly with an admin user
- Renamed @counter in test_helper.rb (api and workbench) as @test_counter so that the name is not overly generic with potential for any future confusion anywhere else.
Updated by Radhika Chippada almost 9 years ago
- Status changed from In Progress to Resolved
Applied in changeset arvados|commit:e68d56d2d033c7be04294fd30cd0edb424f291fb.