Skip to content

feat: Replace blacklist.d/whitelist.d by report-ignore/report-only directories#58

Merged
schopin-pro merged 2 commits intocanonical:mainfrom
bdrung:woke2
Jan 27, 2023
Merged

feat: Replace blacklist.d/whitelist.d by report-ignore/report-only directories#58
schopin-pro merged 2 commits intocanonical:mainfrom
bdrung:woke2

Conversation

@bdrung
Copy link
Member

@bdrung bdrung commented Jan 11, 2023

The words blacklist and whitelist may be insensitive. Therefore rename the directory /etc/apport/blacklist.d to /etc/apport/report-ignore and /etc/apport/whitelist.d to /etc/apport/report-only. Keep reading the old directories for backward compatibility until Apport 3.0.

This merge request contains the commit from #92: Avoid code duplication in Report.check_ignored by factoring out the list files reading into _read_list_files_in_directory.

@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Merging #58 (ba3c5ae) into main (b95e189) will increase coverage by 0.01%.
The diff coverage is 97.14%.

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
+ Coverage   80.75%   80.77%   +0.01%     
==========================================
  Files          84       84              
  Lines       17742    17739       -3     
==========================================
  Hits        14328    14328              
+ Misses       3414     3411       -3     
Impacted Files Coverage Δ
apport/report.py 83.88% <95.83%> (+0.25%) ⬆️
data/apport 66.79% <100.00%> (ø)
tests/integration/test_report.py 92.07% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bdrung bdrung changed the title feat: Replace blacklist.d/whitelist.d by ignore/allow directories feat: Replace blacklist.d/whitelist.d by deny/allow directories Jan 12, 2023
@bdrung bdrung force-pushed the woke2 branch 2 times, most recently from aac7d57 to e09c920 Compare January 13, 2023 17:22
@schopin-pro
Copy link
Contributor

Code-wise LGTM, but thinking a bit more about deny vs ignore, I'm actually reverting my opinion back to ignore. The issue with deny is: what are you denying? "Ignore" seems fairly straightforward, you simply don't do anything related to this binary.

I can understand it as "I deny this binary the right to crash, so you MUST report it", which is basically the semantics of the current "whitelist", or "I deny this binary the right to report the crashes".

OTOH, we have the same issue with allow, and I don't have a good word for it. So maybe we could just have "report-deny" and "report-allow" to make it clearer what we're denying/allowing?

@bdrung
Copy link
Member Author

bdrung commented Jan 16, 2023

Thanks for the feedback. Ideas: ignore/report or ignore/process?

@ogayot
Copy link
Member

ogayot commented Jan 17, 2023

Sounds a bit silly but I would suggest ignore and no-ignore. Do we know what's the expected behavior when a pattern is present in both the blacklist and whitelist?

@bdrung
Copy link
Member Author

bdrung commented Jan 17, 2023

"If something is defined in /etc/apport/whitelist.d/, everything which does not match gets ignored then."

@waveform80
Copy link
Member

Perhaps "include/exclude"? The context is essentially filtration after all.

OTOH, we have the same issue with allow, and I don't have a good word for it. So maybe we could just have "report-deny" and "report-allow" to make it clearer what we're denying/allowing?

This sounds like an excellent suggestion to me. It's a bit more wordy, but explicit is better than implicit; it also makes the filtration context more obvious. Thumbs up for "fix it with more words!"

@daniloegea
Copy link

include/exclude or include/ignore sounds good enough.

clang-format uses .clang-format-include and .clang-format-ignore.

woke itself uses ignore_files

@bdrung
Copy link
Member Author

bdrung commented Jan 20, 2023

So we have some options:

  1. report-deny / report-deny
  2. report-ignore / report-only
  3. programs-ignore / programs-only

@bdrung
Copy link
Member Author

bdrung commented Jan 26, 2023

If no-one objects, I will change it to option 2: report-ignore / report-only.

Avoid code duplication in `Report.check_ignored` by factoring out the
list files reading into `_read_list_files_in_directory`.

Signed-off-by: Benjamin Drung <[email protected]>
…rectories

The words `blacklist` and `whitelist` may be insensitive. Therefore
rename the directory `/etc/apport/blacklist.d` to
`/etc/apport/report-ignore` and `/etc/apport/whitelist.d` to
`/etc/apport/report-only`. Keep reading the old directories for backward
compatibility until Apport 3.0.

Signed-off-by: Benjamin Drung <[email protected]>
@bdrung bdrung changed the title feat: Replace blacklist.d/whitelist.d by deny/allow directories feat: Replace blacklist.d/whitelist.d by report-ignore/report-only directories Jan 27, 2023
@schopin-pro
Copy link
Contributor

Ooooh I really like "report-only" :)

@schopin-pro schopin-pro merged commit ecda1bb into canonical:main Jan 27, 2023
@bdrung bdrung deleted the woke2 branch January 27, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants