Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

[jobmanager] Add status for all runs instead of just the latest one #289

Merged
merged 1 commit into from
Jun 28, 2021
Merged

[jobmanager] Add status for all runs instead of just the latest one #289

merged 1 commit into from
Jun 28, 2021

Conversation

mimir-d
Copy link
Contributor

@mimir-d mimir-d commented Jun 23, 2021

  • add Status.RunStatuses as a list of all runs for a given job
  • keep Status.RunStatus populated from RunStatuses as backwards compat
  • refactor JobManager.status() to retrieve all runs
  • remove JobRunner.GetCurrentRun and test since they're no longer needed
    for the status command

testing:

  • test backward compat
% go run . status 3 | jq '.Data.Status.RunStatus | [.JobID,.RunID]'     
Requesting URL http://localhost:8080/status with requestor ID 'contestcli-http'
  with params:
    requestor: [contestcli-http]
    jobID: [3]

The server responded with status 200 OK
[
  3,
  3
]
  • test new RunStatuses field
% go run . status 3 | jq '.Data.Status.RunStatuses | map([.JobID,.RunID])'
Requesting URL http://localhost:8080/status with requestor ID 'contestcli-http'
  with params:
    jobID: [3]
    requestor: [contestcli-http]

The server responded with status 200 OK
[
  [
    3,
    1
  ],
  [
    3,
    2
  ],
  [
    3,
    3
  ]
]

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 23, 2021
@codecov
Copy link

codecov bot commented Jun 24, 2021

Codecov Report

Merging #289 (e472d0a) into master (13d9ea7) will decrease coverage by 0.16%.
The diff coverage is 80.00%.

❗ Current head e472d0a differs from pull request most recent head 608e3be. Consider uploading reports for the commit 608e3be to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #289      +/-   ##
==========================================
- Coverage   67.62%   67.45%   -0.17%     
==========================================
  Files         136      136              
  Lines        6613     6591      -22     
==========================================
- Hits         4472     4446      -26     
- Misses       1639     1647       +8     
+ Partials      502      498       -4     
Flag Coverage Δ
e2e 45.33% <80.00%> (-0.13%) ⬇️
integration 57.43% <80.00%> (+0.09%) ⬆️
unittests 49.75% <ø> (-0.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/runner/job_runner.go 69.45% <ø> (-3.67%) ⬇️
pkg/jobmanager/status.go 66.66% <80.00%> (+6.20%) ⬆️
pkg/cerrors/cerrors.go 0.00% <0.00%> (-16.67%) ⬇️
pkg/jobmanager/jobmanager.go 74.21% <0.00%> (-1.26%) ⬇️
pkg/runner/test_runner.go 91.47% <0.00%> (-0.86%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13d9ea7...608e3be. Read the comment docs.

@tfg13
Copy link
Contributor

tfg13 commented Jun 24, 2021

Still reading the code, but this definitive needs a test plan, and we need to fix the client since this is a breaking API change. I'll ask some folks if they think that is ok, but I suspect the answer is yes.

Surprisingly, computing the status can be a bit expensive at times (lots of DB roundtrips), so I wonder if in the future we need to allow selecting only a subset of runs to be returned. And if we do that, should this maybe be a map? (Just some thoughts, not saying we need to do this right away)

- add Status.RunStatuses as a list of all runs for a given job
- keep Status.RunStatus populated from RunStatuses as backwards compat
- refactor JobManager.status() to retrieve all runs
- remove JobRunner.GetCurrentRun and test since they're no longer needed
  for the status command
@mimir-d mimir-d merged commit 843a9c0 into facebookarchive:master Jun 28, 2021
@mimir-d mimir-d deleted the fea/multi_run_status branch September 25, 2021 15:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants