Skip to content

chore(deploy): add 'indexes' subcommand to gcp-deploy.sh#140

Draft
dev-mansonthomas wants to merge 1 commit into
masterfrom
chore/firestore-indexes-deploy
Draft

chore(deploy): add 'indexes' subcommand to gcp-deploy.sh#140
dev-mansonthomas wants to merge 1 commit into
masterfrom
chore/firestore-indexes-deploy

Conversation

@dev-mansonthomas
Copy link
Copy Markdown
Owner

Context

firestore.indexes.json was already the source of truth but was never deployed: the standard gcp-deploy.sh deliberately excludes firestore:indexes to avoid silent destructive prompts on missing entries.

As a result, the two composite indexes on ul_queteur_stats_per_year required by the Cloud Functions get-queteur-stats and get-ul-queteur-ranking were absent from rq-fr-prod, causing a 400 The query requires an index on the Mon historique page (regression introduced when those endpoints migrated to Cloud Functions v2 in #130).

Change

Add a dedicated subcommand:

./gcp-deploy.sh fr <env> indexes

It runs firebase deploy --only firestore:indexes --non-interactive --force so the JSON file is reconciled with the server without prompting (applies creations and deletions). To be run after every change to firestore.indexes.json on each environment.

Doc

New section 12 in docs/cloud-functions-endpoints.md:

  • Index catalogue (each index mapped to its Cloud Function + Angular consumer)
  • Deploy procedure
  • Add-new-index workflow

Deployment status

Already run on the three environments via the new subcommand. Verified READY state on rq-fr-prod:

NAME          FIELD_PATH                               STATE
CICAgNiroIEK  ['queteur_id', 'year', '__name__']       READY
CICAgJjFqZMK  ['ul_id', 'year', 'amount', '__name__']  READY

The Mon historique page is now functional in production.

Scope

This PR is intentionally limited to the deployment tooling + indexes. The timezone fix (fix/timezone-utc-iso) is shipped separately.


Pull Request opened by Augment Code with guidance from the PR author

firestore.indexes.json was already the source of truth but was never
deployed: the standard deploy excludes firestore:indexes to avoid silent
destructive prompts on missing entries. As a result, the two composite
indexes on ul_queteur_stats_per_year required by get-queteur-stats and
get-ul-queteur-ranking were absent from rq-fr-prod, causing
'400 The query requires an index' on the 'Mon historique' page.

Add a dedicated subcommand:
  ./gcp-deploy.sh fr <env> indexes

It calls firebase deploy --only firestore:indexes --non-interactive
--force so the JSON is reconciled with the server without prompting
(creations AND deletions). Run after every change to
firestore.indexes.json on each environment.

Documented in docs/cloud-functions-endpoints.md section 12 (index
catalogue mapping each index to its cloud function and Angular
consumer, plus deploy procedure and add-new-index workflow).

Indexes deployed on the three environments via this c
firestore.indexes.json was already the source of truth but was never
>&1deployed: th
git commit -F .git/COMMIT_MSG_INDEXES.txt 2>&1 && rm .git/COMMIT_MSG_INDEXES.txt

git status --short && git log --oneline -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant