Skip to content

feat: enrich zetkin data sources nightly#428

Merged
joaquimds merged 2 commits intomainfrom
feat/enrich-zetkin-nightly
Apr 28, 2026
Merged

feat: enrich zetkin data sources nightly#428
joaquimds merged 2 commits intomainfrom
feat/enrich-zetkin-nightly

Conversation

@joaquimds
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds nightly enrichment scheduling for Zetkin-backed data sources by enqueueing an enrichDataSource job after the nightly Zetkin import job is enqueued.

Changes:

  • After enqueueing importDataSource for each Zetkin data source, conditionally enqueue enrichDataSource when the data source has enrichments configured.
  • Add warning logging if the enrichment job cannot be enqueued.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +20 to +24
if (source.enrichments.length > 0) {
try {
await enqueue("enrichDataSource", source.id, {
dataSourceId: source.id,
});
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The new enrichment enqueue bypasses the autoEnrich flag on the data source. As written, any Zetkin source with enrichments.length > 0 will get an enrichDataSource job every night even if the user has disabled automatic enrichment. Consider including source.autoEnrich in the condition (or otherwise documenting/encoding why Zetkin should ignore that setting).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed in 4011ba7 — the condition now checks source.autoEnrich && source.enrichments.length > 0 so the nightly enrichment job is only enqueued when automatic enrichment is enabled.

Comment on lines +20 to +24
if (source.enrichments.length > 0) {
try {
await enqueue("enrichDataSource", source.id, {
dataSourceId: source.id,
});
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

This change adds new behavior (conditionally enqueueing enrichDataSource) but there are no tests covering importZetkinDataSources. Since other job modules have automated tests (e.g. tests/feature/importDataSource.test.ts, tests/feature/enrichDataSource.test.ts), consider adding a unit/feature test that verifies enqueue() is called for enrichment only for sources that should be enriched (and that enqueue failures are handled as expected).

Copilot uses AI. Check for mistakes.
@joaquimds joaquimds merged commit c919ef8 into main Apr 28, 2026
@joaquimds joaquimds deleted the feat/enrich-zetkin-nightly branch April 28, 2026 11:19
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.

3 participants