Skip to content

feat(ops): firestore indexes for application and event paging queries - #7274

Open
srinivasr wants to merge 5 commits into
pipe-cd:masterfrom
srinivasr:indexes-first
Open

feat(ops): firestore indexes for application and event paging queries#7274
srinivasr wants to merge 5 commits into
pipe-cd:masterfrom
srinivasr:indexes-first

Conversation

@srinivasr

Copy link
Copy Markdown
Contributor

splitting these out of #7234 per reviewer request so operators can let them build in the background before the actual query changes ship.

What this PR does:

Adds the Firestore composite indexes required by the paginated ListApplications and ListEvents queries coming in #7234. The Application indexes include the Disabled field that CreateDeploymentChain and ListApplications always filter on:

  • ProjectId | PipedId | Disabled | Id
  • ProjectId | Disabled | Id
  • ProjectId | Disabled | Name | Id
  • ProjectId | Disabled | Kind | Id
  • ProjectId | Disabled | Name | Kind | Id

Also adds the Event indexes needed for cursor-paged ListEvents queries.

Why we need it:

Firestore indexes can take a few minutes to build after being created. Landing them separately lets operators deploy this first and let the indexes finish building before the query changes in #7234 ship, avoiding any query errors during the window between deployments.

Which issue(s) this PR fixes:

Fixes #

Prereq for #7234

Does this PR introduce a user-facing change?:

  • How are users affected by this change: No visible change. The firestoreindexensurer component creates the new indexes automatically on next deployment.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

splitting these out of pipe-cd#7234 per reviewer request so operators can let
them build in the background before the actual query changes ship.

Co-authored-by: areebahmeddd <areebahmeddd@users.noreply.github.com>
Signed-off-by: srinivasr <sriniv4sreddy@gmail.com>
@srinivasr
srinivasr requested review from a team as code owners August 26, 2026 17:11
@srinivasr
srinivasr requested review from armistcxy, hongky-1994, mohammedfirdouss and t-kikuc and a lite review from Copilot August 26, 2026 17:11
@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for pipecd-site canceled.

Name Link
🔨 Latest commit 804ff29
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6a93b8d84fb592000813dbfd

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds new Firestore composite index definitions to firestoreindexensurer so operators can deploy and let indexes build ahead of the upcoming paginated query changes (notably ListApplications / ListEvents) referenced in #7234.

Changes:

  • Added composite indexes for Application to support paging/sorting patterns that include Disabled and stable ordering by Id.
  • Added composite indexes for Event to support cursor paging for both ascending and descending CreatedAt orderings (including Status-filtered queries).
  • Updated the index parsing test expectations to include the newly added index entries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/app/ops/firestoreindexensurer/indexes.json Adds new Application and Event composite index definitions needed by upcoming paginated query shapes.
pkg/app/ops/firestoreindexensurer/indexes_test.go Updates test fixture expectations for the expanded index list (and currently changes the file’s copyright year).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/app/ops/firestoreindexensurer/indexes_test.go Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: srinivas <148582479+srinivasr@users.noreply.github.com>
@srinivasr

Copy link
Copy Markdown
Contributor Author

@khanhtc1202 @yashisrani ci is green on this one. it just adds the firestore indexes needed for the pagination pr (#7234). let me know if anything else is needed here.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.88%. Comparing base (959e38b) to head (a04a8d6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7274      +/-   ##
==========================================
+ Coverage   29.75%   29.88%   +0.13%     
==========================================
  Files         601      591      -10     
  Lines       64442    63490     -952     
==========================================
- Hits        19172    18973     -199     
+ Misses      43778    43047     -731     
+ Partials     1492     1470      -22     
Flag Coverage Δ
. 23.58% <ø> (ø)
.-pkg-app-pipedv1-plugin-analysis 32.16% <ø> (ø)
.-pkg-app-pipedv1-plugin-ecs 33.64% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes 58.39% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 59.62% <ø> (ø)
.-pkg-app-pipedv1-plugin-scriptrun 54.83% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform 38.46% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait ?
.-pkg-app-pipedv1-plugin-waitapproval 52.71% <ø> (ø)
.-pkg-plugin-sdk 50.12% <ø> (ø)
.-tool-actions-gh-release ?
.-tool-actions-plan-preview 25.51% <ø> (ø)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants