Skip to content

Commit 46f66b6

Browse files
committed
0.15.0
1 parent 87c0803 commit 46f66b6

9 files changed

+5
-354
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.15.0 2024-05-07
4+
5+
* Address system is now used to replace StateIn/StatePaths, deploy now also works similar to before
6+
* A lot of the arguments for the CLI have been changed, so incompatible with 0.14. From now on follows the route to stabilization, as we are basically feature-complete
7+
38
## 0.14.0 2024-05-05
49

510
* Very large update that includes a complete rewrite, currently gated behind `tidploy next`. v1 should hopefully make this the default.

src/next/api.rs

-11
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ impl GlobalArguments {
5555
// }
5656
}
5757

58-
// impl From<GlobalArguments> for AddressIn {
59-
// fn from(value: GlobalArguments) -> Self {
60-
// Self::from_args(
61-
// value.cwd_context,
62-
// value.resolve_root,
63-
// value.state_path,
64-
// value.state_root,
65-
// )
66-
// }
67-
// }
68-
6958
impl From<GlobalArguments> for StateOptions {
7059
fn from(value: GlobalArguments) -> Self {
7160
let default = Self::default();

src/next/archives.rs

-35
This file was deleted.

src/next/commands.rs

-65
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@ pub struct NextSub {
1010
#[clap(subcommand)]
1111
pub subcommand: NextCommands,
1212

13-
// /// Contexts other than git-remote (default) are not fully supported.
14-
// #[arg(long, value_enum, global = true)]
15-
// context: Option<StateContext>,
16-
17-
// /// Set the repository URL, defaults to 'default_infer', in which case it is inferred from the current repository.
18-
// /// Set to 'default' to not set it.
19-
// /// Falls back to environment variable using TIDPLOY_REPO and then to config with key 'repo_url'
20-
// /// For infering, it looks at the URL set to the 'origin' remote.
21-
// #[arg(short, long, global = true)]
22-
// repo: Option<String>,
23-
24-
// /// The git reference (commit or tag) to use.
25-
// #[arg(short, long, global = true)]
26-
// tag: Option<String>,
27-
28-
// /// The path inside the repository that should be used as the primary config source.
29-
// #[arg(short, long, global = true)]
30-
// deploy_pth: Option<String>,
3113
/// Directory to start resolving from. Can either be an absolute path (this requires --cwd), or relative to
3214
/// the current directory or Git root dir
3315
#[arg(long = "resolve-root")]
@@ -96,19 +78,6 @@ pub enum NextCommands {
9678
#[arg(long = "repo")]
9779
repo: Option<String>,
9880
},
99-
// Address {
100-
// /// Location relative to resolve root where you want to begin reading configs. Defaults to be equal
101-
// /// to resolve root.
102-
// #[arg(long = "a-state-root")]
103-
// address_state_root: Option<String>,
104-
105-
// /// Location relative to state root to stop reading configs, inclusive.
106-
// #[arg(long = "a-state-path")]
107-
// address_state_path: Option<String>,
108-
109-
// #[clap(subcommand)]
110-
// subcommand: AddressSubCommands,
111-
// }
11281
}
11382

11483
#[derive(Subcommand, Debug)]
@@ -161,7 +130,6 @@ pub fn match_command(next_sub: NextSub, _cmd: Command) -> Result<ExitCode, Repor
161130
execution_path,
162131
variables,
163132
)?;
164-
// If [process::ExitCode::from_raw] gets stabilized this can be simplified
165133
let code = u8::try_from(out.exit.code().unwrap_or(0))?;
166134

167135
Ok(ExitCode::from(code))
@@ -190,38 +158,5 @@ pub fn match_command(next_sub: NextSub, _cmd: Command) -> Result<ExitCode, Repor
190158

191159
Ok(ExitCode::from(code))
192160
}
193-
// NextCommands::Address {
194-
// address_state_root,
195-
// address_state_path,
196-
// subcommand: addr_subcommands } => match addr_subcommands {
197-
// AddressSubCommands::Git {
198-
// url,
199-
// git_ref,
200-
// target_path
201-
// } => {
202-
// let addr_in = AddressIn::Git {
203-
// url,
204-
// git_ref,
205-
// target_path,
206-
// state_path: address_state_path,
207-
// state_root: address_state_root
208-
// };
209-
210-
// let state_in = StateIn::from_args(true, resolve_root, state_path, state_root);
211-
212-
// Ok(())
213-
// },
214-
// AddressSubCommands::Local { path } => {
215-
// let addr_in = AddressIn::Local {
216-
// path,
217-
// state_path: address_state_path,
218-
// state_root: address_state_root
219-
// };
220-
221-
// let state_in = StateIn::from_args(true, resolve_root, state_path, state_root);
222-
223-
// Ok(())
224-
// },
225-
// }
226161
}
227162
}

src/next/deploy.rs

