Skip to content
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

feat(select source sync time): Select source time of day anchor #29284

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

phixMe
Copy link
Contributor

@phixMe phixMe commented Feb 27, 2025

Problem

Users cannot change the time of day that a source updates at. This PR introduces a change to temporal schedules to make them Calendar based iff the interval exceeds 1 hour.

There are some nuances here to consider. Our backend is storing the time in UTC and the time selected is the first time of the day in UTC that the schedule will run. We also do not have jitter for tasks that are scheduled at midnight UTC since we theoretically are distributing our load much better than before when a user selects a time of day manually.

image

Changes

  • Migrates a new column
  • Update UI for pre and post creation of source
  • Add test

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Temporal schedules updated, added unit test

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

6 snapshot changes in total. 0 added, 6 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@phixMe phixMe marked this pull request as ready for review February 28, 2025 18:38
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds a feature allowing users to select the time of day for source data synchronization in the data warehouse.

  • Added sync_time_of_day TimeField to ExternalDataSchema model with migration 0677
  • Implemented UI controls in SchemaForm.tsx and Schemas.tsx to toggle between UTC/local time display
  • Added time selection functionality in source creation wizard via sourceWizardLogic.tsx
  • Modified service.py to use calendar-based scheduling for frequencies over an hour, respecting the selected sync time
  • Added test case test_update_schema_sync_time_of_day to verify the API endpoint and workflow triggering

12 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings | Greptile

# Conflicts:
#	frontend/__snapshots__/replay-player-failure--recent-recordings-404--dark.png
#	frontend/__snapshots__/replay-player-failure--recent-recordings-404--light.png
#	frontend/__snapshots__/replay-player-success--recent-recordings--dark.png
#	frontend/__snapshots__/replay-player-success--recent-recordings--light.png
#	frontend/__snapshots__/replay-player-success--second-recording-in-list--dark.png
#	frontend/__snapshots__/replay-player-success--second-recording-in-list--light.png
#	posthog/migrations/max_migration.txt
Copy link
Contributor

github-actions bot commented Feb 28, 2025

Size Change: +312 B (0%)

Total Size: 9.73 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 9.73 MB +312 B (0%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

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.

2 participants