Skip to content

feat(cli): add --override-protected option - #2464

Open
Ford544 wants to merge 4 commits into
mainfrom
force-refresh
Open

Ford544 wants to merge 4 commits into
mainfrom
force-refresh

Conversation

@Ford544

@Ford544 Ford544 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Allow users to recreate protected incremental tables without having to set protected=false on every action (e.g. for local/sandbox backfills) by passing the --override-protected flag.

With --full-refresh and --override-protected, all incremental tables, including protected ones, will be recreated. --override-protected without --full-refresh throws an error.

A warning will be printed (including on dry runs) when running with --override-protected --full-refresh listing the protected tables that would be dropped, to remind users of the risks of data loss.

@Ford544
Ford544 marked this pull request as ready for review November 19, 2026 16:10
@Ford544
Ford544 requested a review from a team as a code owner November 19, 2026 16:10
},
};

export const overrideProtectedOption: INamedOption<yargs.Options, IRunArgs> = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since protected defaults to true, run --full-refresh --override-protected without --actions/--tags recreates every incremental table in the project, including ones whose history can't be rebuilt (e.g. sources with limited retention). Would it be worth adding a guardrail here, e.g. requiring --actions or --tags alongside this flag, or at least printing a warning listing the protected tables that will be recreated (in --dry-run too)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think requiring --actions or --tags could be cumbersome for users wanting to quickly recreate a large project (e.g. during testing/initial iterating/in sandbox environments). It's true that this is a risky operation but since it requires explicitly passing two different options I think that's acceptable.

I can add a warning though - this will remind users who use a dry run about potential consequences, though it won't stop accidentally purging data in real runs.

Comment thread cli/commands/run_options.ts Resolved
Comment thread cli/README.md Resolved
Comment thread cli/README.md Resolved
Comment thread protos/execution.proto Resolved
Comment thread core/README.md Resolved
@Ford544
Ford544 force-pushed the force-refresh branch 2 times, most recently from a5231ba to 17ae218 Compare November 20, 2026 09:39

@rafal-hawrylak rafal-hawrylak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The description does not mention the warning that was added during review.

Comment thread core/README.md Resolved
Comment thread cli/tests/run_command_test.ts Resolved
Comment thread cli/commands/run_command.ts Resolved
Comment thread cli/BUILD Resolved
@Ford544
Ford544 force-pushed the force-refresh branch 2 times, most recently from 77a8b46 to bc9c00d Compare November 23, 2026 09:01
Comment thread cli/commands/run_command.ts Resolved
Comment thread cli/commands/run_command.ts Resolved
Comment thread cli/commands/run_command.ts Resolved
Comment thread cli/commands/run_command.ts Resolved
Comment thread cli/commands/run_options.ts Resolved

This branch has not been deployed

No deployments
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