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

Datastore to Firestore Migration #142951

Open
24 of 44 tasks
keyonghan opened this issue Feb 6, 2024 · 0 comments
Open
24 of 44 tasks

Datastore to Firestore Migration #142951

keyonghan opened this issue Feb 6, 2024 · 0 comments
Assignees
Labels
P2 Important issues not at the top of the work list team-infra Owned by Infrastructure team

Comments

@keyonghan
Copy link
Contributor

keyonghan commented Feb 6, 2024

This is a tracking issue to migrat Datastore to Firestore.

@keyonghan keyonghan self-assigned this Feb 6, 2024
@keyonghan keyonghan added team-infra Owned by Infrastructure team P2 Important issues not at the top of the work list labels Feb 6, 2024
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 6, 2024
The very first step to support Firestore. Part of flutter/flutter#142951

This PR:
1) Creates a client support with customized header support
2) Adds a basic FirestoreService based on the client
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 8, 2024
This PR
1) starts writing new commit/tasks to the new Firestore database
2) is a no-op to existing workflow. Will catch any exception without breaking existing logic.
3) puts generic logics (like documents to writes, comits/tasks to documents, etc) in the firestore service
4) adds extensive tests for each logic added. 

Part of flutter/flutter#142951.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 8, 2024
Follow up of #3473.

It turns out that Firestore doesn't accept null/empty values for `integerValue`.
This PR removes the field when adding new tasks. The `builderNumber` field will be added when updating task statuses, where the real build number will be available until then.

Fixes: flutter/flutter#143187
More context: flutter/flutter#142951
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 20, 2024
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.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 21, 2024
This is a follow up of #3495.

This PR:
1) updates the latest task status correctly when multiple records exist
2) uses const variables to avoid potential typos

Part of flutter/flutter#142951
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 21, 2024
Part of flutter/flutter#142951

This PR starts updating task documents in Firestore when batch back filling tasks.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 21, 2024
Part of flutter/flutter#142951

This PR:
1) inserts new task document to Firestore when retried manually
2) fixes `trigger_type` tag: instead of overriding manual case as `trigger_type: auto`, we now distinguish them with
2.1) `trigger_type: manual_retry` for manual retry
2.2) `trigger_type: auto_retry` for auto retry
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 23, 2024
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 23, 2024
Part of flutter/flutter#142951

This PR:
1) starts updating Github Gold Status to Firestore
2) updates status in a try block to avoid breaking prod workflow
3) creates a corresponding Firestore model
4) updates `documentsToWrites` to have default `exists=null` to support generic document writes.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Feb 28, 2024
sealesj pushed a commit to sealesj/cocoon that referenced this issue Mar 7, 2024
Part of flutter/flutter#142951

This PR:

- starts updating Github Build Status to Firestore
- updates status in a try block to avoid breaking prod workflow
- creates a corresponding Firestore model
sealesj pushed a commit to sealesj/cocoon that referenced this issue Mar 7, 2024
Part of flutter/flutter#142951.

This PR:
1) adds a query wrapper to simplify logics
2) switch existing commitTask query to use the new wrapper
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Mar 8, 2024
Part of flutter/flutter#142951.

The github gold status API has been querying and writing updates to Datastore.
#3513 started writing updates to Firestore.

This PR:
1) starts querying from Firestore
2) supports both datastore/Firestore queries and writes
3) updates all unit tests to cover Firestore logics
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Mar 13, 2024
Part of flutter/flutter#142951.

This is to prepare switching get-build-status queries to firestore.

This PR:
1) add function queryRecentCommits
2) add query option: `orders` and `limit`.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Mar 18, 2024
Part of flutter/flutter#142951

This PR:
1) keeps existing function `retrieveCommitStatus` and creates a new `retrieveCommitStatusFirestore` for `get_build_status` API. This is to avoid affecting other APIs.
2) keeps existing class `CommitStatus` and creates a new `CommitTasksStatus` to support firestore case, preparing to deprecate the `stage` field from the old Task status.
3) maps to the firestore commit/task fields from old Datastore models and updates all related tests.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Mar 19, 2024
Part of flutter/flutter#142951.

The github build status API has been querying and writing updates to Datastore.

This PR:

- starts querying from Firestore
- supports both datastore/Firestore queries and writes
- updates all unit tests to cover Firestore logics
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Mar 19, 2024
Part of flutter/flutter#142951.

To migrate postsubmit build API fully to firestore, we need to support user data servicing firestore data models. This PR adds corresponding document names.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Mar 19, 2024
)

Part of flutter/flutter#142951

Following #3583, this PR:
1) switches logics to use firestore task
2) keeps querying/writing task status for both Datastore and Firestore, in case fallback happens
3) updates all unit tests
4) removes the condition when `taskKey` doesn't exist (seems all builds are enforced with the `userData`, and confirmed no call for the past week)
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Mar 25, 2024
Part of flutter/flutter#142951

This PR:
1) supports `taskDocumentName` arg for reset-prod-task API. This is to prepare frontend logic switched to Firestore
2) uses Firestore data when checking rerun, instead of Datastore data
3) moves `taskFailStatusSet` to Task models
4) moves Firestore logics out of try/catch block to break API if failing
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Apr 10, 2024
This is to prepare frontend firestore migration for Cocoon dashboard.

Part of flutter/flutter#142951.
One can view #3619 for a quick reference how we are gonna to use these protos.

This PR adds:

- commit_firestore.proto, a replacement of commit.proto for Datastore case
- task_firestore.proto, a replacement of task.proto for Datastore case
- commit_tasks_status.proto, a replacement of commit_status.proto for Datastore case

Note: *.pb.dart, *.pbenum.dart, *.pbjson.dart, *.pbserver.dart are auto generated based on the proto.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Apr 11, 2024
This is part of flutter/flutter#142951

This PR adds logics to fetch commit tasks status from Firestore based on newly added Firestore data model protos. After this lands, next step is to switch the build logic to reference this PR's changes from Datastore.

This PR is a no-op change by this point.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Apr 15, 2024
Part of flutter/flutter#142951.

This PR adds api entry point for `api/public/get-status-firestore`. This is prepare frontend migration to Firestore.

This change is a no-op, as the frontend is still calling `api/public/get-status`.
auto-submit bot pushed a commit to flutter/cocoon that referenced this issue Apr 17, 2024
Frontend needs `BuildList` to handle case of multiple reruns. This PR updates the returned results from.

```
statuses:
  commit,
  tasks
```

to 

```
statuses:
  Commit,
  Tasks
    Task
    BuildList
```

Part of flutter/flutter#142951.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issues not at the top of the work list team-infra Owned by Infrastructure team
Projects
None yet
Development

No branches or pull requests

2 participants