Skip to content

Conversation

@AgentEnder
Copy link
Member

Add NX_PROJECT_ROOT environment variable to runtime cache inputs

Current Behavior

Runtime cache input commands do not have access to project-specific context, making it impossible to create project-aware runtime inputs.

Expected Behavior

Runtime cache input commands can access $NX_PROJECT_ROOT environment variable containing the project's root directory path.

Related Issue(s)

Fixes #20949

Generated with Claude Code

@AgentEnder AgentEnder requested review from a team as code owners June 2, 2025 21:01
@AgentEnder AgentEnder requested review from Cammisuli and xiongemi June 2, 2025 21:01
@vercel
Copy link

vercel bot commented Jun 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Aug 21, 2025 3:35pm

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Jun 2, 2025

View your CI Pipeline Execution ↗ for commit bb68655

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 18m 54s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 2m 7s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 7s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 6s View ↗
nx documentation ✅ Succeeded 29s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-21 15:48:21 UTC

@FrozenPandaz FrozenPandaz added the priority: medium Medium Priority (not high, not low priority) label Jun 23, 2025
@AgentEnder AgentEnder force-pushed the claude/issue-20949-20250602_200652 branch from 33d1c49 to 48db687 Compare July 14, 2025 17:16
}
HashInstruction::Runtime(runtime) => {
// Extract project name from task_id (format: "project:target")
let project_name = task_id.split(':').next().unwrap_or(task_id);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not foolproof. Let's pass the name in.

… inputs

Adds NX_PROJECT_ROOT environment variable to runtime cache input commands,
allowing project-aware cache inputs for more granular caching strategies.

- Extract project name from task_id during runtime hash instruction processing
- Inject NX_PROJECT_ROOT environment variable with project root path
- Maintain backwards compatibility with existing runtime cache inputs
- Add comprehensive test coverage for the new functionality

Co-Authored-By: AgentEnder <[email protected]>
@FrozenPandaz FrozenPandaz merged commit 5679b3e into master Sep 4, 2025
5 checks passed
@FrozenPandaz FrozenPandaz deleted the claude/issue-20949-20250602_200652 branch September 4, 2025 20:04
@github-actions
Copy link
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

priority: medium Medium Priority (not high, not low priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make NX_PROJECT_ROOT environment variable available to runtime cache inputs

3 participants