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

AzureKeyVault@2: remove duplicate %AZP25 encoding #17566

Merged
merged 7 commits into from
Jan 6, 2023

Conversation

onetocny
Copy link
Contributor

@onetocny onetocny commented Jan 5, 2023

Task name: AzureKeyVault@2

Description:

This issue occurs on both release and build pipelines. In general the problem is that since certain moment build agents started to require % character coming in as values of variables be encoded as %AZP25. See more details here. Originally this was not done automatically by azure-pipelines-task-lib in tl.setVartiable. Thus it was implemented by AzureKeyVault@2 task itself (all % are encoded as %AZP25 before calling setVariable). Later this functionality was introduced even by azure-pipelines-task-lib so that latest versions of tl.setVariable does this encoding automatically. Once we have updated AKV task to use the latest version of azure-pipelines-task-lib % character started to be encoded two times. See this example:

  1. Original value of variable: "hello%world",
  2. Encoded by AKV: "hello%AZP25world" (% was replaced by %AZP25),
  3. Encoded and stored by task lib: "hello%AZP25AZP25world" (% was again replaced by %AZP25)
  4. When retrieved by tl.getVariable: "hello%AZP25world" (%AZP25 was replaced by %).

Documentation changes required: N

Added unit tests: N

Attached related issue: https://dev.azure.com/mseng/AzureDevOps/_workitems/edit/2019418

Checklist:

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

@onetocny onetocny requested review from a user and kirill-ivlev January 5, 2023 11:50
@onetocny onetocny changed the title AzureKeyVault@2 remove duplicate %AZP25 encoding AzureKeyVault@2: remove duplicate %AZP25 encoding Jan 5, 2023
@onetocny onetocny marked this pull request as ready for review January 5, 2023 11:58
@onetocny onetocny requested a review from max-zaytsev January 6, 2023 07:06
@onetocny onetocny merged commit f9d1f08 into master Jan 6, 2023
@onetocny onetocny deleted the users/onetocny/fix-akv-percents branch January 6, 2023 09:55
weshaggard added a commit to Azure/azure-sdk-for-net that referenced this pull request Feb 9, 2023
After the changes to the KeyVault task at microsoft/azure-pipelines-tasks#17566 we need to remove this opt-out otherwise we now end up with values that are not decoded which need to be. This became an issue for any values with a % that were set with the VSO setvariable syntax.
weshaggard added a commit to Azure/azure-sdk-for-net that referenced this pull request Feb 9, 2023
After the changes to the KeyVault task at microsoft/azure-pipelines-tasks#17566 we need to remove this opt-out otherwise we now end up with values that are not decoded which need to be. This became an issue for any values with a % that were set with the VSO setvariable syntax.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants