-
Notifications
You must be signed in to change notification settings - Fork 32
Add docs-assembler deploy [plan|apply] commands
#1334
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
Conversation
This gives us the ability to analyze the plan and identify which files are being uploaded, deleted or skipped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds deployment commands for the docs-assembler tool, enabling planning and applying file sync operations to an S3 bucket. Key changes include new test cases for sync planning and applying, the implementation of AWS S3 sync strategies (plan and apply), and CLI command integration to support deployment operations.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/docs-assembler.Tests/docs-assembler.Tests.csproj | Added Moq package reference for unit tests |
| tests/docs-assembler.Tests/DocsSyncTests.cs | Introduced new tests for the plan and apply operations |
| src/tooling/docs-assembler/Program.cs | Registered the new deploy commands with the CLI app |
| src/tooling/docs-assembler/Deploying/DocsSync.cs | Added interfaces and record definitions for sync operations |
| src/tooling/docs-assembler/Deploying/AwsS3SyncPlanStrategy.cs | Implemented the sync planning logic with parallel processing and ETag calculation |
| src/tooling/docs-assembler/Deploying/AwsS3SyncApplyStrategy.cs | Implemented the sync applying logic with directory upload and batched file deletion |
| src/tooling/docs-assembler/Cli/DeployCommands.cs | Defined CLI commands for planning and applying sync operations |
| Directory.Packages.props | Updated package versions by adding the Moq package |
Comments suppressed due to low confidence (1)
src/tooling/docs-assembler/Cli/DeployCommands.cs:23
- [nitpick] Consider using 'DeployCommands' as the logger category instead of 'Program' to ensure the log messages are clearly associated with this class.
var log = logger.CreateLogger<Program>();
Mpdreamz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight nit on library choice.
If we change our static files almost everything changes because of the hash inclusion on the references to these assets.
<link rel="stylesheet preload" as="style" type="text/css" href="/docs/_static/styles.css?v=673f1437ffe25ef1" crossorigin="">Should we short circuit the plan in that case and always do a full sync? Although I guess this will still save us from uploading images all the time. NVMD 👍
Awesome addition! Can't wait to see how this will impact our upload times!
If there is a change in a static file the content-hash should change. This means the Generally, I will only add the |
I guess my question also was if in that case instead of writing all files out into the plan we write a special marker instead ( |
Ah, I see. Sorry for misunderstanding. Makes sense! |
Changes
This gives us the ability to analyze the plan and identify which files are being uploaded, deleted or skipped
Usage
docs-assembler repo clone-all --environment edge docs-assembler repo build-all --environment edge docs-assembler deploy plan --environment edge --s3-bucket-name elastic-docs-v3-website-edge --out out.plan # ... Do something else with the plan? E.g. optimize for cache invalidation. docs-assembler deploy apply --environment edge --s3-bucket-name elastic-docs-v3-website-edge --plan-file out.planExample Output
{ "add": [ { "local_path": "/path-to-local/docs/add.md", "destination_path": "/docs/add.md" } ], "update": [ { "local_path": "/path-to-local/docs/update.md", "destination_path": "/docs/update.md" } ], "skip": [ { "local_path": "/path-to-local/docs/skip.md", "destination_path": "/docs/skip.md" } ], "delete": [ { "destination_path": "/docs/delete.md" } ] }