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

Add support for propery source origin introduced in boot 2 #866

Closed
spencergibb opened this issue Dec 5, 2017 · 4 comments · Fixed by #870
Closed

Add support for propery source origin introduced in boot 2 #866

spencergibb opened this issue Dec 5, 2017 · 4 comments · Fixed by #870
Milestone

Comments

@spencergibb
Copy link
Member

This would be helpful in debugging configuration problems.

@dsyer @twicksell

@spencergibb
Copy link
Member Author

spencergibb commented Dec 6, 2017

Boot's env endpoint changed for a simple key -> value, to key -> {value, origin}. Config server would need to be backward compatible. Two options, either a new prefix (v2) or a content type (which is what boot uses). I think I lean towards the content type.

Boot's content type application/vnd.spring-boot.actuator.v2+json, so I would propose application/vnd.spring-cloud.config-server.v2+json.

Example output:

{
  "name": "foo",
  "profiles": [
    "default"
  ],
  "label": null,
  "version": "a611374438e75aa1b9808908c57833480944e1a8",
  "state": null,
  "propertySources": [
    {
      "name": "https://github.com/spring-cloud-samples/config-repo/foo.properties",
      "source": {
        "foo": {
          "value": "from foo props",
          "origin": "File [foo.properties]:1:6"
        },
        "democonfigclient.message": {
          "value": "hello spring io",
          "origin": "File [foo.properties]:2:27"
        }
      }
    },
    {
      "name": "https://github.com/spring-cloud-samples/config-repo/application.yml",
      "source": {
        "info.description": {
          "value": "Spring Cloud Samples",
          "origin": "File [application.yml]:2:16"
        },
        "info.url": {
          "value": "https://github.com/spring-cloud-samples",
          "origin": "File [application.yml]:3:8"
        },
        "eureka.client.serviceUrl.defaultZone": {
          "value": "http://localhost:8761/eureka/",
          "origin": "File [application.yml]:7:20"
        },
        "foo": {
          "value": "baz",
          "origin": "File [application.yml]:9:6"
        }
      }
    }
  ]
}

@spencergibb
Copy link
Member Author

We could enhance the origin depending on the environment. For example, git blame information could be added, etc...

@spencergibb
Copy link
Member Author

From /actuator/env

{
  "activeProfiles": [],
  "propertySources": [
    {
      "name": "configService:https://github.com/spring-cloud-samples/config-repo/foo.properties",
      "properties": {
        "foo": {
          "value": "from foo props",
          "origin": "Remote file foo.properties:1:6"
        },
        "democonfigclient.message": {
          "value": "hello spring io",
          "origin": "Remote file foo.properties:2:27"
        }
      }
    },

spencergibb added a commit that referenced this issue Dec 15, 2017
Adds a new format if requested using v2 Accept header, otherwise the
format is backwards compatible so older clients will work with new
servers.

fixes gh-866
@jasonrberk

This comment has been minimized.

spencergibb added a commit that referenced this issue Jul 25, 2019
Adds a new format if requested using v2 Accept header, otherwise the
format is backwards compatible so older clients will work with new
servers.

fixes gh-866
spencergibb added a commit to spring-cloud/spring-cloud-commons that referenced this issue Jul 26, 2019
This allows the boot origin tracking mechanism to work if bootstrap loaded propertysources themselves are also origin tracked.

See spring-cloud/spring-cloud-config#866
spencergibb added a commit to spring-cloud/spring-cloud-commons that referenced this issue Aug 2, 2019
This allows the boot origin tracking mechanism to work if bootstrap loaded propertysources themselves are also origin tracked.

See spring-cloud/spring-cloud-config#866
@spencergibb spencergibb removed the icebox label Aug 2, 2019
@spencergibb spencergibb added this to the 2.2.0.M2 milestone Aug 2, 2019
spencergibb added a commit that referenced this issue Aug 2, 2019
Adds a new format if requested using v2 Accept header, otherwise the
format is backwards compatible so older clients will work with new
servers.

fixes gh-866
spencergibb added a commit that referenced this issue Aug 2, 2019
Adds a new format if requested using v2 Accept header, otherwise the
format is backwards compatible so older clients will work with new
servers.

fixes gh-866
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants