Skip to content

Commit

Permalink
Revert "[BashV3] reverse feature flags default (#18323)"
Browse files Browse the repository at this point in the history
This reverts commit b83760b.
  • Loading branch information
KonstantinTyukalov committed May 30, 2023
1 parent 22cb5e9 commit a982a6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
3 changes: 0 additions & 3 deletions Tasks/BashV3/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ describe('Bash Suite', function () {

it('Runs a checked in script correctly', (done: Mocha.Done) => {
delete process.env['AZP_BASHV3_OLD_SOURCE_BEHAVIOR'];
process.env['AZP_TASK_FF_BASHV3_ENABLE_SECURE_ARGS'] = 'false'
let tp: string = path.join(__dirname, 'L0External.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

Expand All @@ -56,7 +55,6 @@ describe('Bash Suite', function () {

it('Runs a checked in script correctly when using the old behavior', (done: Mocha.Done) => {
process.env['AZP_BASHV3_OLD_SOURCE_BEHAVIOR'] = "true";
process.env['AZP_TASK_FF_BASHV3_ENABLE_SECURE_ARGS'] = 'false'
let tp: string = path.join(__dirname, 'L0External.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

Expand All @@ -78,7 +76,6 @@ describe('Bash Suite', function () {

it('Adds arguments to the script', (done: Mocha.Done) => {
delete process.env['AZP_BASHV3_OLD_SOURCE_BEHAVIOR'];
process.env['AZP_TASK_FF_BASHV3_ENABLE_SECURE_ARGS'] = 'false'
let tp: string = path.join(__dirname, 'L0Args.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

Expand Down
12 changes: 4 additions & 8 deletions Tasks/BashV3/bash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { processBashEnvVariables } from './bashEnvProcessor';
var uuidV4 = require('uuid/v4');

const featureFlags = {
enableTelemetry: getFeatureFlagValue('AZP_TASK_FF_BASHV3_ENABLE_INPUT_ARGS_TELEMETRY', true),
enableSecureArgs: getFeatureFlagValue('AZP_TASK_FF_BASHV3_ENABLE_SECURE_ARGS', true)
enableTelemetry: getFeatureFlagValue('AZP_TASK_FF_BASHV3_ENABLE_INPUT_ARGS_TELEMETRY'),
enableSecureArgs: getFeatureFlagValue('AZP_TASK_FF_BASHV3_ENABLE_SECURE_ARGS')
}

async function translateDirectoryPath(bashPath: string, directoryPath: string): Promise<string> {
Expand Down Expand Up @@ -232,14 +232,10 @@ async function run() {
}
}

function getFeatureFlagValue(featureFlagName: string, defaultValue: boolean = false): boolean {
function getFeatureFlagValue(featureFlagName: string): boolean {
const ffValue = process.env[featureFlagName]

if (!ffValue) {
return defaultValue
}

return ffValue.toLowerCase() === "true"
return ffValue ? ffValue.toLowerCase() === "true" : false
}

run();
2 changes: 1 addition & 1 deletion Tasks/BashV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 3,
"Minor": 222,
"Patch": 1
"Patch": 0
},
"releaseNotes": "Script task consistency. Added support for multiple lines and added support for Windows.",
"minimumAgentVersion": "2.115.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/BashV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 3,
"Minor": 222,
"Patch": 1
"Patch": 0
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"minimumAgentVersion": "2.115.0",
Expand Down

0 comments on commit a982a6a

Please sign in to comment.