Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

add view filter for jobid, project, and/or name #152

Merged
merged 4 commits into from
Oct 16, 2020
Merged

add view filter for jobid, project, and/or name #152

merged 4 commits into from
Oct 16, 2020

Conversation

bmc-msft
Copy link
Contributor

Summary of the Pull Request

This adds --job_id, --project, and --name to limit the display of jobs and tasks from the 'status top' display to only things that match those values, if provided.

PR Checklist

  • Applies to work item: Add the ability to limit job / task display  #149
  • CLA signed. If not, go over here and sign the CLI.
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Validation Steps Performed

Have multiple jobs currently running.

Run onefuzz jobs list and get information for a running job

Then iteratively test each of these:

  1. onefuzz status top --name NAME
  2. onefuzz status top --project PROJECT
  3. onefuzz status top --job_id JOB_ID
  4. onefuzz status top --job_id JOB_ID --project PROJECT --name NAME

@bmc-msft bmc-msft linked an issue Oct 14, 2020 that may be closed by this pull request
src/cli/onefuzz/status/top_view.py Show resolved Hide resolved
}

for name in ["status", "pools", "jobs", "tasks", "messages"]:
if name == "messages" and not self.show_details:
continue

if dimensions[name]["setup"][0]:
titles = dimensions[name].get("setup")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is typechecked, so the use sites below work as expected.

But even so, when reading, the possible values can be hard to keep straight because we are doing truthy checks on what I'm guessing is an Optional[List[T]], for some T.

All that said, should we maybe just default titles to an empty list?

src/cli/onefuzz/status/cache.py Show resolved Hide resolved
src/cli/onefuzz/status/cache.py Show resolved Hide resolved
@bmc-msft bmc-msft merged commit 8ff5439 into microsoft:main Oct 16, 2020
@bmc-msft bmc-msft deleted the filter-jobs-in-top branch October 16, 2020 19:00
@ghost ghost locked as resolved and limited conversation to collaborators Apr 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to limit job / task display
3 participants