Skip to content

Conversation

@CaseyHillers
Copy link
Contributor

@CaseyHillers CaseyHillers commented Feb 18, 2022

This is to fix reruns in cocoon, plugins, packages dashboards, and should help fix the engine issues.

flutter/flutter#92300
flutter/flutter#98674
Fixes flutter/flutter#99370

@CaseyHillers
Copy link
Contributor Author

Note to reviewers: This is still WIP. I'm coming back to it now and pushed some WIP changes to my remote branch

final Task update = datastoreTask.task;
update.status = latestLuciTask.status;

final CiYaml ciYaml = await scheduler.getCiYaml(datastoreTask.commit);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's expensive to load the CiYaml for every single task. Can we load it on commit level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scheduler.getCiYaml is cached making it trivial to pull up. Since this logic is only a for loop against existing tasks, is it ok to leave as is? It's difficult to refactor this code to be a double for loop of commit to tasks

Comment on lines -57 to -58
final Map<String, dynamic> defaultProperties =
repo == 'engine' ? Config.engineDefaultProperties : const <String, dynamic>{};
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this is removed? We need to inject this to make sure the engine rerun succeeds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in luci build service now. See

properties: commit.slug == Config.engineSlug ? Config.engineDefaultProperties : null,

final Target target =
ciYaml.postsubmitTargets.singleWhere((Target target) => target.value.name == datastoreTask.task.name);

/// Use `update.attempts - 1` as the `retries` to skip the initial run.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: cleanup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Removed the extra logic here

commit: datastoreTask.commit,
target: target,
task: update,
datastore: datastore,
Copy link
Contributor

Choose a reason for hiding this comment

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

With ignoreChecks default false, this rerun will never be triggered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ignoreChecks is reserved for the reset-prod-test use case as humans likely have a better idea if we should retry (such as needing a 4th retry). In this case, refresh chromebot will trigger tests as long as it meets the conditions in checkRerunBuilder (< 3 attempts, latest datastore does not indicate it passed).

commit: commit,
target: target,
task: task,
priority: 29,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: add a doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved this into a const variable (along with the other priorities)


static const int kDefaultPriority = 30;
static const int kRerunPriority = 29;
static const int kReleasePriority = 25;
Copy link
Contributor

Choose a reason for hiding this comment

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

We agreed to use same priority for release builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for their presubmits. When we start rolling out the cocoon scheduler on release branches, we'll need to revisit this. I filed flutter/flutter#99876 to follow up

Copy link
Contributor

Choose a reason for hiding this comment

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

kReleasePriority is only referenced in post submit function _createPostsubmitScheduleBuild below, but is not injected to ScheduleBuildRequest. I am a bit confused about how this is related to the pre-submit schedule and which logic in this PR is expected to use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, you're right. I removed this logic (I'm not sure why we had it there in the first place)

@CaseyHillers CaseyHillers requested a review from keyonghan March 9, 2022 23:07
Copy link
Contributor

@keyonghan keyonghan left a comment

Choose a reason for hiding this comment

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

LGTM

@CaseyHillers CaseyHillers added the waiting for tree to go green Merge PR when tree becomes green via fluttergithubbot label Mar 9, 2022
@fluttergithubbot fluttergithubbot merged commit 38de8cd into flutter:main Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for tree to go green Merge PR when tree becomes green via fluttergithubbot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux ci_yaml flutter roller failed on git push

4 participants