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

File Transform (JSON) same name different shape across files #11344

Closed
staff0rd opened this issue Sep 15, 2019 · 2 comments
Assignees
Labels

Comments

@staff0rd
Copy link

@staff0rd staff0rd commented Sep 15, 2019

Question, Bug, or Feature?
Type: Question/Feature
Enter Task Name: FileTransform

Environment

Azure Pipelines

  • staff0rd/5
  • Hosted/ubuntu-latest

Issue Description

A tfx extension for Azure Pipelines requires a manifest.json with a version: "1.0.0" format and a taskName/task.json with a version: { Major: 1, Minor: 0, Patch: 0} format.

I can define the following;

variables:
- group: my-group
- name: version.Major
  value: 1
- name: version.Minor
  value: 1
- name: version.Patch
  value: $(Build.BuildId)
- name: version
  value: $(Build.BuildNumber)

But the result after running FileTransform is:
EXPECTED: manifest.json has version: "1.0.0" and task.json has version: { Major: 1, Minor: 0, Patch: 0}
ACTUAL: manifest.json has version: "1.0.0" and task.json has version: "1.0.0"

Example yaml

@SumiranAgg

This comment has been minimized.

Copy link
Contributor

@SumiranAgg SumiranAgg commented Sep 16, 2019

This is happening because you have a variable 'version' defined. This key is present in both manifest.json and task.json. In manifest.json it substitutes the value of version key which is desirable, when it does the same for task.json it causes an issue in this case. As a workarounf you can configure two jobs with file transform tasks, and define job level varibales. Ref doc: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch

@SumiranAgg

This comment has been minimized.

Copy link
Contributor

@SumiranAgg SumiranAgg commented Sep 18, 2019

Closing the issue, since it is by design. please feel free to re-open if required.

@SumiranAgg SumiranAgg closed this Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.