Skip to content

Add dry-run via deploy=false connection property#235

Open
ryannedolan wants to merge 5 commits into
mainfrom
rdolan/dry-run
Open

Add dry-run via deploy=false connection property#235
ryannedolan wants to merge 5 commits into
mainfrom
rdolan/dry-run

Conversation

@ryannedolan

@ryannedolan ryannedolan commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • New deploy connection property: when deploy=false, each DDL statement is parsed, validated, and
    applied to the in-memory Calcite schema, but the underlying deployers are not invoked. Lets a session
    validate a multi-statement script end-to-end (later statements see earlier ones' in-memory effects)
    without external side-effects.
  • Orthogonal to mode: combine deploy=false with mode=apply to dry-run an apply-mode script.
  • Distinct from SPECIFY (!specify), which remains the strict zero-side-effect single-statement
    preview that still invokes deployer.specify() and unwinds the in-memory schema afterward. Dry-run
    preserves the in-memory mutation across statements and invokes no deployer method at all.

Details

  • HoptimatorDdlUtils.isDryRun(Connection) reads the deploy property (defaults to true/live).
  • DdlMode.CREATE and DdlMode.UPDATE branches gate the DeploymentService.create/update call on
    isDryRun; SPECIFY is unchanged. - Imperative non-CREATE DDL paths (DROP {TABLE, VIEW, MATERIALIZED VIEW, TRIGGER}, FIRE/PAUSE/RESUME TRIGGER) use inline if (!isDryRun(connection)) guards. These don't fit the DdlMode enum, which is
    about CREATE-statement semantics (strict vs. apply vs. preview).
  • CREATE VIEW and CREATE TRIGGER previously bypassed DdlMode.executeDeployers and called
    DeploymentService.create/update directly; routed through mode.executeDeployers to inherit the gating.

Testing Done

0: Hoptimator> create view bar as select * from foo;
INFO Validating statement: CREATE VIEW `BAR` AS
SELECT *
FROM `FOO`
INFO Validated sql statement. The view is named BAR and has path [DEFAULT, BAR]
INFO Validating deployable resources for view BAR
INFO Validated view BAR
INFO Dry-run (deploy=false): skipping UPDATE of view BAR
INFO Added view BAR to schema DEFAULT
INFO CREATE VIEW BAR completed
No rows affected (0.212 seconds)

Notice the "dry run ... skipping" message in the logs.

When deploy=false is set, each DDL statement is parsed, validated, and
applied to the in-memory Calcite schema, but the underlying deployers
are not invoked. This lets a session execute a multi-statement script
end-to-end — later statements see the in-memory effects of earlier ones
(CREATE TABLE FOO ... CREATE VIEW BAR AS SELECT * FROM FOO validates
correctly) — without producing any external side effects.

Orthogonal to mode: deploy=false + mode=apply dry-runs an apply-mode
script. Distinct from SPECIFY (!specify), which is the strict
zero-side-effect single-statement preview that still invokes
deployer.specify() and unwinds the in-memory schema afterward.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
At each deploy call site (CREATE VIEW, CREATE TRIGGER, CREATE
MV/TABLE/DATABASE, FIRE/PAUSE/RESUME/DROP TRIGGER, DROP {MV,VIEW,TABLE}),
emit "Dry-run (deploy=false): skipping <verb> of <kind> <name>" when in
dry-run mode and suppress the post-deploy "Deployed X" confirmation that
would otherwise lie. Previously dry-run silently skipped the deployer
call but the surrounding "Deploying ..." / "Deployed ..." logs still
claimed deployment, leaving no operational indication that the skip
happened.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

Code Coverage

Overall Project 84.15% -0.35% 🟢
Files changed 62.5% 🟢

File Coverage
HoptimatorDdlUtils.java 83.9% -1.89% 🟢
HoptimatorDdlExecutor.java 80.84% -6.17% 🟢

@jogrogan jogrogan 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.

LGTM!

Copilot AI added 3 commits June 18, 2026 15:09
The `kubectl wait kafka.kafka.strimzi.io/one --for=condition=Ready --timeout=10m`
was timing out in CI. Two changes to fix this:
1. Increase all Kafka/KafkaTopic wait timeouts from 10m to 15m
2. Reduce KafkaNodePool replicas from 3 to 1 (controller and broker)

The replication factors in kafka.yaml are already all set to 1, so 3 physical
nodes add resource overhead without benefit for testing. Fewer pods start faster
in the resource-constrained GitHub Actions Kind cluster.
- Extract `shouldSkipDeployment(DdlMode, Connection)` helper to eliminate
  the duplicated `mode.mutable() && isDryRun(conn)` expression across
  processCreateMaterializedView, processCreateTable, processCreateDatabase
- Add unit tests for the new helper covering all three cases
- Rename testIsDryRunExplicitTrueDeploys → testIsDryRunExplicitTrueReturnsFalse
- Rename testDdlModeSpecifyAlwaysCallsSpecifyEvenInDryRun → testDdlModeSpecifyIgnoresDryRunProperty
- Rename testIsDryRunExplicitTrueReturnsFalse → testIsDryRunReturnsFalseWhenDeployIsTrue
- Add cross-reference to sql-cli.md#specify-sql in the dry-run/!specify distinction note
Copilot AI changed the title Add dry-run mode for DDL via deploy=false connection property Fix CI: Kafka startup timeout in integration tests Jun 18, 2026
@ryannedolan ryannedolan changed the title Fix CI: Kafka startup timeout in integration tests Add dry-run via deploy=false connection property Jun 18, 2026
@ryannedolan

Copy link
Copy Markdown
Collaborator Author

Copilot fixed the build but clobbered the PR in the process. Sorry for the churn.

@ryannedolan ryannedolan requested a review from jogrogan June 18, 2026 18:37
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