Add scheduled Firebase Cloud Function to delete old export status documents#131
Add scheduled Firebase Cloud Function to delete old export status documents#131kunalkeshan merged 7 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: kunalkeshan <68579547+kunalkeshan@users.noreply.github.com>
|
@copilot check codebase and add relevant documentation for this for future updates. |
Co-authored-by: kunalkeshan <68579547+kunalkeshan@users.noreply.github.com>
Added documentation in commit 6e60991:
The documentation includes guides for adding new functions, useful commands, and links to Firebase references. |
There was a problem hiding this comment.
Pull request overview
This PR adds a scheduled Firebase Cloud Function that automatically deletes export status documents older than 2 days from Firestore. The implementation includes comprehensive logging, batch processing for performance, and proper error handling.
Key changes:
- Scheduled function running every 24 hours to clean up old export status documents
- Date parsing from document IDs in format "day-mon-dd-yyyy"
- Batch processing with configurable concurrency (10 concurrent deletes)
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| functions/src/index.ts | Core Cloud Function implementation with date parsing and batch deletion logic |
| functions/package.json | Dependencies and npm scripts for Firebase Functions |
| functions/tsconfig.json | TypeScript compiler configuration for ES2017 target |
| functions/.eslintrc.js | ESLint configuration with TypeScript plugin |
| functions/.gitignore | Ignores compiled lib directory and debug logs |
| functions/README.md | Comprehensive documentation for development and deployment |
| firebase.json | Firebase project configuration with predeploy hooks |
| .firebaserc | Links to "mind-check-app" Firebase project |
| .gitignore | Excludes Firebase artifacts and functions/lib directory |
| CONTRIBUTING.md | Updated with Firebase Cloud Functions setup instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: kunalkeshan <68579547+kunalkeshan@users.noreply.github.com>
functions/directory with TypeScript configurationfunctions/package.jsonwith firebase-admin and firebase-functions dependenciesfunctions/tsconfig.jsonfor TypeScript compilationfunctions/.eslintrc.jsfor linting0 0 * * *firebase.jsonwith functions configuration.firebaserclinking to "mind-check-app" project.gitignorefor Firebase artifactsfunctions/README.mdwith setup, development, deployment, and troubleshooting guidesCONTRIBUTING.mdwith Firebase Cloud Functions section0 0 * * *for predictable midnight UTC executionOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.