Skip to content
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

Simulate file access #789

Merged
merged 12 commits into from
Sep 27, 2024
Merged

Simulate file access #789

merged 12 commits into from
Sep 27, 2024

Conversation

kenotron
Copy link
Member

@kenotron kenotron commented Sep 26, 2024

Overview

In this PR, we are trying to add a new feature to simulate file touches and probes. This is to facilitate the BuildXL sandbox to correctly cache bits for us during builds that are using this GRPC server feature. In this case, we need to pass the inputs and outputs as detected. These are not "really" monitored read/writes - that could come at a later date. We are using the same mechanism as our current cache hashing for inputs, and outputs config from cache options to do the globbing for outputs.

Summary by Copilot

This pull request includes various changes across multiple files to introduce new features, improve existing functionality, and enhance code maintainability. The most important changes include updates to the ESLint configuration, new features for the lage CLI, and modifications to the globby and hasher packages.

ESLint Configuration:

  • Updated .eslintrc.js to dynamically set the project path using path.join for better path resolution. (.eslintrc.js)

New Features for lage CLI:

  • Added a new script to simulate file access after task execution in server/action.ts. (packages/cli/src/commands/server/action.ts) [1] [2] [3] [4]
  • Introduced a function to get output files based on glob patterns in server/getOutputFiles.ts. (packages/cli/src/commands/server/getOutputFiles.ts)
  • Enhanced lageService.ts to use new context initialization and handle input/output files. (packages/cli/src/commands/server/lageService.ts) [1] [2] [3] [4] [5]

globby Package Enhancements:

  • Updated package.json and added scripts for transpiling and generating types. (packages/globby/package.json)
  • Introduced a caching mechanism for glob patterns in index.mts. (packages/globby/src/index.mts)
  • Added a configuration for dts-bundle-generator to bundle TypeScript declarations. (packages/globby/dts-bundle.config.js)
  • Added a script to rename TypeScript declaration files. (packages/globby/scripts/rename.js)

hasher Package Updates:

  • Replaced fast-glob with @lage-run/globby for file globbing in TargetHasher.ts. (packages/hasher/src/TargetHasher.ts)
  • Updated dependencies to include @lage-run/globby. (packages/hasher/package.json)

Minor Changes:

  • Added several new changes to the change JSON files to reflect updates and new features. (change/change-82487442-ab6c-4773-9770-15dca576410d.json, change/change-dcbd2f5c-b20e-448d-8579-a660a87102ad.json) [1] [2]
  • Modified lage.config.js to update task configurations for @lage-run/globby. (lage.config.js)
  • Made scope parameter optional in createTargetGraph.ts. (packages/cli/src/commands/run/createTargetGraph.ts)

These changes collectively enhance the functionality and maintainability of the codebase, particularly for the lage CLI and related packages.

@kenotron kenotron marked this pull request as ready for review September 26, 2024 23:13
@kenotron kenotron merged commit 2919f90 into master Sep 27, 2024
3 checks passed
@kenotron kenotron deleted the simulate-file-access branch September 27, 2024 20:00
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.

2 participants