-
Notifications
You must be signed in to change notification settings - Fork 4
fix(booking): lifecycle correctness — cancelled-event CAS, class partial reschedule, cleanup guards, utilization re-key, reminder scheduler #1002
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: Send Appointment Reminders | ||
|
|
||
| on: | ||
| schedule: | ||
| # Hourly — the 1-hour reminder window (45–75 min before start) assumes | ||
| # at-least-hourly firing; Redis SET-NX in the script dedupes overlaps. | ||
| - cron: "12 * * * *" | ||
| workflow_dispatch: # Allow manual triggering | ||
|
|
||
| jobs: | ||
| send-appointment-reminders: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| env: | ||
| # Database connection (required for Prisma) | ||
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | ||
| # #476 cron locks load lib/redis at import — every job entry needs these | ||
| UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }} | ||
| UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }} | ||
| DIRECT_URL: ${{ secrets.DIRECT_URL }} | ||
| # Reminder notifications fan out through Novu; links built via getAppUrl | ||
| NOVU_SECRET_KEY: ${{ secrets.NOVU_SECRET_KEY }} | ||
| NEXT_PUBLIC_APP_URL: ${{ secrets.NEXT_PUBLIC_APP_URL }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: "22" | ||
| cache: "npm" | ||
|
Comment on lines
+27
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Secure Action references and checkout credentials. To mitigate supply chain risks and address static analysis errors/warnings:
As per static analysis hints, actions are not pinned to a hash, and there is credential persistence through GitHub Actions artifacts because 🔒 Proposed fixes for action references - name: Checkout code
- uses: actions/checkout@v5
+ uses: actions/checkout@<commit-sha> # e.g., actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ persist-credentials: false
- name: Setup Node.js
- uses: actions/setup-node@v5
+ uses: actions/setup-node@<commit-sha>
with:
node-version: "22"
cache: "npm"🧰 Tools🪛 zizmor (1.26.1)[warning] 27-28: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 28-28: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 31-31: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Secure Action references and checkout credentials. To mitigate supply chain risks and address static analysis errors/warnings:
As per static analysis hints, actions are not pinned to a hash, and there is credential persistence through GitHub Actions artifacts because 🔒 Proposed fixes for action references - name: Checkout code
- uses: actions/checkout@v5
+ uses: actions/checkout@<commit-sha> # e.g., actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ with:
+ persist-credentials: false
- name: Setup Node.js
- uses: actions/setup-node@v5
+ uses: actions/setup-node@<commit-sha>
with:
node-version: "22"
cache: "npm"🧰 Tools🪛 zizmor (1.26.1)[warning] 27-28: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 28-28: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [error] 31-31: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Generate Prisma client | ||
| run: npx prisma generate | ||
|
|
||
| - name: Send appointment reminders | ||
| run: npx tsx jobs/appointments/send-appointment-reminders.ts | ||
|
|
||
| - name: Notify on failure | ||
| if: failure() | ||
| env: | ||
| SLACK_OPS_WEBHOOK_URL: ${{ secrets.SLACK_OPS_WEBHOOK_URL }} | ||
| run: bash scripts/ci/notify-ops-failure.sh "send-appointment-reminders" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Restrict workflow permissions and prevent concurrent executions.
Address static analysis warnings and follow best practices by making these workflow-level improvements:
permissions: contents: readto adhere to the principle of least privilege.concurrencygroup to prevent overlapping workflow runs (which complements your RedisSET-NXlock).nameto the job for better display in the GitHub Actions UI.As per static analysis hints, the workflow defaults to overly broad permissions, lacks job-level concurrency limits, and contains a job definition without a name.
🔒 Proposed fixes for workflow definition
📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.26.1)
[info] 11-11: workflow or action definition without a name (anonymous-definition): this job
(anonymous-definition)
🤖 Prompt for AI Agents
Source: Linters/SAST tools
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Restrict workflow permissions and prevent concurrent executions.
Address static analysis warnings and follow best practices by making these workflow-level improvements:
permissions: contents: readto adhere to the principle of least privilege.concurrencygroup to prevent overlapping workflow runs (which complements your RedisSET-NXlock).nameto the job for better display in the GitHub Actions UI.As per static analysis hints, the workflow defaults to overly broad permissions, lacks job-level concurrency limits, and contains a job definition without a name.
🔒 Proposed fixes for workflow definition
📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.26.1)
[info] 11-11: workflow or action definition without a name (anonymous-definition): this job
(anonymous-definition)
🤖 Prompt for AI Agents
Source: Linters/SAST tools