spring-cloud / spring-cloud/spring-cloud-config

Refresh events are dispatched even when unrelated git file is changed

Open
#1,885 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
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.searchPaths to spring-config
  • And cloud-bus is also configured on the config-server
  • And gitlab webhook is setup to notify the git repository changes on /monitor path 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 RefreshRemoteApplicationEvent for the destinations: docker-compose:*:** and docker-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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.