Skip to content

feat(appstash): add APPSTASH_BASE_DIR env var support#75

Merged
pyramation merged 1 commit intomainfrom
devin/1774639487-appstash-base-dir-env
Mar 27, 2026
Merged

feat(appstash): add APPSTASH_BASE_DIR env var support#75
pyramation merged 1 commit intomainfrom
devin/1774639487-appstash-base-dir-env

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented Mar 27, 2026

Summary

Adds APPSTASH_BASE_DIR environment variable support to the appstash() directory resolution chain. When no baseDir option is passed programmatically, appstash now checks process.env.APPSTASH_BASE_DIR before falling back to os.homedir().

Resolution priority: baseDir option > APPSTASH_BASE_DIR env var > os.homedir() > XDG fallback > tmp

This enables test isolation for generated CLIs (which call createConfigStore(toolName) without a baseDir option) without overriding HOME.

Review & Testing Checklist for Human

  • Verify the env var name APPSTASH_BASE_DIR doesn't conflict with anything already in use across your projects (grep -r APPSTASH_BASE_DIR across repos)
  • Confirm this doesn't unintentionally affect production CLI behavior — the env var would need to be explicitly set, but worth checking CI environments and Dockerfiles for any pre-existing use

Notes

  • An empty string for APPSTASH_BASE_DIR is falsy and correctly falls through to os.homedir()
  • Motivation: CLI e2e tests in constructive currently override HOME to isolate appstash config; this env var provides a cleaner alternative

Link to Devin session: https://app.devin.ai/sessions/c92c3a11450342f8875625a60fa1be28
Requested by: @pyramation


Open with Devin

When no baseDir option is passed programmatically, appstash now checks
the APPSTASH_BASE_DIR environment variable before falling back to
os.homedir(). This enables test isolation without overriding HOME.

Priority: baseDir option > APPSTASH_BASE_DIR env var > os.homedir()
@devin-ai-integration
Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 3d4088b into main Mar 27, 2026
36 checks passed
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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.

1 participant