spring-cloud / spring-cloud/spring-cloud-config
Refresh events are dispatched even when unrelated git file is changed
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2k
- Forks
- 1.3k
- Avg merge
- 2d 59m
- Merged PRs (30d)
- 16
Description
Describe the bug
- Given config-server is configured with the
spring.cloud.config.server.git.searchPathstospring-config - And cloud-bus is also configured on the config-server
- And gitlab webhook is setup to notify the git repository changes on
/monitorpath of the config-server - When I change an unrelated file in the git repository (e.g.
/docker-compose/docker-compose.yml) - Then config-server dispatches a
RefreshRemoteApplicationEventfor the destinations:docker-compose:*:**anddocker-compose:*:**[ISSUE]
Expected Result
As the git repository file updated was out of the configured searchPaths, No RefreshRemoteApplicationEvent` should be dispatched.
Suggested Fix
PropertyPathEndpoint.notifyByPath should be updated. It should filter out the paths retrieved from the PropertyPathNotifiationExtractor which aren't matching the configured searchPaths.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in spring-cloud-config-monitor/src/main/java/org/springframework/cloud/config/monitor/PropertyPathEndpoint.java at notifyByPath, then inspect PropertyPathNotificationExtractor and the configured git searchPaths. Confirm that changes outside searchPaths do not dispatch a RefreshRemoteApplicationEvent, including for the docker-compose path described in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, java, spring
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100