Skip to content

feat/ft5 3309 s3 toggles source#1

Merged
anydef merged 5 commits into
otto-de:mainfrom
wickner-consid:feat/FT5-3309-s3-toggles-source
Jul 2, 2026
Merged

feat/ft5 3309 s3 toggles source#1
anydef merged 5 commits into
otto-de:mainfrom
wickner-consid:feat/FT5-3309-s3-toggles-source

Conversation

@wickner-consid

Copy link
Copy Markdown
Contributor

No description provided.

@anydef

anydef commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@wickner-consid it would be great to have the the integration example inside demo module.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new configuration source that loads feature toggles from S3 object keys (encoding toggle state in the key name), wires it into source discovery, and documents how to configure it.

Changes:

  • Introduce S3TogglesSource and register it via CoreSourceFactory as aws.s3.toggles, with local-profile fallback to properties.json.
  • Add unit tests for S3 toggle parsing and S3 listing/pagination merge behavior, plus source discovery tests.
  • Document the new source in README.md and docs/AWS_SETUP.md, and add the AWS SDK S3 dependency.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/de/otto/config/source/CoreSourceFactory.java Registers the new aws.s3.toggles source and local-profile fallback behavior.
src/main/java/de/otto/config/source/aws/S3TogglesSource.java Implements toggle loading from S3 object listings and key-name parsing.
src/test/java/de/otto/config/source/CoreSourceFactoryTest.java Verifies discovery includes S3 toggles source when enabled and uses file source in local profile.
src/test/java/de/otto/config/source/aws/S3TogglesSourceTest.java Verifies merge semantics, pagination handling, and folder-prefix behavior for S3 toggles.
src/test/java/de/otto/config/source/aws/ToggleEntryTest.java Tests parsing rules for on. / off. toggle object key naming.
src/test/java/de/otto/config/fixture/MockAwsClients.java Extends AWS client mocking to include S3Client.builder() for tests.
README.md Lists the new supported source and adds a quick configuration snippet.
docs/AWS_SETUP.md Adds detailed S3 toggles setup, naming conventions, and IAM permissions.
build.gradle Adds software.amazon.awssdk:s3 dependency.

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

Comment on lines +61 to +70
private Stream<String> fetchToggleKeys() {
return this.s3Client.listObjectsV2Paginator(
ListObjectsV2Request.builder()
.bucket(this.bucketName)
.prefix(this.togglesFolder)
.build())
.stream()
.flatMap(page -> page.contents().stream())
.map(S3Object::key);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot add unit test

@wickner-consid wickner-consid force-pushed the feat/FT5-3309-s3-toggles-source branch from 8d25265 to c6282e3 Compare July 2, 2026 08:20
@wickner-consid wickner-consid force-pushed the feat/FT5-3309-s3-toggles-source branch from 3f388b7 to 6fbd3cd Compare July 2, 2026 08:35
@wickner-consid wickner-consid force-pushed the feat/FT5-3309-s3-toggles-source branch from 6fbd3cd to 515a887 Compare July 2, 2026 09:56
@anydef anydef requested a review from Copilot July 2, 2026 11:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 20 out of 23 changed files in this pull request and generated 3 comments.

Comment on lines +43 to +48
return S3TogglesSource.builder()
.s3Client(context.getClientRegistry().registerIfAbsent(S3Client.class,
() -> S3Client.builder().build()))
.bucketName(context.getConfiguration().getValue("otto.config.aws.s3.toggles.bucket.name"))
.togglesFolder(context.getConfiguration().getValue("otto.config.aws.s3.toggles.folder.name"))
.build();
public void load() {
boolean value = configurationProvider.getValueAsBoolean("logging_enabled");
log.info("Toggle value for logging_enabled: " + value);
log.info("S3 feature toggle 's3_toggle1' resolved to " + (s3Toggle1.getValue() ? "ENABLED (serving new code path)" : "DISABLED (serving default code path)"));
Comment thread demo/helidon/src/main/java/de/otto/config/demo/DemoService.java Outdated
@anydef anydef requested a review from paulschwarz0711 July 2, 2026 11:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Jul 2, 2026
- CoreSourceFactory: validate bucketName and togglesFolder with
  IllegalArgumentException when missing from configuration
- demo/spring/DemoService: use Boolean.TRUE.equals() for null-safe
  toggle check to prevent NPE on auto-unboxing
- CoreSourceFactoryTest: add tests for missing bucket name and folder
  name validation
@anydef anydef merged commit a11da47 into otto-de:main Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants