Skip to content

feat(core): enhance native cache operations with comprehensive logging #31652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FrozenPandaz
Copy link
Collaborator

Current Behavior

The native cache system has minimal logging, making it difficult to debug issues or understand what's happening during cache operations. When problems occur, there's insufficient visibility into:

  • File copying operations and their progress
  • Output expansion and glob pattern matching
  • Cache PUT operation timing and success/failure details
  • Directory creation and cleanup processes

Expected Behavior

With these changes, the native cache system provides comprehensive logging that:

  • Tracks all file operations with sizes and timing
  • Provides detailed visibility into glob pattern expansion
  • Logs cache PUT operations with performance metrics
  • Includes trace-level debugging for troubleshooting
  • Makes it easier to diagnose cache-related issues

Related Issue(s)

This enhancement improves the observability and debugging capabilities of the native cache system without changing its core functionality.

Changes Made

  • Enhanced cache PUT operations: Added timing metrics and detailed logging for each step
  • Improved file copying: Added progress tracking, size reporting, and detailed trace logs
  • Better output expansion: Added comprehensive logging for glob pattern analysis and path validation
  • Fixed borrow checker error: Resolved compilation issue in file_ops copy function
  • Comprehensive tracing: Added trace and debug logging throughout the cache operations

The logging follows a structured approach:

  • trace\!() for detailed step-by-step operations
  • debug\!() for summary information and timing metrics
  • Proper error context for debugging issues

This makes the native cache system much more observable and easier to debug when issues arise.

- Add detailed trace and debug logging throughout cache PUT operations
- Enhance file copying operations with progress tracking and size reporting
- Add comprehensive logging to output expansion with glob pattern analysis
- Improve error visibility and debugging for cache operations
- Track timing metrics for cache PUT operations
- Add detailed logging for directory creation, file copying, and symlink handling
- Fix borrow checker error in file_ops copy function by using proper references
- Enhance expand_outputs with detailed glob matching and path validation logging

This improves observability and debugging capabilities for the native cache system,
making it easier to diagnose issues and monitor performance.
@FrozenPandaz FrozenPandaz requested review from a team as code owners June 19, 2025 16:49
@FrozenPandaz FrozenPandaz requested a review from Cammisuli June 19, 2025 16:49
Copy link

vercel bot commented Jun 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jun 19, 2025 5:12pm

Copy link

nx-cloud bot commented Jun 19, 2025

View your CI Pipeline Execution ↗ for commit c36c5f5.

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

☁️ Nx Cloud last updated this comment at 2025-06-19 17:33:44 UTC

Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx create-nx-workspace@0.0.0-pr-31652-c36c5f5 my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-31652-c36c5f5
Release details 📑
Published version 0.0.0-pr-31652-c36c5f5
Triggered by @FrozenPandaz
Branch cache-logs
Commit c36c5f5
Workflow run 15762854924

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@FrozenPandaz FrozenPandaz added the priority: medium Medium Priority (not high, not low priority) label Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium Medium Priority (not high, not low priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant