Skip to content

Add /api/update-tree-status, which is currently write-only #4759

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

Merged
merged 3 commits into from
Jun 3, 2025

Conversation

matanlurey
Copy link
Contributor

Towards flutter/flutter#74529.

Inserts documents into the collection tree_status_change, with the following "schema":

static Future<TreeStatusChange> create(
  FirestoreService firestore, {
  required DateTime createdOn,
  required TreeStatus status,
  required String authoredBy,
  required RepositorySlug repository,
});

To determine if the current tree should be (manually) failing, we'd run:

static Future<TreeStatusChange?> getLatest(
  FirestoreService firestore, {
  required RepositorySlug repository,
}) async {
  final docs = await firestore.query(
    metadata.collectionId,
    {'$_fieldRepository =': repository.fullName},
    limit: 1,
    orderMap: {_fieldCreateTimestamp: kQueryOrderDescending},
  );
  return docs.isEmpty ? null : TreeStatusChange.fromDocument(docs.first);
}

... however, that is not hooked up yet (we also need to create indexes first, etc).

@matanlurey matanlurey requested a review from jtmcdole June 3, 2025 17:30
Comment on lines +78 to +81

String get authoredBy {
return fields[_fieldAuthoredBy]!.stringValue!;
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we have an optional String reason?

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App. label Jun 3, 2025
@auto-submit auto-submit bot merged commit 5557b7f into flutter:main Jun 3, 2025
17 checks passed
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