Skip to content
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

Align S3ConfigDataLocationResolver resolving behavior with Spring Boot resolvers #1299

Conversation

MatejNedic
Copy link
Member

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Currently we are calling wrong method and not respecting profile (names) when looking for resources. We are not using profile name when finding the location to load which is intention of method, hence we should switch to resolve().

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated reference documentation to reflect the change
  • All tests passing
  • No breaking changes

🔮 Next steps

@github-actions github-actions bot added the component: parameter-store Parameter Store integration related issue label Dec 17, 2024
@maciejwalkowiak
Copy link
Contributor

Is it just a refactoring or does it change anything in the behavior?

@MatejNedic
Copy link
Member Author

It changes the behaviour. Since resolve is called before resolveProfileSpecific. Resolve is first scan that Spring Boot does, which means properties under file:/ and file:/config such as application-dev.properties won't impact the loading. With this we are now aligned by Spring Boots design in using ConfigDataLocationResolver. classpath:/ properties are not into account since their scan happens after.

Once if Spring Boot team decides to implement the following: spring-projects/spring-boot#43533 . We are gonna end with same thing since Binder itself will be the same one from resolve method, meaning it won't take into account previously loaded properties.

It is breaking change if you ask me since we are moving loading to happen before rather than after. We are slightly changing the behaviour itself.

@github-actions github-actions bot removed the component: parameter-store Parameter Store integration related issue label Dec 18, 2024
@maciejwalkowiak maciejwalkowiak changed the title Align ConfigLoaderResolvers with Spring Boots resolver Align S3ConfigDataLocationResolver resolving behavior with Spring Boot resolvers Dec 18, 2024
@maciejwalkowiak maciejwalkowiak merged commit 9e4ebe9 into awspring:main Dec 18, 2024
4 checks passed
@maciejwalkowiak maciejwalkowiak added this to the 3.3.0 RC1 milestone Dec 18, 2024
@maciejwalkowiak maciejwalkowiak added the component: s3 S3 integration related issue label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: s3 S3 integration related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants