Skip to content

Commit

Permalink
Merge branch 'main' into remove-prisma-count
Browse files Browse the repository at this point in the history
  • Loading branch information
Natoandro committed Nov 13, 2024
2 parents b756eaa + 865f2c9 commit 857033e
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/meta-cli/src/cli/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ async fn load_tg_at(
let init = TaskManagerInit::<SerializeAction>::new(
config.clone(),
SerializeActionGenerator::new(
None,
config_dir.clone(),
dir.into(),
config
Expand Down
1 change: 1 addition & 0 deletions src/meta-cli/src/cli/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl Action for List {
let console = ConsoleActor::new(Arc::clone(&config)).start();

let action_generator = ListActionGenerator::new(
node.prefix.clone(),
config.dir().unwrap_or_log().into(),
dir.clone().into(),
config
Expand Down
1 change: 1 addition & 0 deletions src/meta-cli/src/cli/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl Action for Serialize {
let console = ConsoleActor::new(Arc::clone(&config)).start();

let action_generator = SerializeActionGenerator::new(
self.prefix.clone(),
config.dir().unwrap_or_log().into(),
dir.into(),
config
Expand Down
1 change: 1 addition & 0 deletions src/meta-cli/src/deploy/actors/task/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use tokio::process::Command;
#[derive(Debug, Clone)]
pub struct SharedActionConfig {
pub command: &'static str,
pub prefix: Option<String>,
pub config_dir: Arc<Path>,
pub working_dir: Arc<Path>,
pub migrations_dir: Arc<Path>,
Expand Down
7 changes: 7 additions & 0 deletions src/meta-cli/src/deploy/actors/task/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ impl CommandContext {
path,
} = self;

let optional_envs = [("MCLI_PREFIX", shared_config.prefix.clone())];

command
.current_dir(shared_config.working_dir.to_str().unwrap())
.env("MCLI_VERSION", crate::build::PKG_VERSION)
Expand All @@ -122,6 +124,11 @@ impl CommandContext {
"MCLI_ARTIFACT_RESOLUTION",
shared_config.artifact_resolution.to_string(),
)
.envs(
optional_envs
.into_iter()
.filter_map(|(k, v)| v.map(|v| (k, v))),
)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped());
Expand Down
3 changes: 2 additions & 1 deletion src/meta-cli/src/deploy/actors/task/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ impl DeployActionGenerator {
destructive_migrations: bool, // TODO enum { Fail, Reset, Ask }
) -> Self {
Self {
node,
secrets,
shared_config: SharedActionConfig {
command: "deploy",
prefix: node.prefix.clone(),
config_dir,
working_dir,
migrations_dir,
Expand All @@ -76,6 +76,7 @@ impl DeployActionGenerator {
artifact_resolution: true,
}
.into(),
node,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/meta-cli/src/deploy/actors/task/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub struct ListActionGenerator {

impl ListActionGenerator {
pub fn new(
prefix: Option<String>,
config_dir: Arc<Path>,
working_dir: Arc<Path>,
migrations_dir: Arc<Path>,
Expand All @@ -39,6 +40,7 @@ impl ListActionGenerator {
Self {
shared_config: SharedActionConfig {
command: "list",
prefix,
config_dir,
working_dir,
migrations_dir,
Expand Down
2 changes: 2 additions & 0 deletions src/meta-cli/src/deploy/actors/task/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub struct SerializeActionGenerator {

impl SerializeActionGenerator {
pub fn new(
prefix: Option<String>,
config_dir: Arc<Path>,
working_dir: Arc<Path>,
migrations_dir: Arc<Path>,
Expand All @@ -40,6 +41,7 @@ impl SerializeActionGenerator {
Self {
shared_config: SharedActionConfig {
command: "serialize",
prefix,
config_dir,
working_dir,
migrations_dir,
Expand Down
2 changes: 1 addition & 1 deletion src/typegraph/deno/src/envs/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function loadCliEnv(): CliEnv | null {
for (const key of optionalCliEnvs) {
const name = `MCLI_${key.toLocaleUpperCase()}`;
const envValue = env[name];
if (envValue != null) {
if (envValue) {
record[key] = envValue;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/typegraph/python/typegraph/envs/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def load(cls) -> Optional["CliEnv"]:
for key in _optional_cli_envs:
env_name = "MCLI_" + key.upper()
d[key] = environ.get(env_name)

try:
d["command"] = Command(d["command"])
except ValueError as e:
Expand Down

0 comments on commit 857033e

Please sign in to comment.