feat(riff-raff-generator)!: Support multiple Riff-Raff projects#2872
Draft
akash1810 wants to merge 3 commits intoaa/riff-raff-validationfrom
Draft
feat(riff-raff-generator)!: Support multiple Riff-Raff projects#2872akash1810 wants to merge 3 commits intoaa/riff-raff-validationfrom
akash1810 wants to merge 3 commits intoaa/riff-raff-validationfrom
Conversation
🦋 Changeset detectedLatest commit: f8f2436 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Adds first-class support for repositories that deploy multiple Riff-Raff projects by grouping GuStacks by an optional riffRaffProjectName, generating one riff-raff.yaml per project (and tagging resources accordingly).
Changes:
- Add optional
riffRaffProjectNametoGuStackPropsand apply agu:riff-raff-projecttag to all resources when set. - Update
RiffRaffYamlFileto build a per-projectconfigurationmap and synthesize multipleriff-raff.yamlfiles into per-project subdirectories. - Add/extend unit tests and update documentation + changesets for the new behavior and breaking API adjustments.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/constructs/core/stack.ts | Introduces riffRaffProjectName prop and applies gu:riff-raff-project tagging. |
| src/riff-raff-yaml-file/index.ts | Refactors generator to produce per-project configurations and write multiple YAML outputs. |
| src/riff-raff-yaml-file/group-by.ts | Adds grouping by riffRaffProjectName with a default “unknown” project key. |
| src/riff-raff-yaml-file/types.ts | Adds RiffRaffProjectName alias and UnknownRiffRaffProjectName constant. |
| src/riff-raff-yaml-file/index.test.ts | Updates tests for new configuration API and adds multi-project test coverage. |
| src/riff-raff-yaml-file/README.md | Documents multi-project generation and migration path for the breaking API change. |
| src/utils/array.test.ts | Extends groupBy test coverage around undefined grouping keys/defaulting. |
| .changeset/thirty-schools-pay.md | Minor release note for new GuStackProps field/tagging behavior. |
| .changeset/eleven-animals-pick.md | Major release note documenting breaking RiffRaffYamlFile API changes. |
Comments suppressed due to low confidence (1)
src/riff-raff-yaml-file/index.ts:64
- For consistency/readability with the new
RiffRaffProjectNametype alias,MissingStack.riffRaffProjectNameshould useRiffRaffProjectNameinstead of plainstring(it’s part of the structured “missing stacks” diagnostics).
interface MissingStack {
riffRaffProjectName: string;
className: ClassName;
stack: StackTag;
stage: StageTag;
region: Region;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
640ddf2 to
76aa7bc
Compare
76aa7bc to
b7c0d11
Compare
b7c0d11 to
c506102
Compare
c506102 to
9f12ba4
Compare
9f12ba4 to
f8f2436
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Requires #2870.
What does this change?
Looking in guardian/riffraff-platform we have multiple repositories that deploy multiple RIff-Raff projects. This change updates the
riff-raff.yamlgenerator to support these repositories. To do this, a new optionalriffRaffProjectNameproperty1 is added toGuStack. As a side benefit, when set, agu:riff-raff-projecttag is also added to all resources. This tag can be used to pull deployment information into the Availability dashboard.In the below example, the following files will be generated:
/path/to/cdk.out/playground::core-infra/riff-raff.yaml/path/to/cdk.out/playground::api/riff-raff.yamlNote
#2814 and #2815 offer alternative implementations of this feature. I think this version has the cleanest API for users as it is a no-op by default; if
riffRaffProjectNameis not set, the usual/path/to/cdk.out/riff-raff.yamlis still created.How to test
See added unit tests.
How can we measure success?
Supporting more use-cases across the department.
Have we considered potential risks?
There are some breaking changes to the
RiffRaffYamlFileclass. Specifically, theriffRaffYamlproperty has been removed and thetoYAMLfunction signature has changed. Using a GitHub search, we can see there isn't much usage of these:riffRaffYamlusagetoYAMLusageThe migration path has been documented.
Checklist
Footnotes
The property is currently optional after https://github.com/guardian/riff-raff/pull/1378. ↩
Consider whether this is something that will mean changes to projects that have already been migrated, or to the CDK CLI tool. If changes are required, consider adding a checklist here and/or linking to related PRs. ↩
If you are adding a new construct or pattern, has new documentation been added? If you are amending defaults or changing behaviour, are the existing docs still valid? ↩