Skip to content

Commit e579ae8

Browse files
authored
Removes unused feature target.dependencies and ciYaml.getInitialTargets(). (#4713)
Note that `target.properties.dependencies`, something entirely different, is not affected. Closes flutter/flutter#169103.
1 parent 6a04d7e commit e579ae8

9 files changed

Lines changed: 62 additions & 359 deletions

File tree

app_dart/lib/src/model/ci_yaml/ci_yaml.dart

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,6 @@ final class CiYamlSet {
100100
List<String>? totPostsubmitTargetNames({CiType type = CiType.any}) =>
101101
configs[type]!.totPostsubmitTargetNames;
102102

103-
/// Filters [targets] to those that should be started immediately.
104-
///
105-
/// Targets with a dependency are triggered when there dependency pushes a notification that it has finished.
106-
/// This shouldn't be confused for targets that have the property named dependency, which is used by the
107-
/// flutter_deps recipe module on LUCI.
108-
List<Target> getInitialTargets(
109-
List<Target> targets, {
110-
CiType type = CiType.any,
111-
}) => configs[type]!.getInitialTargets(targets);
112-
113103
/// Get an unfiltered list of all [targets] that are found in the ci.yaml file.
114104
List<Target> targets({CiType type = CiType.any}) => configs[type]!.targets;
115105
}
@@ -284,24 +274,6 @@ class CiYaml {
284274
}).toList();
285275
}
286276

287-
/// Filters [targets] to those that should be started immediately.
288-
///
289-
/// Targets with a dependency are triggered when there dependency pushes a notification that it has finished.
290-
/// This shouldn't be confused for targets that have the property named dependency, which is used by the
291-
/// flutter_deps recipe module on LUCI.
292-
List<Target> getInitialTargets(List<Target> targets) {
293-
Iterable<Target> initialTargets =
294-
targets.where((Target target) => target.dependencies.isEmpty).toList();
295-
if (branch != Config.defaultBranch(slug)) {
296-
// Filter out bringup targets for release branches
297-
initialTargets = initialTargets.where(
298-
(Target target) => !target.isBringup,
299-
);
300-
}
301-
302-
return initialTargets.toList();
303-
}
304-
305277
Iterable<Target> get _targets => config.targets.map(
306278
(pb.Target target) =>
307279
Target(schedulerConfig: config, value: target, slug: slug),
@@ -420,24 +392,6 @@ class CiYaml {
420392
continue;
421393
}
422394
targetGraph[target.name] = <pb.Target>[];
423-
// Add edges
424-
if (target.dependencies.isNotEmpty) {
425-
if (target.dependencies.length != 1) {
426-
exceptions.add(
427-
'ERROR: ${target.name} has multiple dependencies which is not supported. Use only one dependency',
428-
);
429-
} else {
430-
if (target.dependencies.first == target.name) {
431-
exceptions.add('ERROR: ${target.name} cannot depend on itself');
432-
} else if (targetGraph.containsKey(target.dependencies.first)) {
433-
targetGraph[target.dependencies.first]!.add(target);
434-
} else {
435-
exceptions.add(
436-
'ERROR: ${target.name} depends on ${target.dependencies.first} which does not exist',
437-
);
438-
}
439-
}
440-
}
441395

442396
// To add or change validations that are specific to a repository, such as flutter/flutter,
443397
// see https://github.com/flutter/flutter/blob/master/dev/bots/test/ci_yaml_validation_test.dart.

app_dart/lib/src/model/ci_yaml/target.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,6 @@ final class Target {
143143
_value.enabledBranches,
144144
);
145145

146-
/// The target's dependencies.
147-
///
148-
/// This list is unmodifiable.
149-
late final List<String> dependencies = List.unmodifiable(_value.dependencies);
150-
151146
/// The target's `runIf` configuration.
152147
///
153148
/// This list is unmodifiable.

app_dart/lib/src/model/proto/internal/scheduler.pb.dart

Lines changed: 35 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app_dart/lib/src/model/proto/internal/scheduler.pbjson.dart

Lines changed: 19 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app_dart/lib/src/model/proto/internal/scheduler.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ message Target {
3232
// Unique, human readable identifier.
3333
optional string name = 1;
3434
// Names of other targets required to succeed before triggering this target.
35-
repeated string dependencies = 2;
35+
reserved 2; // dependencies
3636
// Whether this target is stable and can be used to gate commits.
3737
// Defaults to false which blocks builds and does not run in presubmit.
3838
optional bool bringup = 3 [default = false];

app_dart/lib/src/service/scheduler.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,13 @@ class Scheduler {
162162
commit.toRef(),
163163
postsubmit: true,
164164
);
165-
final targets = ciYaml.getInitialTargets(ciYaml.postsubmitTargets());
165+
final targets = ciYaml.postsubmitTargets();
166166
final isFusion = commit.slug == Config.flutterSlug;
167167
if (isFusion) {
168168
final fusionPostTargets = ciYaml.postsubmitTargets(
169169
type: CiType.fusionEngine,
170170
);
171-
final fusionInitialTargets = ciYaml.getInitialTargets(
172-
fusionPostTargets,
173-
type: CiType.fusionEngine,
174-
);
175-
targets.addAll(fusionInitialTargets);
171+
targets.addAll(fusionPostTargets);
176172
// Note on post submit targets: CiYaml filters out release_true for release branches and fusion trees
177173
}
178174

0 commit comments

Comments
 (0)