@grafana/plugin-e2e 3.4.1 → 3.4.2-canary.2512.22713052102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,11 @@ const ALERTING_DIR = "alerting";
|
|
|
8
8
|
const readProvisionedAlertRule = async ({ provisioningRootDir }, use) => {
|
|
9
9
|
await use(async ({ fileName, groupName, ruleTitle }) => {
|
|
10
10
|
const resolvedPath = path.resolve(path.join(provisioningRootDir, ALERTING_DIR, fileName));
|
|
11
|
-
const
|
|
11
|
+
const raw = await fs.promises.readFile(resolvedPath, "utf8");
|
|
12
|
+
const contents = raw.replace(/\$\{(\w+)(?::-(.*?))?\}|\$(\w+)/g, (_, braced, fallback, plain) => {
|
|
13
|
+
const varName = braced ?? plain;
|
|
14
|
+
return process.env[varName] ?? fallback ?? "";
|
|
15
|
+
});
|
|
12
16
|
const yml = yaml.parse(contents);
|
|
13
17
|
let group = yml.groups[0];
|
|
14
18
|
if (groupName) {
|
|
@@ -8,7 +8,11 @@ const DATASOURCES_DIR = "datasources";
|
|
|
8
8
|
const readProvisionedDataSource = async ({ provisioningRootDir }, use) => {
|
|
9
9
|
await use(async ({ fileName: filePath, name }) => {
|
|
10
10
|
const resolvedPath = path.resolve(path.join(provisioningRootDir, DATASOURCES_DIR, filePath));
|
|
11
|
-
const
|
|
11
|
+
const raw = await fs.promises.readFile(resolvedPath, "utf8");
|
|
12
|
+
const contents = raw.replace(/\$\{(\w+)(?::-(.*?))?\}|\$(\w+)/g, (_, braced, fallback, plain) => {
|
|
13
|
+
const varName = braced ?? plain;
|
|
14
|
+
return process.env[varName] ?? fallback ?? "";
|
|
15
|
+
});
|
|
12
16
|
const yml = yaml.parse(contents);
|
|
13
17
|
if (!name) {
|
|
14
18
|
return yml.datasources[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2-canary.2512.22713052102.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"uuid": "^13.0.0",
|
|
52
52
|
"yaml": "^2.3.4"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "b07e5e32bac921502e2e7e6dcaed84183467e5e9"
|
|
55
55
|
}
|