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

refactor: Inline yaml templates and fix bug #23418

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

alexvy86
Copy link
Contributor

@alexvy86 alexvy86 commented Dec 31, 2024

Description

The upload-json-steps.yml and download-api-extractor-artifact.yml templates were not really that reusable so this PR inlines them into the single pipeline that uses them.

It also fixes a bug that caused the JSON artifacts to never be published as latest-v<major>.tar.gz because we were trying to use a variable that only exists at runtime (dependencies.check_branch_version.outputs['SetShouldDeploy.shouldDeploy']) in a "compile-time" condition in upload-json-steps.yml. The condition was thus never true, and the step under it was never present in the pipeline. So I replaced a couple of compile-time conditionals with condition: nodes in the corresponding tasks, which should make the tasks always appear in the pipeline, but get skipped unless the specified conditions are true.

Reviewer Guidance

The review process is outlined on this wiki page.

AB#6846

@alexvy86 alexvy86 requested review from Copilot, sonalideshpandemsft and a team December 31, 2024 20:52
@github-actions github-actions bot added the area: build Build related issues label Dec 31, 2024
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 3 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • tools/pipelines/templates/download-api-extractor-artifact.yml: Language not supported
  • tools/pipelines/templates/upload-json-steps.yml: Language not supported
Comments suppressed due to low confidence (1)

tools/pipelines/publish-api-model-artifact.yml:134

  • [nitpick] The variable name 'isLatestMinorOfMajorTrain' should be verified to ensure it accurately reflects its purpose in the context.
isLatestMinorOfMajorTrain: $[ dependencies.check_branch_version.outputs['SetShouldDeploy.shouldDeploy'] ]

@github-actions github-actions bot added the base: main PRs targeted against main branch label Dec 31, 2024
Comment on lines -65 to -66
- name: isMain
value: ${{ eq(variables['Build.SourceBranchName'], 'main') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inlined below. Single use, and it's pretty self-explanatory.

Comment on lines +143 to +149
- task: Bash@3
displayName: 'Print computed variables'
inputs:
targetType: 'inline'
script: |
echo "isLatestMinorOfMajorTrain: $(isLatestMinorOfMajorTrain)"
echo "majorVersion: $(majorVersion)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this new bit for troubleshooting

archiveFile: '$(Pipeline.Workspace)/$(Build.SourceVersion).tar.gz'
replaceExistingArchive: true
verbose: true # Optional
#quiet: # Optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: quiet can be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, I kept it just to keep the changes to the minimum necessary to simplify review. I'll merge like this for now.

@alexvy86
Copy link
Contributor Author

alexvy86 commented Jan 2, 2025

@microsoft-github-policy-service rerun

@alexvy86 alexvy86 merged commit 9040799 into microsoft:main Jan 2, 2025
33 checks passed
@alexvy86 alexvy86 deleted the inline-yaml branch January 2, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants