This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow extra root properties in configuration file
This enables other tools to store data in the configuration file. Nonetheless, the user will see a message (at the INFO level) for configuration fields which are not understood by the agent. This is to help diagnose unexpected outcomes while applying the agent.
- Loading branch information
Showing
5 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -406,7 +406,6 @@ | |
|
||
- $id: config | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
# server | ||
agent: {$ref: agent} | ||
|
This file contains 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 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,4 +1,5 @@ | ||
branches: [test, node, browser] | ||
dependencies: | ||
- util | ||
- log | ||
- expect |
This file contains 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 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,13 +1,20 @@ | ||
import { assertThrow } from "../../__fixture__.mjs"; | ||
import { assertEqual, assertThrow } from "../../__fixture__.mjs"; | ||
import { buildTestDependenciesAsync } from "../../build.mjs"; | ||
import Validation from "./index.mjs"; | ||
|
||
const { validateConfig } = Validation( | ||
await buildTestDependenciesAsync(import.meta.url), | ||
); | ||
|
||
assertEqual( | ||
validateConfig({ extra: "extra-root-property" }), | ||
undefined, | ||
); | ||
|
||
assertThrow(() => { | ||
validateConfig({ mode: "invalid-mode" }); | ||
validateConfig("invalid-configuration-type"); | ||
}, /^AppmapError: invalid configuration\n/u); | ||
|
||
assertThrow(() => { | ||
validateConfig({ engine: "invalid-engine-format" }); | ||
}, /^AppmapError: invalid configuration\n/u); |