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

[Main][Task]28736784: Update the Config Used for Type Docs with Test Web Config Endpoint #2403

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,13 @@ module.exports = function (grunt) {
{ src: "./tools/config/config.json", dest: `./tools/config/browser/es5/ai.config${configVer}.cfg.json` },
{ src: "./tools/config/config.json", dest: `./tools/config/browser/es5/ai.config${configMajorVer}.cfg.json` }
]
},

testConfig: {
files: [
{ src: "./tools/config/test-config.json", dest: `./tools/config/browser/es5/ai_test.config${configVer}.cfg.json` },
{ src: "./tools/config/test-config.json", dest: `./tools/config/browser/es5/ai_test.config${configMajorVer}.cfg.json` }
]
}
}
}));
Expand Down Expand Up @@ -955,6 +962,7 @@ module.exports = function (grunt) {
grunt.registerTask("serve", ["connect:server:keepalive"]);

grunt.registerTask("copy-config", ["copy:config"]);
grunt.registerTask("copy-testConfig", ["copy:testConfig"]);

grunt.registerTask("example-aisku", tsBuildActions("example-aisku"));
grunt.registerTask("example-dependency", tsBuildActions("example-dependency"));
Expand Down
3 changes: 2 additions & 1 deletion tools/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
},
"scripts": {
"clean": "git clean -xdf",
"build": "npm run build:browser",
"build": "npm run build:browser && npm run build:test",
"build:browser": "grunt copy-config",
"build:test": "grunt copy-testConfig",
"rebuild": "npm run build",
"test": ""
},
Expand Down
42 changes: 42 additions & 0 deletions tools/config/test-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "1.0.0",
"enabled": true,
"featureOptIn": {
"iKeyUsage": {
"mode": 3,
"onCfg": {
"throttleMgrCfg.109.disabled": false,
"throttleMgrCfg.106.disabled": false
},
"offCfg": {
"throttleMgrCfg.109.disabled": true,
"throttleMgrCfg.106.disabled": true
}
}
},
"config": {
"throttleMgrCfg": {
"109": {
"disabled": false,
"limit": {
"samplingRate": 2000000,
"maxSendNumber": 1
},
"interval": {
"dayInterval": 2
}
},
"106": {
"disabled": false,
"limit": {
"samplingRate": 1,
"maxSendNumber": 1
},
"interval": {
"monthInterval": 2,
"daysOfMonth": [1]
}
}
}
}
}
4 changes: 3 additions & 1 deletion tools/github-page-script-injection/injectScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ let scriptContent = fs.readFileSync(scriptFilePath, 'utf8');
// Replace the placeholder string with the actual connection string
const connectionString = 'InstrumentationKey=1ae9e7ce-18f1-4e14-8fc0-acbf0ed28895;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/';
let iKeyForCfgSync = "1ae9e7ce-18f1-4e14-8fc0-acbf0ed28895";
scriptContent = scriptContent.replace(`connectionString: "YOUR_CONNECTION_STRING"`, `instrumentationKey: "${iKeyForCfgSync}",\n \texpCfg: {\n\t\tinclScripts: true,\n\t\t\n\t\tmaxLogs: 100},\n\t\textensionConfig: {\n\t\t\t"AppInsightsCfgSyncPlugin": {\n\t\t\t\tcfgUrl:"https://js.monitor.azure.com/beta/ai.config.1.cfg.json"\n\t\t\t}\n\t\t}`);
//let cfgUrl = "https://js.monitor.azure.com/beta/ai.config.1.cfg.json";
let cfgUrl = "https://js.monitor.azure.com/nightly/ai_test.config.1-nightly3.cfg.json";
scriptContent = scriptContent.replace(`connectionString: "YOUR_CONNECTION_STRING"`, `instrumentationKey: "${iKeyForCfgSync}",\n \texpCfg: {\n\t\tinclScripts: true,\n\t\t\n\t\tmaxLogs: 100},\n \t\textensionConfig: {\n\t\t\t"AppInsightsCfgSyncPlugin": {\n\t\t\t\tcfgUrl:"${cfgUrl}"\n\t\t\t}\n\t\t}`);
//scriptContent = scriptContent.replace('YOUR_CONNECTION_STRING', connectionString);
scriptContent = `<script type="text/javascript">${scriptContent}</script>`;

Expand Down
Loading