-
Notifications
You must be signed in to change notification settings - Fork 53
json-schema-refactoring #3939
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
Merged
Merged
json-schema-refactoring #3939
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
10fc310
Revert "Temporarily remove the package binding_request to do that in …
joergdw 3f36236
Revert "Remove parts that belong rather to a different PR."
joergdw cff7348
🔧 Fix schemas;
joergdw eac69f9
Introduce new schema-naming-convention and remove legacy-schema;
joergdw 5f5127b
Faktor out schema (to different PR);
joergdw 17c0ca4
Remove leftovers from old schema-file: Test-fixing!
joergdw 2c69a85
Remove leftovers from old schema-file: Fix bosh-release;
joergdw 318f6ad
🔧 Fix Makefile;
joergdw 0cfcc4f
🩹 Introduce workaround for bosh-compiled-releases.
joergdw 2240df1
🔧 Fix path to catalog;
joergdw c12af7b
🔧 Fix usage for legacy-parameter `stats_window_secs`.
joergdw f102249
↑📦❄ Update Devbox- and Nix-environments;
joergdw 2832770
Remove changes to use them again in PR #3954
joergdw cb8652f
Allow additional attributes for backwards-compatibility;
joergdw e35829b
Adapt acceptance-tests to new schema.
joergdw 97b7368
Apply suggestions from code review
joergdw 0121d84
Apply suggestions from code review
joergdw 1709358
Bring back old test for additional attributes;
joergdw 8178d7d
Rename files according to review-finding;
joergdw d3b0803
Use again latest stemcell;
joergdw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,17 @@ | ||
| set -e -x | ||
|
|
||
| export GOROOT=$(readlink -nf /var/vcap/packages/golang-1-linux) | ||
| export PATH=$GOROOT/bin:$PATH | ||
| export GOPATH=${BOSH_COMPILE_TARGET} | ||
| export GOROOT=$(readlink --no-newline --canonicalize /var/vcap/packages/golang-1-linux) | ||
| export PATH="${GOROOT}/bin:${PATH}" | ||
| export GOPATH="${BOSH_COMPILE_TARGET}" | ||
| export GOCACHE=/tmp/gocache | ||
|
|
||
| pushd ${BOSH_COMPILE_TARGET}/autoscaler | ||
| pushd "${BOSH_COMPILE_TARGET}/autoscaler" | ||
| GOPROXY=off make build-api | ||
| popd | ||
|
|
||
| cp -a ${BOSH_COMPILE_TARGET}/autoscaler/build/api ${BOSH_INSTALL_TARGET} | ||
| cp -a ${BOSH_COMPILE_TARGET}/autoscaler/api/db/api.db.changelog.yml ${BOSH_INSTALL_TARGET} | ||
| cp -a ${BOSH_COMPILE_TARGET}/autoscaler/api/db/servicebroker.db.changelog.yaml ${BOSH_INSTALL_TARGET} | ||
|
|
||
| cp -a ${BOSH_COMPILE_TARGET}/autoscaler/api/policyvalidator/policy_json.schema.json ${BOSH_INSTALL_TARGET} | ||
| cp -a ${BOSH_COMPILE_TARGET}/autoscaler/api/schemas/catalog.schema.json ${BOSH_INSTALL_TARGET} | ||
|
|
||
|
|
||
| cp --archive "${BOSH_COMPILE_TARGET}/autoscaler/build/api" "${BOSH_INSTALL_TARGET}" | ||
| cp --archive "${BOSH_COMPILE_TARGET}/autoscaler/api/db/api.db.changelog.yml" "${BOSH_INSTALL_TARGET}" | ||
| cp --archive "${BOSH_COMPILE_TARGET}/autoscaler/api/db/servicebroker.db.changelog.yaml" "${BOSH_INSTALL_TARGET}" | ||
|
|
||
| cp --archive "${BOSH_COMPILE_TARGET}"/autoscaler/api/policyvalidator/*.json "${BOSH_INSTALL_TARGET}" | ||
| cp --archive "${BOSH_COMPILE_TARGET}/autoscaler/api/schemas/catalog.schema.json" "${BOSH_INSTALL_TARGET}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Read-me # | ||
|
|
||
| The currently used golang-library for json-schema, namely “[gojsonschema](<https://github.com/xeipuuv/gojsonschema>)” not seems to be capable to resolve references to other files correctly across different directories. Perhaps not limited to but especially when referencing up the file-system-hierarchy (parent-directories). In theory, symbolic links can be used to circumvent the issue … if there would not be another weakness in <https://github.com/cloudfoundry/bosh-compile-action> which we currently use in the workflow [bosh-release-checks.yaml](<../../../../.github/workflows/bosh-release-checks.yaml>) for making a compiled release: It can not handle symbolic links. Therefore it gets hard-linked here (which can not be tracked by git but it can somehow handle it!). | ||
|
|
||
| After phasing out the bosh-technology of “Application Autoscaler”, these hardlinks can be removed. | ||
|
|
||
| ⚠️ This means the consinstence needs to be ensured manually. There is no CI/CD-check because Bosh is already in its phase-out for “Application Autoscaler”. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-05/schema#", | ||
| "title": "Autoscaler Scaling Policy Configuration Schema", | ||
| "description": "Schema for the configuration options of scaling policy.", | ||
| "type": "object", | ||
|
|
||
| "properties": { | ||
| "custom_metrics": { | ||
| "type": "object", | ||
| "properties": { | ||
| "metric_submission_strategy": { | ||
| "type": "object", | ||
| "properties": { | ||
| "allow_from": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "bound_app", | ||
| "same_app" | ||
| ] | ||
| } | ||
| }, | ||
| "required": [ | ||
| "allow_from" | ||
| ] | ||
| } | ||
| }, | ||
| "required": [ | ||
| "metric_submission_strategy" | ||
| ], | ||
| "additionalProperties": false | ||
| }, | ||
| "app_guid": { | ||
| "$ref": "./shared_definitions.json#/schemas/guid" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "custom_metrics" | ||
| ], | ||
| "additionalProperties": false | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "schemas": { | ||
| "guid": { | ||
| "type": "string", | ||
| "description": "Unique identificator for a CF-resource, e.g. app, space, service-binding, …", | ||
| "pattern": "(\\d|[a-f]){8}-(\\d|[a-f]){4}-(\\d|[a-f]){4}-(\\d|[a-f]){4}-(\\d|[a-f]){12}", | ||
| "example": "8d0cee08-23ad-4813-a779-ad8118ea0b91" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/autoscaler/api/policyvalidator/policy-configuration.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-05/schema#", | ||
| "title": "Autoscaler Scaling Policy Configuration Schema", | ||
| "description": "Schema for the configuration options of scaling policy.", | ||
| "type": "object", | ||
|
|
||
| "properties": { | ||
| "custom_metrics": { | ||
| "type": "object", | ||
| "properties": { | ||
| "metric_submission_strategy": { | ||
| "type": "object", | ||
| "properties": { | ||
| "allow_from": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "bound_app", | ||
| "same_app" | ||
| ] | ||
| } | ||
| }, | ||
| "required": [ | ||
| "allow_from" | ||
| ] | ||
| } | ||
| }, | ||
| "required": [ | ||
| "metric_submission_strategy" | ||
| ], | ||
| "additionalProperties": false | ||
| }, | ||
| "app_guid": { | ||
| "$ref": "./shared_definitions.json#/schemas/guid" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "custom_metrics" | ||
| ], | ||
| "additionalProperties": false | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.