-1
This file was deleted.

src/next/errors.rs

-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use std::io::Error as IOError;
33
use thiserror::Error as ThisError;
44
use tracing_error::TracedError;
55

6-
// use crate::filesystem::RelativePathError;
7-
86
#[derive(ThisError, Debug)]
97
pub(crate) enum SecretError {
108
#[error("Failed to get password from prompt! {0}")]
@@ -46,8 +44,6 @@ pub(crate) enum StateErrorKind {
4644
Config(#[from] ConfigError),
4745
#[error("{0}")]
4846
Address(#[from] AddressError),
49-
// #[error("{0}")]
50-
// RelativePath(#[from] RelativePathError)
5147
}
5248

5349
pub trait WrapStateErr<T, E> {

src/next/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pub mod api;
22
pub(crate) mod commands;
33
pub(crate) mod config;
4-
pub(crate) mod deploy;
54
pub(crate) mod errors;
65
pub(crate) mod fs;
76
pub(crate) mod git;

src/next/run.rs

-72
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ pub(crate) fn run_command_input_old_state(
8585
)
8686
.wrap_err("Create state error.")?;
8787

88-
// let state = extra_envs(state);
89-
9088
let relative_path = RelativePathBuf::from(&state.exe_name);
9189
let exe_path = relative_path.to_utf8_path(state.deploy_dir());
9290
run_entrypoint(&state.deploy_dir(), &exe_path, state.envs, input_bytes)
@@ -136,8 +134,6 @@ pub(crate) fn run_unit_input(
136134
run_resolved: RunResolved,
137135
input_bytes: Option<Vec<u8>>,
138136
) -> Result<EntrypointOut, Report> {
139-
//debug!("Run command called with in_state {:?}, executable {:?}, variables {:?} and input_bytes {:?}", state_in, executable, variables, input_bytes);
140-
141137
let secret_vars = secret_vars_to_envs(&run_resolved.scope, run_resolved.envs)?;
142138

143139
run_entrypoint(
@@ -147,71 +143,3 @@ pub(crate) fn run_unit_input(
147143
input_bytes,
148144
)
149145
}
150-
151-
// #[instrument(name = "address", level = "debug", skip_all)]
152-
// pub(crate) fn address_command(
153-
// state_in: StateIn,
154-
// address_in: AddressIn
155-
// ) -> Result<EntrypointOut, Report> {
156-
// debug!("Run command called with in_state {:?}, executable {:?}, variables {:?} and input_bytes {:?}", state_in, executable, variables, input_bytes);
157-
158-
// let resolve_state = resolve_from_base_state(state, state_options.unwrap_or_default())?;
159-
160-
// let run_resolved = merge_and_resolve(run_args, resolve_state)?;
161-
162-
// run_unit_input(run_resolved, input_bytes)
163-
// }
164-
165-
// #[instrument(name = "deploy", level = "debug", skip_all)]
166-
// pub(crate) fn deploy_command(
167-
// state_in: StateIn,
168-
// state_options: Option<StateOptions>,
169-
// address: Option<Address>,
170-
// service: Option<String>,
171-
// executable: Option<String>,
172-
// execution_path: Option<String>,
173-
// variables: Vec<String>,
174-
// input_bytes: Option<Vec<u8>>,
175-
// ) -> Result<EntrypointOut, Report> {
176-
// debug!("Run command called with in_state {:?}, executable {:?}, variables {:?} and input_bytes {:?}", state_in, executable, variables, input_bytes);
177-
178-
// let scope_args = SecretScopeArguments {
179-
// service,
180-
// ..Default::default()
181-
// };
182-
// let run_args = RunArguments {
183-
// executable,
184-
// execution_path,
185-
// envs: parse_cli_vars(variables),
186-
// scope_args,
187-
// };
188-
// let paths = StatePaths::new(state_in)?;
189-
190-
// // // Either provide address, or give none (then it's inferred)
191-
// // let address = match address {
192-
// // None => {
193-
// // let url = git_root_origin_url(&paths.resolve_root)?;
194-
195-
// // Address {
196-
// // root: AddressRoot::Git(GitAddress {
197-
// // url,
198-
// // git_ref: "HEAD".to_owned(),
199-
// // path: RelativePathBuf::new()
200-
201-
// // }), state_root: RelativePathBuf::new(), state_path: RelativePathBuf::new()
202-
// // }
203-
// // },
204-
// // Some(address) => address
205-
// // };
206-
207-
// let state = State {
208-
// address: Some(address),
209-
// ..State::from(paths)
210-
// };
211-
212-
// let resolve_state = resolve_from_base_state(state, state_options.unwrap_or_default())?;
213-
214-
// let run_resolved = merge_and_resolve(run_args, resolve_state)?;
215-
216-
// run_unit_input(run_resolved, input_bytes)
217-
// }

0 commit comments

Comments
 (0)