spring-cloud-aws icon indicating copy to clipboard operation
spring-cloud-aws copied to clipboard

Fix for property ordering as reported in https://github.com/spring-cl…

Open peteguyatt opened this issue 4 years ago • 0 comments

…oud/spring-cloud-aws/issues/772

:loudspeaker: Type of change

  • [x] Bugfix
  • [ ] New feature
  • [ ] Enhancement
  • [ ] Refactoring

:scroll: Description

When building up the context path use the active profiles in reverse order.

E.g. with the following properties and using the prefix of context:

spring.profiles.active=profile_a,profile_b spring.application.name: sample-app

Ensure that the context paths are in the following order:

context/sample-app_profile_b/ context/sample-app_profile_a/ context/sample-app/ context/application_profile_a context/application_profile_b context/application

:bulb: Motivation and Context

Fixed a bug introduced in https://github.com/spring-cloud/spring-cloud-aws/commit/582fdc6691ead7904aaed176af2cf85221edacd5 where properties don't seem to be able to be overridden based on the the last specified profile

This caused some confusion when running an upgraded spring boot and spring cloud project on our test servers due to properties being in a different order from previous versions

Fix #772

:green_heart: How did you test it?

Wrote unit tests and tested locally using a snapshot version

:pencil: Checklist

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

:crystal_ball: Next steps

peteguyatt avatar Apr 28 '21 07:04 peteguyatt