mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
fixes cf-795
## Description
- **Description of PR**:
Added a new cron job inside the Express server that runs every day at
midnight (UTC).
This cron job is responsible for syncing organizations, repositories,
and member access.
It fetches all installations, retrieves members, and applies the
required access logic.
The job logs the **start time**, **end time**, **duration**, and
**status** (success or failure),
and sends a detailed summary email via **Resend** to **Saurabh**, with
**CC** to **Hesham** and **Sarthak**
(additional recipients can be added as needed).
---
## Testing
- **Manual Testing**:
**Steps to test locally:**
1. Connect to your local database.
2. Reduce the cron interval to **5 minutes** for faster testing.
3. Wait for the cron job to trigger.
4. After it finishes, verify that **organizations**, **repositories**,
and **users** are synced correctly.
5. Check your email for the **success summary message**.
6. Run **cf-webapp** and verify your membership in the **Codeflash**
org.
7. In the database:
- Add yourself as a **member** of another org.
- change your role in Codeflash org .
8. Wait for the next cron execution — you should be **removed** from the
other org and reverted your role in Codeflash.
9. Throw a **custom error** to verify that the email correctly reports
all details (start time, end time, duration, and failure reason).
---
Note:
we need to review this PR carefully
---------
Co-authored-by: mohammed ahmed <64513301+mohammedahmed18@users.noreply.github.com>
Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| setup-org.ts | ||
| setup-stripe.ts | ||