question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XamarinAndroid@1 replaces target project with wildcards when using secret variables.

See original GitHub issue

Question, Bug, or Feature?
Bug

Enter Task Name: XamarinAndroid@1

list here (V# not needed):
https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/XamarinAndroidV1

Environment

  • Server - Azure Pipelines

Issue Description

Linking a Variable Group that contains Secret variables to a Pipeline causes the XamarinAndroid@1 task to replace the project specified on the MSBuild.exe command line with wildcards. So "d:\a\1\s\Hylink\Hylink.Android\Hylink.Android.csproj" becomes "D:\a\1\s\Hylink\***\***.csproj.

  1. Construct a classic pipeline using the prepackaged Xamarin.Android template to build a Xamarin.Forms project.
  2. Create a new variable group
  3. Add (in our case we have 2 variables) secret variables and values, such as keystore.password and keystore.alias.
  4. Link that variable group to the pipeline. The variables need not be used by the pipeline.
  5. Save and Run the build.

If the pipeline is executed without the linked variables the output from the XamarinAndroid@1 task will be as follows: 2020-07-22T22:38:45.2820750Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" "d:\a\1\s\Hylink\Hylink.Android\Hylink.Android.csproj" /nologo /nr:false /t:"Clean" /dl:CentralLogger,

If you link the variable group previously created to the pipeline the project path and name is replaced with a set of wildcards: 2020-07-22T22:48:32.3241088Z ##[command]"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" "D:\a\1\s\Hylink\***\***.csproj" /nologo /nr:false /t:"Clean" /dl:CentralLogger,

In our situation both builds complete with output that seems to be correct and similar. Assuming that it is actually using wildcards (and building all .csproj files) our build would probably fail if not for the fact that some projects are disabled in the configuration manager.

Task logs

BuildwithSecretVariables_logs_749.zip BuildwithoutSecretVariables_logs_750.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bakerhillpinscommented, Aug 18, 2020

@leantk Your description was a bit unclear to me and I had to read it several times to understand. However, I understand now… The values of secret variables are scrubbed from the log output using a simple string search algo.

Thus all pipeline output is subject to a search and replace operation, where any linked secret variable’s value is replaced with “***” in the output.

In this case a secret variable used had it’s value set to the name of a project, “Hylink.Android”, and thus anytime that string exists in the output it was scrubbed.

Thanks for clarifying this. Might be worth an update to the documentation.

0reactions
leantkcommented, Aug 18, 2020

Yep that’s a good suggestion on the docs. I’ll take note of making an update. I’m going to close this out then but if you have more questions, please feel free to comment

Read more comments on GitHub >

github_iconTop Results From Across the Web

eq() function does not support glob/wildcard
The eq() function, as used in a condition in `azure-pipelines.yml`, does not match using wildcard or glob logic. For example, this job will...
Read more >
Wildcard filter variables | Adobe Workfront - Experience League
By using wildcards in filters, you can reference a generic user or date instead of a specific user or date. In this way,...
Read more >
Using Wild Card Characters - TIBCO Product Documentation
The wild card characters '*' and '?' can be used when filtering on text attributes (work item name, description, etc.) — wild card...
Read more >
Improve how to select an environment variable wildcard - GitLab
Maybe we can do this: fetch existing environments for the project; fetch environments names set for other secret variables; populate the list ...
Read more >
Wildcard Function (GNU make)
But wildcard expansion does not normally take place when a variable is set, or inside the ... This string, used anywhere in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found