microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.47k stars 2.61k forks source link

[BUG]: Object parameter between pipeline and template converts "3.10" to "3.1" #20050

Open gianfaProm opened 3 months ago

gianfaProm commented 3 months ago

New issue checklist

Task name

No response

Task version

No response

Issue Description

The behavior is as follows, in brief. Given a object parameter, say pythonVersions, made by key (name) values (py ver):

It appears to be a bug in object parsing between pipeline and templates, particularly the zero of the decimal ten.

Here a repository to fully reproduce the issue is provided azure_object_parsing.zip

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu-22.04

Relevant log output

##[warning]You should provide GitHub token if you want to download a python release. Otherwise you may hit the GitHub anonymous download limit.
##[error]Failed to download Python from the Github Actions python registry (https://github.com/actions/python-versions). Error: Error: Could not find Python matching spec 3.1 (x64) in the python-versions registry. Beware that only systems listed in the Github Actions python versions manifest (https://github.com/actions/python-versions/blob/main/versions-manifest.json) are fit for downloading python on-flight. Also, proxy is not supported.
##[error]Version spec 3.1 for architecture x64 did not match any version in Agent.ToolsDirectory.
Versions in /opt/hostedtoolcache:

3.10.14 (x64)
3.11.9 (x64)
3.12.4 (x64)
3.7.17 (x64)
3.8.18 (x64)
3.9.19 (x64)
If this is a Microsoft-hosted agent, check that this image supports side-by-side versions of Python at https://aka.ms/hosted-agent-software.
If this is a self-hosted agent, see how to configure side-by-side Python versions at https://go.microsoft.com/fwlink/?linkid=871498.

Full task logs with system.debug enabled

No response

Repro steps

No response

v-schhabra commented 3 months ago

Hi @gianfaProm Could you please share the task which you are using in the pipeline?

gianfaProm commented 3 months ago

Hi @v-schhabra , thanks for the reply, I am using UsePythonVersion@0. I also shared a .zip from which to reproduce the behavior, if that helps.

In any case at first glance it would seem to be more of an object passing problem between pipeline and template, rather than a usePythonVersion problem, but maybe I'm wrong

v-schhabra commented 3 months ago

Hi @microsoft/akvelon-build-task-team Could you please take a look at this issue?

ismayilov-ismayil commented 3 months ago

Hi @gianfaProm thanks for reporting! We are working on more prioritized issues at the moment, but will get back to this one soon.