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

Adding http proxy environment variables to Azure CLI V2 #18295

Merged
merged 40 commits into from
Sep 12, 2023
Merged

Adding http proxy environment variables to Azure CLI V2 #18295

merged 40 commits into from
Sep 12, 2023

Conversation

ycamargo
Copy link
Contributor

Task name: Azure CLI V2

Description: Adding http proxy environment variables (http_proxy and https_proxy) to azureclitask.ts when proxy configuration is present.

Documentation changes required: (Y/N) N

Added unit tests: (Y/N) N

Attached related issue: (Y/N) Azure CLI Extension V2 is not respecting the .proxy file...

Checklist:

  • Task version was bumped - please check instruction how to do it
  • Checked that applied changes work as expected

Adding http proxy environment variables (http_proxy and https_proxy) to azureclitask.ts when proxy configuration is present.
@ycamargo
Copy link
Contributor Author

@microsoft-github-policy-service agree

@ycamargo
Copy link
Contributor Author

@rvairavelu / @manolerazvan could one of you please review and approve this PR?

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@ycamargo
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 18295 in repo microsoft/azure-pipelines-tasks

@v-mohithgc
Copy link
Contributor

Hi @ycamargo , firstly thanks for contributing here.
Looks like there is a build failure because of the changes done in this PR.
Please fix and follow the below steps:

If you have cloned this repo locally, navigate to the root directory (ie C:...\azure-pipelines-tasks>)

Execute this build command " node make.js build --task AzureCLIV2 " //ensure to use node 8/10, else the command fails.
Once the build is completed/successful, commit the changes to this branch.
Thanks

@v-mohithgc
Copy link
Contributor

v-mohithgc commented Jul 28, 2023

Build failure detail:

2023-07-28T05:21:34.6058540Z Building: AzureCLIV2
2023-07-28T05:21:34.6058947Z ------------------------------------------------------------
2023-07-28T05:21:34.6110704Z
2023-07-28T05:21:34.6111747Z > cd Tasks/AzureCLIV2
2023-07-28T05:21:34.6112155Z Detected Typescript version: 4.0.2
2023-07-28T05:21:34.6112335Z
2023-07-28T05:21:34.6112571Z > npm install
2023-07-28T05:21:38.4194999Z
2023-07-28T05:21:38.4196828Z > cd Tests
2023-07-28T05:21:38.4199852Z
2023-07-28T05:21:38.4200503Z > npm install
2023-07-28T05:21:39.3611668Z
2023-07-28T05:21:39.3613715Z > cd ..
2023-07-28T05:21:39.3617987Z
2023-07-28T05:21:39.3619402Z > node /home/vsts/work/1/s/Tasks/AzureCLIV2/node_modules/typescript/bin/tsc --outDir "/home/vsts/work/1/s/_build/Tasks/AzureCLIV2" --rootDir "/home/vsts/work/1/s/Tasks/AzureCLIV2"
2023-07-28T05:21:47.8136119Z ,azureclitask.ts(19,28): error TS2339: Property 'getProxyConfiguration' does not exist on type 'typeof import("/home/vsts/work/1/s/Tasks/AzureCLIV2/node_modules/azure-pipelines-task-lib/task")'.
2023-07-28T05:21:47.8137772Z ,

2023-07-28T05:21:47.8276890Z ##[error]Bash exited with code '1'.
2023-07-28T05:21:47.8343199Z ##[section]Finishing: Build Tasks

@ycamargo
Copy link
Contributor Author

Hi @ycamargo , firstly thanks for contributing here. Looks like there is a build failure because of the changes done in this PR. Please fix and follow the below steps:

If you have cloned this repo locally, navigate to the root directory (ie C:...\azure-pipelines-tasks>)

Execute this build command " node make.js build --task AzureCLIV2 " //ensure to use node 8/10, else the command fails. Once the build is completed/successful, commit the changes to this branch. Thanks

Hi @v-mohithgc,
I found the issue. There is a problem on the documentation of the Proxy module that drove me to write this wrongfully.
I have even opened a new issue on the azure-pipelines-task-lib repo to fix the documentation.

I've fixed it and built locally without any issues (see evidence below).

C:\git\github\azure-pipelines-tasks>node make.js build --task AzureCLIV2

> prepending PATH C:\git\github\azure-pipelines-tasks\node_modules\.bin
tsc tool:
Version 4.0.2
C:\GIT\GITHUB\AZURE-PIPELINES-TASKS\NODE_MODULES\.BIN\TSC.CMD
npm tool:
6.14.12
C:\PROGRAM FILES\NODEJS\NPM.CMD

------------------------------------------------------------
Building: AzureCLIV2
------------------------------------------------------------

> cd Tasks\AzureCLIV2
Detected Typescript version: 4.0.2

> npm install

> cd Tests

> npm install

> cd ..

> node C:\git\github\azure-pipelines-tasks\Tasks\AzureCLIV2\node_modules\typescript\bin\tsc --outDir "C:\git\github\azure-pipelines-tasks\_build\Tasks\AzureCLIV2" --rootDir "C:\git\github\azure-pipelines-tasks\Tasks\AzureCLIV2"

> cd ..\..

> copying task resources
copying *.ps1
copying *.psd1
copying *.psm1
copying *.sh
copying *.txt
copying icon.png
copying icon.svg
copying module.json
copying node_modules
copying package.json
copying Strings
copying task.json
copying task.loc.json
copying Tests

Build successful

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@kirill-ivlev
Copy link
Contributor

kirill-ivlev commented Sep 6, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@v-mohithgc
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@v-mohithgc v-mohithgc merged commit d2cd595 into microsoft:master Sep 12, 2023
8 checks passed
@v-mohithgc v-mohithgc added Area:RM RM task team Task:AzureCLI Area:RM, Owners: @rvairavelu @manolerazvan labels Sep 13, 2023
merlynomsft added a commit that referenced this pull request Sep 28, 2023
ghost pushed a commit that referenced this pull request Oct 2, 2023
)

* Revert "Adding http proxy environment variables to Azure CLIV2 (#18295)"

This reverts commit d2cd595.

* Update task.json

* Update task.loc.json

* CI

* reset root package-lock.json

---------

Co-authored-by: Mohith <97882857+v-mohithgc@users.noreply.github.com>
Co-authored-by: Ozan AYDIN <ozanaydin@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:RM RM task team Task:AzureCLI Area:RM, Owners: @rvairavelu @manolerazvan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants