Skip to content

Add a server flag onlyUseTipOfTreeTargetsExistenceToFilterTargets.#4731

Closed
matanlurey wants to merge 2 commits into
flutter:mainfrom
matanlurey:flag-onlyUseTipOfTreeTargetsExistenceToFilterTargets
Closed

Add a server flag onlyUseTipOfTreeTargetsExistenceToFilterTargets.#4731
matanlurey wants to merge 2 commits into
flutter:mainfrom
matanlurey:flag-onlyUseTipOfTreeTargetsExistenceToFilterTargets

Conversation

@matanlurey
Copy link
Copy Markdown
Contributor

@matanlurey matanlurey requested a review from jtmcdole May 28, 2025 22:48
Comment on lines 525 to +533

/// 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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we make this required without reaching out to Config.kOnlyUseTipOfTreeTargetsExistenceToFilterTargets?

Comment on lines +46 to +47
/// See [CiYaml.onlyUseTipOfTreeTargetsExistenceToFilterTargets].
static const bool kOnlyUseTipOfTreeTargetsExistenceToFilterTargets = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rather than exposing the default and maybe hiding places that do not pass this flag (error prone); make people refer to config.onlyUseTipOfTreeTargetsExistenceToFilterTargets.

Comment thread app_dart/config.yaml
Comment on lines 7 to +8

onlyUseTipOfTreeTargetsExistenceToFilterTargets: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do this in its own PR so it can be reverted cleanly if needed.

///
/// See [CiYaml.onlyUseTipOfTreeTargetsExistenceToFilterTargets].
@JsonKey(
defaultValue: Config.kOnlyUseTipOfTreeTargetsExistenceToFilterTargets,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

auto-submit Bot pushed a commit that referenced this pull request May 29, 2025
…#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.
@matanlurey matanlurey marked this pull request as draft May 29, 2025 16:54
@auto-submit auto-submit Bot closed this in #4733 May 29, 2025
auto-submit Bot pushed a commit that referenced this pull request May 29, 2025
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.

2 participants