Skip to content

fix(slack-ingestor): detect lookback_days config changes and trigger full re-ingestion#1035

Merged
sriaradhyula merged 1 commit intomainfrom
fix/slack-ingestor-lookback-days-change-detection
Mar 24, 2026
Merged

fix(slack-ingestor): detect lookback_days config changes and trigger full re-ingestion#1035
sriaradhyula merged 1 commit intomainfrom
fix/slack-ingestor-lookback-days-change-detection

Conversation

@kevkantes
Copy link
Copy Markdown
Collaborator

Description

When lookback_days is changed in the Slack ingestor config (e.g., 7→14 or 14→7), the change had no effect because the ingestor always used the stored last_ts for incremental sync after the first run.

This fix compares the stored lookback_days (already saved in datasource metadata) against the current config value on each sync cycle. If they differ, last_ts is reset to None, forcing a full re-fetch with the new lookback window. Documents are upserted (no destructive delete), so there is zero downtime during re-ingestion. For decreases (14→7), old documents outside the new window age out naturally via fresh_until.

Changes:

  • slack/ingestor.py: Build a stored_lookback_map from existing datasource metadata and compare against current config before fetching. Reset last_ts on mismatch.
  • tests/slack/test_lookback_days.py: 5 tests covering unchanged, increased, decreased, first sync, and legacy (no stored lookback_days) scenarios.

Type of Change

  • Bugfix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@github-actions
Copy link
Copy Markdown
Contributor

✅ No proprietary content detected. This PR is clear for review!

…full re-ingestion

Signed-off-by: Kevin Kantesaria <kkantesaria@splunk.com>
@github-actions
Copy link
Copy Markdown
Contributor

📊 Test Coverage Report

Main Tests Coverage

Metric Coverage Details
Lines 39.9% 7495/18790 lines
Branches 0.0% 0/0 branches

📁 Coverage Artifacts

  • Main tests: coverage-reports-main artifact
  • RAG tests: coverage-reports-rag artifact (not available)
  • Download artifacts to view detailed HTML coverage reports

@kevkantes kevkantes force-pushed the fix/slack-ingestor-lookback-days-change-detection branch from d21a707 to 337e314 Compare March 23, 2026 19:17
@github-actions
Copy link
Copy Markdown
Contributor

✅ No proprietary content detected. This PR is clear for review!

@github-actions
Copy link
Copy Markdown
Contributor

📊 Test Coverage Report

Main Tests Coverage

Metric Coverage Details
Lines 39.9% 7495/18790 lines
Branches 0.0% 0/0 branches

📁 Coverage Artifacts

  • Main tests: coverage-reports-main artifact
  • RAG tests: coverage-reports-rag artifact (not available)
  • Download artifacts to view detailed HTML coverage reports

@sriaradhyula sriaradhyula merged commit 3bfd98b into main Mar 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants