-
Notifications
You must be signed in to change notification settings - Fork 45
Address slack feeback regarding dates backfill #4871
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
Address slack feeback regarding dates backfill #4871
Conversation
Signed-off-by: Lukasz Gryglicki <[email protected]> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
WalkthroughThis change introduces approximate date fields ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
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.
Pull Request Overview
This PR addresses Slack feedback regarding timestamp backfill by removing the ability to use current time for missing dates and introducing separate "approximate" fields for Fivetran-sourced timestamps.
Key Changes
- Removed
ALLOW_CURRENT_TIMEenvironment variable and thefinalNowFix()function that populated missing dates with current time - Introduced
approx_date_createdandapprox_date_modifiedfields to store timestamps sourced from Fivetran sync data (which are approximate) - Updated statistics tracking and reporting to separately count updates to regular vs. approximate date fields
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cla-backend-go/signatures_timestamp_backfill_prod.sh |
Removed ALLOW_CURRENT_TIME environment variable from production script |
cla-backend-go/signatures_timestamp_backfill_dev.sh |
Removed ALLOW_CURRENT_TIME environment variable from development script |
cla-backend-go/cmd/signatures_timestamp_backfill/main.go |
Removed finalNowFix() function and labelNow constant; added approx date fields to data model, update logic, and statistics; enhanced CLI fallback file with copyright header |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
cla-backend-go/cmd/signatures_timestamp_backfill/main.go (2)
52-52: Consider aligning the condition expression with the scan’s NULL handlingThe scan filter treats
AttributeType(..., "NULL")as “missing”, butcondAnyMissingonly checksattribute_not_existsor empty string. Rows withdate_created/date_modifiedstored as DynamoDB NULL will match the scan but fail the condition, ending up in CLI fallbacks instead of being auto-fixed.You may want to extend
condAnyMissingto mirror the scan predicate (including theAttributeType(..., "NULL")checks) so the condition gate and the scan are consistent.Also applies to: 270-280
605-612: Verify intended behavior for approx vs real fields in the Snowflake/Fivetran pathThe Snowflake pass now:
- Always exposes both real and approx names in
names, and- Writes to
approx_*only whensrcC/srcM == labelFivetranSynced, otherwise to the realdate_*fields, with stats routed toApprox*vsCreated/Modifiedaccordingly.One subtle case to double‑check: when both created and modified are missing and
_FIVETRAN_SYNCEDis the only source,newCcomes from Fivetran, andnewMis then derived “from_created”, sosrcC == labelFivetranSyncedbutsrcM == labelFromCreated. This means you’ll setapprox_date_createdbut the realdate_modified, andApproxModifiedstats won’t be incremented. If the product expectation is that both created and modified are considered approximate whenever they ultimately come from Fivetran, you may want to treat this “from_created but created itself is Fivetran-based” case as approximate too.Also applies to: 618-625, 632-660
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
cla-backend-go/cmd/signatures_timestamp_backfill/main.go(8 hunks)cla-backend-go/signatures_timestamp_backfill_dev.sh(1 hunks)cla-backend-go/signatures_timestamp_backfill_prod.sh(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: CodeQL analysis (go)
- GitHub Check: Agent
- GitHub Check: cypress-functional
- GitHub Check: build-test-lint
🔇 Additional comments (5)
cla-backend-go/signatures_timestamp_backfill_dev.sh (1)
5-5: Dev backfill invocation looks consistent with main.go expectationsThe env wiring (DEBUG=true, STAGE=dev, DRY_RUN=true) and removal of
ALLOW_CURRENT_TIMEalign cleanly withmain()’s env handling; no functional issues from this change.cla-backend-go/signatures_timestamp_backfill_prod.sh (1)
5-6: Prod script env flags are coherent and match Go helper semanticsUsing
DEBUG=''/DEBUG=trueandDRY_RUN=true/DRY_RUN=''lines up withgetEnvBool(only truthy strings enable flags), and removingALLOW_CURRENT_TIMEis consistent with the updated Go logic.cla-backend-go/cmd/signatures_timestamp_backfill/main.go (3)
37-40: Approximate date fields and stats wiring are internally consistentThe introduction of
approx_date_created/approx_date_modified(constants + struct fields), the parallelApproxCreated/ApproxModifiedcounters, and the extendedprintStatsoutput form a coherent model: updates in Snowflake paths can cleanly distinguish exact vs approximate sources, and stats are initialized correctly vianewStats()so no nil-map panics in current usage.Also applies to: 46-52, 93-99, 111-124, 1125-1126
155-155: Nice: clearer startup logging and self‑contained fallback script headerIncluding
DEBUGin the startup banner and emitting a full shebang +set -euo pipefail+ license header into the fallback CLI file makes it much easier and safer to run the generated script directly in incident/debug scenarios.Also applies to: 182-192
1080-1085: CLI builder correctly propagates approx_ values and default names*Extending
buildAwsCliUpdateto include:approx_date_created/:approx_date_modifiedinvalsFlatand updating the fallback names JSON keeps the generated AWS CLI commands in sync with the new attributes; even if JSON marshaling fails, the hardcoded names now cover both exact and approximate fields.Also applies to: 1093-1094
This PR addresses slack feedback regarding creation/modification dates backfill.
cc @mlehotskylf @dealako @ahmedomosanya
Signed-off-by: Lukasz Gryglicki [email protected]
Assisted by OpenAI
Assisted by GitHub Copilot