Skip to content

feat: add configurable repository digest alerts - #47

Open
arnabnandy7 wants to merge 1 commit into
mainfrom
feature/weeklyDigest
Open

feat: add configurable repository digest alerts#47
arnabnandy7 wants to merge 1 commit into
mainfrom
feature/weeklyDigest

Conversation

@arnabnandy7

Copy link
Copy Markdown
Owner

Summary

Implements configurable email digests for saved searches and repository alerts.

Closes #18
Closes #14

Changes

  • Generate weekly recommendations from saved searches.
  • Include top issues, repositories, and GitHub activity trends.
  • Send digests through Gmail SMTP.
  • Allow users to enable or disable weekly digests.
  • Add authenticated manual digest delivery.
  • Add editable repository-alert templates.
  • Provide GitHub repository autocomplete.
  • Allow up to five repositories per template.
  • Include the five most recently created issues from each repository.
  • Include issue summaries, labels, dates, assignment status, comments, and direct links.
  • Support daily, weekly, and fortnightly repository alerts.
  • Skip repository-only emails when issue results are unchanged.
  • Persist delivery snapshots and independent repository-alert schedules.
  • Add Vercel cron configuration and setup documentation.

Database migrations

  • 0003_weekly_digest.sql
  • 0004_repository_digest.sql
  • 0005_repository_digest_frequency.sql

The migrations add:

  • Weekly digest preferences and delivery timestamps.
  • GitHub activity trend snapshots.
  • Repository-alert templates and selected repositories.
  • Last-delivered issue IDs for unchanged-result detection.
  • Repository-alert frequency and delivery timestamps.

Configuration

Required production environment variables:

  • CRON_SECRET
  • SMTP_USER
  • SMTP_APP_PASSWORD
  • DIGEST_FROM_EMAIL

The Vercel cron runs daily at 09:00 UTC. Saved-search digests remain restricted to Mondays, while repository alerts follow the user-selected frequency.

Verification

  • TypeScript checks passed.
  • Scoped ESLint checks passed.
  • Diff validation passed.
  • Focused digest, scheduling, GitHub search, cron, API, and UI tests passed.
  • No full build, complete test suite, or coverage run was performed.

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openissue-dev Ready Ready Preview Aug 24, 2026 8:00pm

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7272d1de6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

weeklyDigestLastSentAt: user.weeklyDigestLastSentAt,
})
.from(user)
.where(eq(user.weeklyDigestEnabled, true));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Process enabled repository alerts independently

If a user keeps an enabled repository-alert template but turns off the separate weekly digest preference, PATCH /api/digest-preference sets this flag to false without disabling the template. This query then excludes the user before getRepositoryAlertSchedule runs, so their daily, weekly, or fortnightly repository alerts silently stop. Include users with enabled repository templates in the cron recipient set rather than filtering exclusively on the weekly preference.

Useful? React with 👍 / 👎.

Comment on lines +135 to +139
if (input.enabled) {
await database
.update(user)
.set({ weeklyDigestEnabled: true })
.where(eq(user.id, session.user.id));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the weekly-digest opt-in when saving alerts

Saving any enabled repository template—including the default template with no repositories—silently changes the separate weekly digest preference to true. On Monday the cron consequently includes saved-search recommendations, so a user who disabled or never enabled that digest can receive an unrelated weekly email; disabling repository alerts later also leaves this preference enabled. Repository-alert enrollment should not overwrite the saved-search digest opt-in.

Useful? React with 👍 / 👎.

const url = new URL("https://api.github.com/search/issues");
url.searchParams.set(
"q",
`repo:${repositoryFullName} is:issue`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict repository digest searches to open issues

When a repository's newest issues include closed tickets, this query returns them because it has no state qualifier; closed tickets can also occupy the five-result limit and hide older open issues. The resulting email therefore presents closed work as current opportunities despite the digest's open-issue messaging. Add is:open to the repository issue query.

Useful? React with 👍 / 👎.

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

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

Weekly digest Email alerts

1 participant