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

CLI - Confirm before publishing to non-local servers #2086

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

bfops
Copy link
Collaborator

@bfops bfops commented Jan 3, 2025

Description of Changes

When publishing to a server besides localhost or 127.0.0.1, prompt for confirmation.

API and ABI breaking changes

Yes; this technically breaks the CLI API for publishing to non-local servers.

Expected complexity level and risk

1

Testing

  • Publishing to testnet prompts for confirmation; saying no exits
$ "$WORK"/SpacetimeDBPrivate/public/target/debug/spacetime publish -s testnet
checking crate with spacetimedb's clippy configuration
    Checking spacetime-module v0.1.0 (/mnt/nutera/work/my_new_project)
    Finished `release` profile [optimized] target(s) in 0.14s
    Finished `release` profile [optimized] target(s) in 0.11s
Optimising module with wasm-opt...
Could not find wasm-opt to optimise the module.
For best performance install wasm-opt from https://github.com/WebAssembly/binaryen/releases.
Continuing with unoptimised module.
Build finished successfully.
You are about to publish to a non-local server: testnet.spacetimedb.com
Are you sure you want to proceed with publishing to testnet.spacetimedb.com? [y/N]N
Aborting
  • Publishing to testnet prompts for confirmation; saying yes proceeds
$ "$WORK"/SpacetimeDBPrivate/public/target/debug/spacetime publish -s testnet
checking crate with spacetimedb's clippy configuration
    Checking spacetime-module v0.1.0 (/mnt/nutera/work/my_new_project)
    Finished `release` profile [optimized] target(s) in 0.14s
    Finished `release` profile [optimized] target(s) in 0.07s
Optimising module with wasm-opt...
Could not find wasm-opt to optimise the module.
For best performance install wasm-opt from https://github.com/WebAssembly/binaryen/releases.
Continuing with unoptimised module.
Build finished successfully.
You are about to publish to a non-local server: testnet.spacetimedb.com
Are you sure you want to proceed with publishing to testnet.spacetimedb.com? [y/N]y
Uploading to testnet => https://testnet.spacetimedb.com
Publishing module...
Created new database with identity: c20021c74f423a19aedc5fef2ab5adc66b4b5a556a031ee15c56e5ab6ff2f381
  • Publishing to local does not prompt for confirmation
$ "$WORK"/SpacetimeDBPrivate/public/target/debug/spacetime publish -s local
checking crate with spacetimedb's clippy configuration
    Checking spacetime-module v0.1.0 (/mnt/nutera/work/my_new_project)
    Finished `release` profile [optimized] target(s) in 0.14s
    Finished `release` profile [optimized] target(s) in 0.07s
Optimising module with wasm-opt...
Could not find wasm-opt to optimise the module.
For best performance install wasm-opt from https://github.com/WebAssembly/binaryen/releases.
Continuing with unoptimised module.
Build finished successfully.
Uploading to local => http://127.0.0.1:3000
Publishing module...
Created new database with identity: c2004b18ef1e1a3240db78883f52a588b1bb9ccd80692b8b1cccc913f32203ab

@bfops bfops added release-any To be landed in any release window CLI only This change only affects the CLI behavior api-break A PR that makes an API breaking change labels Jan 3, 2025
@bfops bfops marked this pull request as ready for review January 3, 2025 17:45
@bfops bfops requested a review from cloutiertyler as a code owner January 3, 2025 17:45
@bfops bfops linked an issue Jan 3, 2025 that may be closed by this pull request
3 tasks
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

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

Looks great to me!

@bfops bfops added this pull request to the merge queue Jan 3, 2025
Merged via the queue into master with commit 74d191f Jan 3, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-break A PR that makes an API breaking change CLI only This change only affects the CLI behavior release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI - Confirm when publishing to servers that are not local
2 participants