Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
85ad6998
Unverified
Commit
85ad6998
authored
Apr 03, 2020
by
Jenn Magder
Committed by
GitHub
Apr 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove URL shortening from GitHub reporter similar issues URL (#53882)
parent
b336452c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
31 deletions
+7
-31
runner.dart
packages/flutter_tools/lib/runner.dart
+1
-1
github_template.dart
...ages/flutter_tools/lib/src/reporting/github_template.dart
+2
-3
github_template_test.dart
...lutter_tools/test/general.shard/github_template_test.dart
+3
-23
runner_test.dart
.../flutter_tools/test/general.shard/runner/runner_test.dart
+1
-4
No files found.
packages/flutter_tools/lib/runner.dart
View file @
85ad6998
...
...
@@ -165,7 +165,7 @@ Future<void> _informUserOfCrash(List<String> args, dynamic error, StackTrace sta
flutterProjectFactory:
globals
.
projectFactory
,
client:
clientFactory
!=
null
?
clientFactory
()
:
HttpClient
(),
);
final
String
similarIssuesURL
=
await
gitHubTemplateCreator
.
toolCrashSimilarIssuesGitHub
URL
(
errorString
);
final
String
similarIssuesURL
=
GitHubTemplateCreator
.
toolCrashSimilarIssues
URL
(
errorString
);
globals
.
printStatus
(
'
$similarIssuesURL
\n
'
,
wrap:
false
);
globals
.
printStatus
(
'To report your crash to the Flutter team, first read the guide to filing a bug.'
,
emphasis:
true
);
globals
.
printStatus
(
'https://flutter.dev/docs/resources/bug-reports
\n
'
,
wrap:
false
);
...
...
packages/flutter_tools/lib/src/reporting/github_template.dart
View file @
85ad6998
...
...
@@ -32,9 +32,8 @@ class GitHubTemplateCreator {
final
FlutterProjectFactory
_flutterProjectFactory
;
final
HttpClient
_client
;
Future
<
String
>
toolCrashSimilarIssuesGitHubURL
(
String
errorString
)
async
{
final
String
fullURL
=
'https://github.com/flutter/flutter/issues?q=is%3Aissue+
${Uri.encodeQueryComponent(errorString)}
'
;
return
await
_shortURL
(
fullURL
);
static
String
toolCrashSimilarIssuesURL
(
String
errorString
)
{
return
'https://github.com/flutter/flutter/issues?q=is%3Aissue+
${Uri.encodeQueryComponent(errorString)}
'
;
}
/// GitHub URL to present to the user containing encoded suggested template.
...
...
packages/flutter_tools/test/general.shard/github_template_test.dart
View file @
85ad6998
...
...
@@ -24,31 +24,11 @@ void main() {
});
group
(
'GitHub template creator'
,
()
{
testWithoutContext
(
'similar issues URL'
,
()
async
{
final
GitHubTemplateCreator
creator
=
GitHubTemplateCreator
(
fileSystem:
fs
,
logger:
logger
,
client:
SuccessShortenURLFakeHttpClient
(),
flutterProjectFactory:
FlutterProjectFactory
(),
);
expect
(
await
creator
.
toolCrashSimilarIssuesGitHubURL
(
'this is a 100% error'
),
_kShortURL
);
});
testWithoutContext
(
'similar issues URL with network failure'
,
()
async
{
final
GitHubTemplateCreator
creator
=
GitHubTemplateCreator
(
fileSystem:
fs
,
logger:
logger
,
client:
FakeHttpClient
(),
flutterProjectFactory:
FlutterProjectFactory
(),
);
testWithoutContext
(
'similar issues URL'
,
()
{
expect
(
await
creator
.
toolCrashSimilarIssuesGitHub
URL
(
'this is a 100% error'
),
'https://github.com/flutter/flutter/issues?q=is%3Aissue+this+is+a+100%25+error'
GitHubTemplateCreator
.
toolCrashSimilarIssues
URL
(
'this is a 100% error'
),
'https://github.com/flutter/flutter/issues?q=is%3Aissue+this+is+a+100%25+error'
,
);
expect
(
logger
.
traceText
,
contains
(
'Failed to shorten GitHub template URL'
));
});
group
(
'new issue template URL'
,
()
{
...
...
packages/flutter_tools/test/general.shard/runner/runner_test.dart
View file @
85ad6998
...
...
@@ -81,9 +81,6 @@ void main() {
});
testUsingContext
(
'GitHub issue template'
,
()
async
{
const
String
similarURL
=
'https://example.com/1'
;
when
(
mockGitHubTemplateCreator
.
toolCrashSimilarIssuesGitHubURL
(
any
))
.
thenAnswer
((
_
)
async
=>
similarURL
);
const
String
templateURL
=
'https://example.com/2'
;
when
(
mockGitHubTemplateCreator
.
toolCrashIssueTemplateGitHubURL
(
any
,
any
,
any
,
any
,
any
))
.
thenAnswer
((
_
)
async
=>
templateURL
);
...
...
@@ -115,7 +112,7 @@ void main() {
expect
(
errorText
,
contains
(
'Oops; flutter has exited unexpectedly: "an exception % --".
\n
'
));
final
String
statusText
=
testLogger
.
statusText
;
expect
(
statusText
,
contains
(
similarURL
));
expect
(
statusText
,
contains
(
'https://github.com/flutter/flutter/issues?q=is%3Aissue+an+exception+%25+--'
));
expect
(
statusText
,
contains
(
'https://flutter.dev/docs/resources/bug-reports'
));
expect
(
statusText
,
contains
(
templateURL
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment