Project

General

Profile

Actions

Idea #8703

closed

[API] Add "components" hash to Job model

Added by Brett Smith about 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
API
Target version:
Start date:
03/28/2016
Due date:
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 1 (0 open1 closed)

Task #8738: Review branch 8703-job-componentsResolvedRadhika Chippada03/28/2016Actions
Actions #1

Updated by Brett Smith about 8 years ago

  • Description updated (diff)
Actions #2

Updated by Brett Smith about 8 years ago

  • Description updated (diff)
Actions #3

Updated by Brett Smith about 8 years ago

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

Updated by Brett Smith about 8 years ago

  • Target version set to Arvados Future Sprints
Actions #5

Updated by Brett Smith about 8 years ago

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

Updated by Radhika Chippada about 8 years ago

  • Assigned To set to Radhika Chippada
Actions #7

Updated by Radhika Chippada about 8 years ago

  • Description updated (diff)
Actions #8

Updated by Radhika Chippada about 8 years ago

  • Status changed from New to In Progress
Actions #9

Updated by Radhika Chippada about 8 years ago

  • Description updated (diff)
Actions #10

Updated by Peter Amstutz about 8 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.

Actions #11

Updated by Radhika Chippada about 8 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.
Actions #12

Updated by Peter Amstutz about 8 years ago

LGTM @ 4743b2e

Actions #13

Updated by Radhika Chippada about 8 years ago

  • Status changed from In Progress to Resolved

Applied in changeset arvados|commit:e68d56d2d033c7be04294fd30cd0edb424f291fb.

Actions

Also available in: Atom PDF