-
Notifications
You must be signed in to change notification settings - Fork 21
Real redirects support #1397
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
base: main
Are you sure you want to change the base?
Real redirects support #1397
Conversation
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 support for real redirects by generating a redirects.json artifact during build and updating CloudFront’s KeyValueStore during deployment.
- New package references for CloudFront and its KeyValueStore in the csproj.
- Enhancements in CLI commands: outputting the redirect artifact during build and adding a deploy command to update redirects in CloudFront.
- Integration of redirects output within the assembler builder and serialization support enhancements.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/tooling/docs-assembler/docs-assembler.csproj | Added package references for AWS CloudFront and CloudFrontKeyValueStore. |
src/tooling/docs-assembler/Cli/RepositoryCommands.cs | Outputs the path of the generated redirects.json artifact to GitHub Actions. |
src/tooling/docs-assembler/Cli/DeployCommands.cs | Introduces a new command to update redirects in CloudFront’s KeyValueStore using batch operations. |
src/tooling/docs-assembler/Building/AssemblerBuilder.cs | Adds logic to output redirects.json and filter duplicate redirect entries. |
src/Elastic.Documentation/Serialization/SourceGenerationContext.cs | Updates serialization context to support FrozenDictionary. |
Directory.Packages.props | Specifies versions for new AWS SDK package dependencies. |
Comments suppressed due to low confidence (1)
src/tooling/docs-assembler/Building/AssemblerBuilder.cs:155
- [nitpick] Consider adding an inline comment explaining why redirects with equivalent keys and values (after trimming trailing slashes) are being filtered out, for clarity.
.ToFrozenDictionary();
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.
Some nits but mostly LGTM!
This MR is part of https://github.com/elastic/docs-eng-team/issues/135.
In order to have "real redirects", we need to provide a redirect mapping to CloudFront's KeyValueStore. CloudFront in turn will use it as it handles requests, determining passthrough or redirection.
docs-assembler repo build-all
now outputs a redirects.json file with the compiled mappings. It outputs the path to this file to Github's CI underredirects_artifact_path
.docs-assembler
received a new command:deploy update-redirects
. It will be called on CI during deployment, access the redirects mapping artifact fromrepo build-all
, access the KeyValueStore, determine which redirects should be added, kept or deleted, and perform batch operations.