Deploy: separate read/write scoped filesystems in IncrementalDeployService#3023
Deploy: separate read/write scoped filesystems in IncrementalDeployService#3023
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe pull request updates IncrementalDeployService to accept separate ScopedFileSystem instances for reading and writing ( Sequence Diagram(s)mermaid CLI->>Service: instantiate(read=RealRead, write=RealWrite) CLI->>Service: Apply(...) 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Comment |
…rvice IncrementalDeployService accepted a single ScopedFileSystem used for both reading and writing. The deploy commands passed RealRead which lacks AllowedSpecialFolder.Temp, causing ScopedFileSystemException when AwsS3SyncApplyStrategy stages files in /tmp/ for S3 upload. Rather than just swapping RealRead for RealWrite, properly separate the concerns: the service now accepts distinct read and write filesystems, using each for the appropriate operations (plan file reads vs temp dir writes). This also fixes the Plan command which was writing its output file through a read-scoped filesystem. Made-with: Cursor
5b4db85 to
d91576a
Compare
…rvice (#3023) IncrementalDeployService accepted a single ScopedFileSystem used for both reading and writing. The deploy commands passed RealRead which lacks AllowedSpecialFolder.Temp, causing ScopedFileSystemException when AwsS3SyncApplyStrategy stages files in /tmp/ for S3 upload. Rather than just swapping RealRead for RealWrite, properly separate the concerns: the service now accepts distinct read and write filesystems, using each for the appropriate operations (plan file reads vs temp dir writes). This also fixes the Plan command which was writing its output file through a read-scoped filesystem. Made-with: Cursor
…rvice (#3023) IncrementalDeployService accepted a single ScopedFileSystem used for both reading and writing. The deploy commands passed RealRead which lacks AllowedSpecialFolder.Temp, causing ScopedFileSystemException when AwsS3SyncApplyStrategy stages files in /tmp/ for S3 upload. Rather than just swapping RealRead for RealWrite, properly separate the concerns: the service now accepts distinct read and write filesystems, using each for the appropriate operations (plan file reads vs temp dir writes). This also fixes the Plan command which was writing its output file through a read-scoped filesystem. Made-with: Cursor
Summary
Alternative to #3021 — fixes the same
ScopedFileSystemExceptionon/tmp/during incremental deploy, but with proper read/write filesystem separation rather than a single-FS swap.IncrementalDeployServicenow accepts separatereadFileSystemandwriteFileSystemparameters instead of a singlefileSystemused for bothDeployCommandspassesRealRead+RealWriteto bothPlanandApplycommandsreadFileSystem, writes (including plan output and temp staging) throughwriteFileSystemWhy this over #3021
#3021 swaps
RealRead→RealWritefor theApplycommand only, still passing a single FS as both the read and write filesystem toIncrementalDeployService(and through it toAssembleContext). This works but:AssembleContexthas distinctReadFileSystem/WriteFileSystemproperties, but both point to the sameRealWriteinstance. Future code relying onReadFileSystemhaving read-scoped permissions (e.g..gitaccess) would silently get the wrong FS.Planstill usesRealReadfor writing its output file (fileSystem.File.Create(@out)). This happens to work today because the output path is within the working directory scope, but it's using a read FS for a write operation.Test plan
dotnet buildpasses with 0 errorsDocsSyncTests.TestApplyuses separate read/write scoped filesystems and passesScopedFileSystemExceptionfor/tmp/pathsFixes https://github.com/elastic/docs-internal-workflows/actions/runs/23897412121/job/69685376318
Made with Cursor