Add a server flag onlyUseTipOfTreeTargetsExistenceToFilterTargets.#4731
Add a server flag onlyUseTipOfTreeTargetsExistenceToFilterTargets.#4731matanlurey wants to merge 2 commits into
onlyUseTipOfTreeTargetsExistenceToFilterTargets.#4731Conversation
|
|
||
| /// Whether to _only_ use the existence of a target at tip-of-tree to filter | ||
| /// out targets on other branches. | ||
| /// | ||
| /// See [CiYaml.onlyUseTipOfTreeTargetsExistenceToFilterTargets]. | ||
| @JsonKey( | ||
| defaultValue: Config.kOnlyUseTipOfTreeTargetsExistenceToFilterTargets, | ||
| ) | ||
| final bool onlyUseTipOfTreeTargetsExistenceToFilterTargets; |
There was a problem hiding this comment.
I can see us having some other flags for ci_yaml; can we create a CiYamlFlags like ContentAwareHashingJson instead of expanding this?
| required this.slug, | ||
| required this.branch, | ||
| required Map<CiType, pb.SchedulerConfig> yamls, | ||
| bool onlyUseTipOfTreeTargetsExistenceToFilterTargets = |
There was a problem hiding this comment.
Could we make this required without reaching out to Config.kOnlyUseTipOfTreeTargetsExistenceToFilterTargets?
| /// See [CiYaml.onlyUseTipOfTreeTargetsExistenceToFilterTargets]. | ||
| static const bool kOnlyUseTipOfTreeTargetsExistenceToFilterTargets = false; |
There was a problem hiding this comment.
Rather than exposing the default and maybe hiding places that do not pass this flag (error prone); make people refer to config.onlyUseTipOfTreeTargetsExistenceToFilterTargets.
|
|
||
| onlyUseTipOfTreeTargetsExistenceToFilterTargets: true |
There was a problem hiding this comment.
do this in its own PR so it can be reverted cleanly if needed.
| /// | ||
| /// See [CiYaml.onlyUseTipOfTreeTargetsExistenceToFilterTargets]. | ||
| @JsonKey( | ||
| defaultValue: Config.kOnlyUseTipOfTreeTargetsExistenceToFilterTargets, |
There was a problem hiding this comment.
default this to true as that's the current/safe option. The flag should get flipped in another PR and then eventually cleaned up in the future.
…#4732) Doing as pre-work before requested changes on #4731. I ran into a number of cases where changes were needed, and figured a separate PR was cleaner: - Moved all of the bits out of `config.dart` and into `flags/_*.dart` files to reduce file size - We have command-line tools in `app_dart/bin` that are _not_ a server (i.e. `verify_test_ownership.dart`) that create `CiYaml` objects, and also need `CiYamlFlags`. Instead of hacking something together, I added `DynamicConfig.fromRemoteLatest` and `DynamicConfig.fromLocalRepo` to use, respectively, in these command-line tools (which are used in CI production, not unused tools). - I made all of the objects `const`-able, and made it easy to create defaults, even if they are not `const` themselves, by using the `factory` constructor pattern. That also gets rid of the kludge we had with `contentAwareHashing` default values.
Closes #4731 (well, replaces). Towards flutter/flutter#169625.
Towards flutter/flutter#169625.