Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --ignore-project and --ignore-tag to report #288

Merged
merged 17 commits into from
Jul 16, 2019

Conversation

gallois
Copy link
Contributor

@gallois gallois commented Jun 25, 2019

Add two options to ignore a project or a tag when generating a report, in the same way you can select some. I've used some json formatting + jq magic to filter out some specific tags from things like daily standups/weekly reports but it was a bit of a monstrosity, to be honest.

$ watson log -G
Monday 24 June 2019 (07m 58s)
	357a688  20:37 to 20:38          48s                 test task
	3f75de7  20:38 to 20:38          19s    test task do not track  [donottrack]
	9d610c4  21:01 to 21:02      01m 15s               test task 2  [another_tag]
	8ff2773  21:02 to 21:08      05m 32s  test task 3 not to track  [another_tag, donottrack]
	276a964  23:24 to 23:24          04s                 test task  [second_time]

$ watson report -G --project "test task"
Tue 18 June 2019 -> Tue 25 June 2019

test task - 52s
	[second_time         04s]

$ watson report -G --ignore-project "test task"
Tue 18 June 2019 -> Tue 25 June 2019

test task 2 - 01m 15s
	[another_tag     01m 15s]

test task 3 not to track - 05m 32s
	[another_tag     05m 32s]
	[donottrack     05m 32s]

test task do not track - 19s
	[donottrack         19s]

Total: 07m 06s
$ watson report -G --project "test task" --project "test task 2"                  
Tue 18 June 2019 -> Tue 25 June 2019

test task - 52s
	[second_time         04s]

test task 2 - 01m 15s
	[another_tag     01m 15s]

Total: 02m 07s
$ watson report -G --project "test task" --project "test task 2" --ignore-project "test task 2"
Error: given projects can't be ignore at the same time
$ watson report -G --tag another_tag                             
Tue 18 June 2019 -> Tue 25 June 2019

test task 2 - 01m 15s
	[another_tag     01m 15s]

test task 3 not to track - 05m 32s
	[another_tag     05m 32s]

Total: 06m 47s
$ watson report -G --ignore-tag donottracc
Tue 18 June 2019 -> Tue 25 June 2019

test task - 52s
	[second_time         04s]

test task 2 - 01m 15s
	[another_tag     01m 15s]

test task 3 not to track - 05m 32s
	[another_tag     05m 32s]
	[donottrack     05m 32s]

test task do not track - 19s
	[donottrack         19s]

Total: 07m 58s
$ watson report -G --ignore-tag donottrack
Tue 18 June 2019 -> Tue 25 June 2019

test task - 52s
	[second_time         04s]

test task 2 - 01m 15s
	[another_tag     01m 15s]

Total: 02m 07s
$ watson report -G --tag another_tag --ignore-tag another_tag
Error: given tags can't be ignored at the same time

$ watson report -G -c --ignore-tag donottrack --ignore-tag another_tag
Thu 20 June 2019 -> Thu 27 June 2019

test task - 52s
	[second_time         04s]


watson/frames.py Outdated
(tags is None or any(tag in frame.tags for tag in tags)) and
(ignore_tags is None
or any(tag not in frame.tags for tag in ignore_tags)) and
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't it be all instead of any?

watson/watson.py Outdated Show resolved Hide resolved
Co-Authored-By: Yannick PÉROUX <yannick.peroux@gmail.com>
@@ -443,19 +443,27 @@ def merge_report(self, frames_with_conflict):

return conflicting, merging

def _validate_report_options(self, filtrate, ignored):
return bool(
filtrate and ignored and set(filtrate).intersection(set(ignored)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that if a function "validate" something, it should return True when it's valid, not the opposite :) .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair enough :P I'll take a look at it tomorrow and push a fixed version :)

k4nar
k4nar previously approved these changes Jul 8, 2019
Copy link
Collaborator

@k4nar k4nar left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for the time & patience 👍 .

@gallois
Copy link
Contributor Author

gallois commented Jul 8, 2019

not at all, my pleasure

* add aggregation completion
* add completion profile for add
* cosmetic fixes to watson.fish:
  - reorder ungrouped completions
  - add missing comment
* add CSV support to aggregate, log, and report
* extend existing completion profiles:
  - adds --luna to report and log
  - adds --at to stop
* properly display confirm-new options
jmaupetit
jmaupetit previously approved these changes Jul 15, 2019
Copy link
Contributor

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

Hey @gallois If you rebase this I'll merge it asap.

@gallois gallois dismissed stale reviews from jmaupetit and k4nar via bd45084 July 15, 2019 18:20
@gallois
Copy link
Contributor Author

gallois commented Jul 15, 2019

@jmaupetit 👍

@jmaupetit jmaupetit merged commit 699ccda into jazzband:master Jul 16, 2019
gnanet added a commit to gnanet/Watson that referenced this pull request Sep 21, 2020
 * Add two options to ignore a project or a tag when requesting a log, in the same way you can do it with report (see jazzband#288).
jmaupetit pushed a commit that referenced this pull request Sep 28, 2020
Add two options (--ignore-project and --ignore-tag) to ignore a project or a tag when requesting a log, in the same way you can do it with report (see #288).

Reference PR: #395
lefi7z added a commit to lefi7z/Watson that referenced this pull request Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants