Skip to content

Handle negated profiles in S3 bucket multi-document YAML files#3225

Merged
ryanjbaxter merged 1 commit into
spring-cloud:4.3.xfrom
ryanjbaxter:aws-s3-negated-profile-document
May 28, 2026
Merged

Handle negated profiles in S3 bucket multi-document YAML files#3225
ryanjbaxter merged 1 commit into
spring-cloud:4.3.xfrom
ryanjbaxter:aws-s3-negated-profile-document

Conversation

@ryanjbaxter
Copy link
Copy Markdown
Contributor

Fixes #3224

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 addresses #3224 by restoring parity between the S3 backend and other backends (native/git) for multi-document YAML handling when spring.config.activate.on-profile uses negation and more complex profile expressions. It extends the S3 YAML document selection logic so documents activated by profile expressions (e.g., !my-profile, profile1 & !profile2) can be included/excluded correctly, and adds regression tests for these scenarios.

Changes:

  • Add S3 YAML document matching support for negated/complex spring.config.activate.on-profile expressions using org.springframework.core.env.Profiles.
  • Add new AWS S3 repository tests covering negated profiles, multiple negated documents, and complex expressions (including application-directory layout variants).
  • Add test YAML fixtures representing multi-document inputs with negated and complex profile expressions.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/AwsS3EnvironmentRepository.java Adds expression-based YAML document matching for S3-backed multi-document YAML.
spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/AwsS3EnvironmentRepositoryTests.java Adds regression tests validating inclusion/exclusion for negated and complex profile expressions.
spring-cloud-config-server/src/test/resources/awss3/application-with-negated-profile.yaml Fixture: base + !my-profile activated document.
spring-cloud-config-server/src/test/resources/awss3/application-with-two-negated-profiles.yaml Fixture: base + two negated-profile documents.
spring-cloud-config-server/src/test/resources/awss3/application-with-complex-profile-expressions.yaml Fixture: base + multiple complex profile expressions (&, `

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

@ryanjbaxter ryanjbaxter force-pushed the aws-s3-negated-profile-document branch from 7bbe5aa to bc730f0 Compare May 26, 2026 16:08
@ryanjbaxter ryanjbaxter requested a review from spencergibb May 26, 2026 16:09
@ryanjbaxter ryanjbaxter merged commit 7edc261 into spring-cloud:4.3.x May 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support on-profile with formulas for s3 backend

3 participants