Story #8703

[API] Add "components" hash to Job model

Added by Brett Smith over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
API
Target version:
Start date:
03/28/2016
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
1.0

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

Subtasks

Task #8738: Review branch 8703-job-componentsResolvedRadhika Chippada

Associated revisions

Revision e68d56d2
Added by Radhika Chippada over 3 years ago

closes #8703
Merge branch '8703-job-components'

History

#1 Updated by Brett Smith over 3 years ago

  • Description updated (diff)

#2 Updated by Brett Smith over 3 years ago

  • Description updated (diff)

#3 Updated by Brett Smith over 3 years ago

  • Description updated (diff)
  • Category set to API
  • Story points set to 1.0

#4 Updated by Brett Smith over 3 years ago

  • Target version set to Arvados Future Sprints

#5 Updated by Brett Smith over 3 years ago

  • Target version changed from Arvados Future Sprints to 2016-03-30 sprint

#6 Updated by Radhika Chippada over 3 years ago

  • Assigned To set to Radhika Chippada

#7 Updated by Radhika Chippada over 3 years ago

  • Description updated (diff)

#8 Updated by Radhika Chippada over 3 years ago

  • Status changed from New to In Progress

#9 Updated by Radhika Chippada over 3 years ago

  • Description updated (diff)

#10 Updated by Peter Amstutz over 3 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.

#11 Updated by Radhika Chippada over 3 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.

#12 Updated by Peter Amstutz over 3 years ago

LGTM @ 4743b2e

#13 Updated by Radhika Chippada over 3 years ago

  • Status changed from In Progress to Resolved

Applied in changeset arvados|commit:e68d56d2d033c7be04294fd30cd0edb424f291fb.

Also available in: Atom PDF