Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
submodules: recursive

- name: Configure SSH for cargo git dependencies
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -75,13 +70,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
submodules: recursive

- name: Configure SSH for cargo git dependencies
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- uses: dtolnay/rust-toolchain@stable

Expand Down Expand Up @@ -116,13 +106,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
submodules: recursive

- name: Configure SSH for cargo git dependencies
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -203,13 +188,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
submodules: recursive

- name: Configure SSH for cargo git dependencies
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- uses: ilammy/msvc-dev-cmd@v1
with:
Expand Down Expand Up @@ -374,13 +354,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
submodules: recursive

- name: Configure SSH for cargo git dependencies
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
submodules: recursive
fetch-depth: 0

- name: Configure SSH for cargo git dependencies
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}

- uses: dtolnay/rust-toolchain@stable
with:
Expand Down
5 changes: 3 additions & 2 deletions crates/jcodex-build-support/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ fn test_binary_version_hash_mismatch_rejects_publish_candidate() {
git_hash: Some("oldhash".to_string()),
};

let error = validate_binary_version_matches_source_report(&report, Path::new("jcodex"), &source)
.expect_err("mismatched git hash should be rejected");
let error =
validate_binary_version_matches_source_report(&report, Path::new("jcodex"), &source)
.expect_err("mismatched git hash should be rejected");

assert!(
error
Expand Down
25 changes: 8 additions & 17 deletions crates/jcodex-core/src/env.rs
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
use std::ffi::OsStr;

/// Mutate the process environment for jcodex runtime configuration.
///
/// Rust 2024 makes environment mutation unsafe because it can race with
/// concurrent environment access in foreign code. jcodex intentionally mutates
/// process-local env vars to coordinate provider/runtime bootstrap before or
/// during task execution. We centralize that unsafety here so call sites remain
/// auditable.
pub fn set_var<K, V>(key: K, value: V)
where
K: AsRef<OsStr>,
V: AsRef<OsStr>,
{
// SAFETY: jcodex treats these mutations as process-global configuration.
// They are a pre-existing design choice used throughout startup, auth,
// provider bootstrap, tests, and self-dev flows. Centralizing the unsafe
// operation here makes the Rust 2024 requirement explicit without
// scattering unsafe blocks across hundreds of call sites.
unsafe {
std::env::set_var(key, value);
}
}

/// Remove a process environment variable used by jcodex runtime configuration.
pub fn remove_var<K>(key: K)
where
K: AsRef<OsStr>,
{
// SAFETY: see `set_var` above; this is the corresponding centralized
// removal operation for the same process-global configuration surface.
unsafe {
std::env::remove_var(key);
}
}
pub fn get_var(name: &str) -> Option<String> {
std::env::var(format!("JCODEX_{}", name))
.or_else(|_| std::env::var(format!("JCODE_{}", name)))
.ok()
}
pub fn get_raw_var(name: &str) -> Option<String> {
std::env::var(name).ok()
}
1 change: 1 addition & 0 deletions crates/jcodex-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ pub enum Request {
selfdev: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
target_session_id: Option<String>,
session_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
client_instance_id: Option<String>,
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
Expand Down
Loading
Loading