-
Notifications
You must be signed in to change notification settings - Fork 7
Disable backfills from the main branch #1184
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds a guard in submit_workflow to raise ValueError when attempting BACKFILL on the main branch, placed after repo hash/branch resolution and before compute_and_upload_diffs. No other logic changes. Changes
Sequence Diagram(s)sequenceDiagram
participant U as Caller
participant HR as HubRunner.submit_workflow
participant G as Git/Repo
participant D as compute_and_upload_diffs
U->>HR: submit_workflow(mode)
HR->>G: compute local repo hash map
HR->>G: get current branch
alt branch == "main" and mode == BACKFILL
HR-->>U: raise ValueError (short-circuit)
else
HR->>D: compute_and_upload_diffs(...)
D-->>HR: result
HR-->>U: continue workflow
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
python/src/ai/chronon/repo/hub_runner.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
python/src/ai/chronon/repo/hub_runner.py (1)
python/src/ai/chronon/repo/constants.py (1)
RunMode(4-31)
⏰ 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). (1)
- GitHub Check: enforce_triggered_workflows
| if branch == "main" and mode == RunMode.BACKFILL.value: | ||
| raise ValueError("Backfilling from the main branch is not allowed. Please switch to a feature branch.") | ||
|
|
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.
Guard blocks CI backfills.
CI runs the same CLI on branch main with RunMode.BACKFILL; this unconditional raise breaks that flow despite the stated exception. Please gate the guard (e.g., skip when os.environ.get("CI") == "true" or similar) so CI remains functional.
🤖 Prompt for AI Agents
In python/src/ai/chronon/repo/hub_runner.py around lines 67 to 69, the
unconditional ValueError blocking backfills from branch "main" breaks CI which
runs backfill on main; change the guard to skip raising when running in CI by
checking an environment flag (e.g., os.environ.get("CI") in ("true","1") or
lower-cased) so CI remains functional, and add an import for os at the top if
it’s not already imported.
| conf_name_to_hash_dict = hub_uploader.build_local_repo_hashmap(root_dir=repo) | ||
| branch = get_current_branch() | ||
|
|
||
| if branch == "main" and mode == RunMode.BACKFILL.value: |
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.
maybe also block deploys unless there's a flag or such indicating we're in 'ci'?
Summary
^^^
Do not want users to accidentally backfill from the main branch as that will do a branch "sync" and can disrupt any other schedules or deploys on main to be disrupted.
We will though need to allow for "CI" to be able to run off of main though.
Checklist
Summary by CodeRabbit