Skip to content

Conversation

@dk19y
Copy link
Contributor

@dk19y dk19y commented Oct 30, 2025

Refactor/consolidate env variables.

dk19y added 4 commits October 30, 2025 09:04
- Add comprehensive paths.rs module with hierarchical path management
- Consolidate workspace (.amazonq/), global (~/.aws/amazonq/), and application data paths
- Replace hardcoded paths in tool_manager.rs, context.rs, and directories.rs
- Use structured PathResolver with workspace(), global(), and application() scopes
- Maintain backward compatibility while providing single source of truth for paths
- Support async Os initialization and proper error handling
- Suppress clippy warnings during migration phase

This enables easier path management and future rebranding efforts by centralizing
all Amazon Q related paths in one location.

🤖 Assisted by Amazon Q Developer
…ntrol

Add SC2329 to the existing shellcheck disable comment for the
__bp_adjust_histcontrol function in bash-preexec.sh. This function
appears unused to shellcheck because it's overridden by a stub function,
but it's actually called from within the __bp_install function.

Fixes failing init lint tests for bash shell integrations.

🤖 Assisted by Amazon Q Developer
@dk19y dk19y requested a review from a team as a code owner October 30, 2025 23:16
@dk19y dk19y force-pushed the refactor/consolidate-env branch 2 times, most recently from f5d2995 to ac90afd Compare October 31, 2025 00:17
Copy link
Contributor

@brandonskiser brandonskiser left a comment

Choose a reason for hiding this comment

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

very minor nit - I would prefer just importing Env etc. instead of qualifying all callsites with fig_os_shim::..., more consistent with the rest of the codebase and more legible.

static IN_CODESPACES: OnceLock<bool> = OnceLock::new();
*IN_CODESPACES
.get_or_init(|| std::env::var_os("CODESPACES").is_some() || std::env::var_os("Q_CODESPACES").is_some())
*IN_CODESPACES.get_or_init(|| std::env::var_os("CODESPACES").is_some() || crate::os::Env::new().in_codespaces())
Copy link
Contributor

Choose a reason for hiding this comment

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

Env::in_codespaces should also check for the "CODESPACES" env var right? So std::env::var_os("CODESPACES").is_some() shouldn't be necessary


// Q-specific environment variable methods
pub fn q_fake_is_remote(&self) -> bool {
self.get_os("Q_FAKE_IS_REMOTE").is_some()
Copy link
Contributor

@kkashilk kkashilk Oct 31, 2025

Choose a reason for hiding this comment

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

nit: rename get_os to get_os_env_var

dk19y added 2 commits October 31, 2025 12:24
Replace the deprecated CommandCargoExt::cargo_bin method with the
recommended cargo_bin! macro to resolve compilation warnings.

🤖 Assisted by Amazon Q Developer
Replace deprecated assert_cmd::cargo::CommandCargoExt::cargo_bin method
with the recommended cargo_bin! macro in test files to fix compilation
warnings and ensure compatibility with custom cargo build directories.

🤖 Assisted by Amazon Q Developer
@dk19y dk19y merged commit f59b224 into main Oct 31, 2025
21 of 27 checks passed
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