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

Bug report tool #8633

Merged
merged 38 commits into from
Dec 22, 2020
Merged

Conversation

mykhailopylyp
Copy link
Contributor

@mykhailopylyp mykhailopylyp commented Dec 16, 2020

Summary of the Pull Request

What is this about?
Simple standalone tool for bug reporting. It is a win32 console application that takes the path of the resulting zip folder as cmd argument. The resulting zip folder includes PowerToys folder from AppData.

PR Checklist

  • Applies to Easy way to get bug information #726
  • CLA signed. If not, go over here and sign the CLA
  • 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

Info on Pull Request

What does this include?

  • Standalone application BugReportTool.exe
  • Separate solution BugReportTool.sln
  • External zip library as git submodule

The tool performs the following steps:

  • Copiy the PowerToys folder from AppData into the Temp folder
  • Replace all sensitive data in json files and delete some files
  • Create zip folder on the desktop if cmd argument was not send

Validation Steps Performed

How does someone test & validate?
Buid BugReportTool.sln and installer. Then try to install it and verify if the tool is present under C:\Program Files\PowerToys\BugReportTool and it works. Try passing the location of the resulting zip folder as a cmd argument.

@microsoft microsoft deleted a comment from github-actions bot Dec 17, 2020
@mykhailopylyp mykhailopylyp marked this pull request as ready for review December 17, 2020 12:59
@mykhailopylyp
Copy link
Contributor Author

Take into account that there are possible issues with paths as eventually, we convert them to char*. It seems like a rare issue and should not block the PR. We will hopefully address it in the next release.

Copy link
Contributor

@yuyoyuppe yuyoyuppe left a comment

Choose a reason for hiding this comment

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

Great job!

@mykhailopylyp
Copy link
Contributor Author

@enricogior
We might want to think about hiding some more data.

  • ColorPicker/settings.json properties/colorhistory. Not sure about it.
  • FancyZones/settings.json properties/fancyzones_excluded_apps
  • PowerRename/power-rename-settings.json SearchText ReplaceText. It seems to store last rename operation info.
  • PowerToys Run/QueryHistory.json Items. I do not know how it is filled.

Maybe we also want to delete some cache info. Something like PowerToys Run/Cache/Image.cache and PowerToys Run/Cache/Pinyin.cache.
Should we consider key and shortcut remappings as sensitive information?

@github-actions
Copy link

New misspellings found, please review:

  • eport
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"actionrunner aeed AUMID Bokmal btn commonmdflag contextmenu DISPLAYNAME fbdc HMONITOR MAKELANGID MONITORINFOF msvs Mvvm notificationsdll RSHIFT SNAPED Stdout uniquifies WCF WDS wifstream WINAPI XPath YAML "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"aumid BOKMAL Btn CONTEXTMENU displayname eport hmonitor monitorinfof mvvm NOTIFICATIONSDLL rshift stdout Uniquifies wds winapi xpath yaml "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

@github-actions
Copy link

New misspellings found, please review:

  • eport
  • FARPROC
  • LPOSVERSIONINFOEXW
  • ntdll
  • NTSTATUS
  • OSVERSIONINFOEXW
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"actionrunner aeed AUMID Bokmal btn commonmdflag contextmenu DISPLAYNAME fbdc HMONITOR MAKELANGID MONITORINFOF msvs Mvvm notificationsdll RSHIFT SNAPED Stdout uniquifies WCF WDS wifstream WINAPI XPath YAML "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"aumid BOKMAL Btn CONTEXTMENU displayname eport FARPROC hmonitor LPOSVERSIONINFOEXW monitorinfof mvvm NOTIFICATIONSDLL ntdll NTSTATUS OSVERSIONINFOEXW rshift stdout Uniquifies wds winapi xpath yaml "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

@github-actions
Copy link

New misspellings found, please review:

  • eport
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"actionrunner aeed Bokmal btn commonmdflag contextmenu fbdc MAKELANGID msvs notificationsdll SNAPED uniquifies WCF wifstream XPath "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"BOKMAL Btn CONTEXTMENU eport NOTIFICATIONSDLL Uniquifies xpath "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

@yuyoyuppe
Copy link
Contributor

@enricogior
Copy link
Contributor

After we merge, we need to make some changes:

  • we either move the solution to the tools folder or we leave it in src but move the project to the main solution
  • we should remove the dependency with monitor_info_report
  • rename the folder from bug-report to BugReportTool

@enricogior enricogior merged commit 321a722 into microsoft:master Dec 22, 2020
@mykhailopylyp mykhailopylyp deleted the diagnostic-tool-czip branch May 7, 2021 10:24
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.

3 participants