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
43c307b3
Unverified
Commit
43c307b3
authored
Apr 22, 2021
by
Jonah Williams
Committed by
GitHub
Apr 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "[devicelab] remove globals and dependency tracking from technical debt (#80946)" (#80958)
This reverts commit
dc71d713
.
parent
dc71d713
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
technical_debt__cost.dart
dev/devicelab/bin/tasks/technical_debt__cost.dart
+40
-0
No files found.
dev/devicelab/bin/tasks/technical_debt__cost.dart
View file @
43c307b3
...
@@ -82,6 +82,43 @@ Future<double> findCostsForRepo() async {
...
@@ -82,6 +82,43 @@ Future<double> findCostsForRepo() async {
return
total
;
return
total
;
}
}
Future
<
int
>
findGlobalsForTool
()
async
{
final
Process
git
=
await
startProcess
(
'git'
,
<
String
>[
'ls-files'
,
'--full-name'
,
path
.
join
(
flutterDirectory
.
path
,
'packages'
,
'flutter_tools'
)],
workingDirectory:
flutterDirectory
.
path
,
);
int
total
=
0
;
await
for
(
final
String
entry
in
git
.
stdout
.
transform
<
String
>(
utf8
.
decoder
).
transform
<
String
>(
const
LineSplitter
()))
total
+=
await
findGlobalsForFile
(
File
(
path
.
join
(
flutterDirectory
.
path
,
entry
)));
final
int
gitExitCode
=
await
git
.
exitCode
;
if
(
gitExitCode
!=
0
)
throw
Exception
(
'git exit with unexpected error code
$gitExitCode
'
);
return
total
;
}
Future
<
int
>
countDependencies
()
async
{
final
List
<
String
>
lines
=
(
await
evalFlutter
(
'update-packages'
,
options:
<
String
>[
'--transitive-closure'
],
)).
split
(
'
\n
'
);
final
int
count
=
lines
.
where
((
String
line
)
=>
line
.
contains
(
'->'
)).
length
;
if
(
count
<
2
)
// we'll always have flutter and flutter_test, at least...
throw
Exception
(
'"flutter update-packages --transitive-closure" returned bogus output:
\n
${lines.join("\n")}
'
);
return
count
;
}
Future
<
int
>
countConsumerDependencies
()
async
{
final
List
<
String
>
lines
=
(
await
evalFlutter
(
'update-packages'
,
options:
<
String
>[
'--transitive-closure'
,
'--consumer-only'
],
)).
split
(
'
\n
'
);
final
int
count
=
lines
.
where
((
String
line
)
=>
line
.
contains
(
'->'
)).
length
;
if
(
count
<
2
)
// we'll always have flutter and flutter_test, at least...
throw
Exception
(
'"flutter update-packages --transitive-closure" returned bogus output:
\n
${lines.join("\n")}
'
);
return
count
;
}
const
String
_kCostBenchmarkKey
=
'technical_debt_in_dollars'
;
const
String
_kCostBenchmarkKey
=
'technical_debt_in_dollars'
;
const
String
_kNumberOfDependenciesKey
=
'dependencies_count'
;
const
String
_kNumberOfDependenciesKey
=
'dependencies_count'
;
const
String
_kNumberOfConsumerDependenciesKey
=
'consumer_dependencies_count'
;
const
String
_kNumberOfConsumerDependenciesKey
=
'consumer_dependencies_count'
;
...
@@ -92,6 +129,9 @@ Future<void> main() async {
...
@@ -92,6 +129,9 @@ Future<void> main() async {
return
TaskResult
.
success
(
return
TaskResult
.
success
(
<
String
,
dynamic
>{
<
String
,
dynamic
>{
_kCostBenchmarkKey:
await
findCostsForRepo
(),
_kCostBenchmarkKey:
await
findCostsForRepo
(),
_kNumberOfDependenciesKey:
await
countDependencies
(),
_kNumberOfConsumerDependenciesKey:
await
countConsumerDependencies
(),
_kNumberOfFlutterToolGlobals:
await
findGlobalsForTool
(),
},
},
benchmarkScoreKeys:
<
String
>[
benchmarkScoreKeys:
<
String
>[
_kCostBenchmarkKey
,
_kCostBenchmarkKey
,
...
...
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