Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple records for retries on a same task #3494

Merged
merged 5 commits into from
Feb 20, 2024

Conversation

keyonghan
Copy link
Contributor

This PR adds support to save multiple entries for a task retry. Old logic overrides task statuses on a single task, which fails to track statuses.

This PR:

  1. makes it customizable to collect attempts info
  2. adds current_attempt tag to make it easy to track attempts info.
  3. handles attempt increase when retry is triggered.

Part of flutter/flutter#142951.

@@ -94,7 +94,10 @@ class Task extends Document {
///
/// This is a human-readable name, typically a test name (e.g.
/// "hello_world__memory").
String? get taskName => fields!['endTimestamp']!.stringValue!;
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this meant to be removed?

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 line is actually a duplicate of https://github.com/flutter/cocoon/pull/3494/files#diff-bb6959c7655c2a5b97a3f09154743dd42d0c9167cb7643bbe51fbeffca9a96e6L91.

Here we are updating it to name (line 97 below).

final String sha = commitKeyId.split('/').last;
final String documentName = '$kDatabase/documents/tasks/${sha}_${taskName}_1';
final String documentName = '$kDatabase/documents/tasks/${sha}_${taskName}_$currentAttempt';
Copy link
Contributor

Choose a reason for hiding this comment

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

No action: This actually makes the _1 from the previous change make more sense.

Copy link
Contributor

@ricardoamador ricardoamador left a comment

Choose a reason for hiding this comment

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

LGTM with nits.

@keyonghan keyonghan added the autosubmit Merge PR when tree becomes green via auto submit App. label Feb 20, 2024
@auto-submit auto-submit bot merged commit 83a44f0 into flutter:main Feb 20, 2024
3 checks passed
auto-submit bot pushed a commit that referenced this pull request Feb 20, 2024
Mistakenly merged in #3494. This PR restores the URL.
@keyonghan keyonghan deleted the tracking_attempts branch March 13, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants