-
Notifications
You must be signed in to change notification settings - Fork 138
Adds validation whether the execution.*.target exists #481
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
Merged
tarunramsinghani
merged 5 commits into
microsoft:master
from
jessehouwing:features/validateExecutionTarget
Apr 10, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fd3c61c
Fixing line endings
jessehouwing 3f8794f
fixing line endings
jessehouwing 10fff44
Adds validation whether the execution.*.target exists
jessehouwing 9a8fae4
Update jsonvalidate.ts
jessehouwing 0aa3310
Merge branch 'master' into features/validateExecutionTarget
tarunramsinghani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
# Common steps template | ||
# | ||
# Things which happen regardless of CI, PR, or release builds | ||
steps: | ||
- checkout: self | ||
clean: true | ||
- task: NodeTool@0 | ||
displayName: Use node 10 | ||
inputs: | ||
versionSpec: "10.x" | ||
- task: NpmAuthenticate@0 | ||
inputs: | ||
workingFile: .npmrc | ||
- script: npm i -g npm@6.14.12 --force | ||
displayName: Use npm version 6.14.12 | ||
- bash: | | ||
npm ci | ||
npm run build | ||
displayName: Build TFX CLI | ||
# Generate a pipeline artifact so we can publish the package manually if there are issues with automation | ||
- bash: | | ||
npm pack | ||
cp *.tgz '$(Build.ArtifactStagingDirectory)' | ||
displayName: Run npm-pack and copy to ArtifactStagingDirectory | ||
# Common steps template | ||
# | ||
# Things which happen regardless of CI, PR, or release builds | ||
steps: | ||
- checkout: self | ||
clean: true | ||
|
||
- task: NodeTool@0 | ||
displayName: Use node 10 | ||
inputs: | ||
versionSpec: "10.x" | ||
|
||
- task: NpmAuthenticate@0 | ||
inputs: | ||
workingFile: .npmrc | ||
|
||
- script: npm i -g npm@6.14.12 --force | ||
displayName: Use npm version 6.14.12 | ||
|
||
- bash: | | ||
npm ci | ||
npm run build | ||
displayName: Build TFX CLI | ||
|
||
# Generate a pipeline artifact so we can publish the package manually if there are issues with automation | ||
- bash: | | ||
npm pack | ||
cp *.tgz '$(Build.ArtifactStagingDirectory)' | ||
displayName: Run npm-pack and copy to ArtifactStagingDirectory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,109 @@ | ||
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. | ||
# This pipeline will be extended to the OneESPT template | ||
|
||
trigger: none | ||
|
||
variables: | ||
- group: npm-tokens | ||
resources: | ||
repositories: | ||
- repository: 1esPipelines | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
extends: | ||
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines | ||
parameters: | ||
settings: | ||
skipBuildTagsForGitHubPullRequests: true | ||
|
||
pool: | ||
name: 1ES-ABTT-Shared-Pool | ||
image: abtt-windows-2022 | ||
os: windows | ||
stages: | ||
- stage: Build | ||
displayName: Build the tfx-cli npm package | ||
jobs: | ||
- job: build | ||
templateContext: | ||
outputs: | ||
- output: pipelineArtifact | ||
displayName: 'Publish tfx-cli package to pipeline artifacts' | ||
targetPath: '$(Build.ArtifactStagingDirectory)' | ||
artifactType: 'pipeline' | ||
artifactName: 'tfx-cli-package' | ||
steps: | ||
- template: /.azure-pipelines/common-steps.yml@self | ||
- ${{ if in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual') }}: | ||
# Validate and publish packages | ||
# The npm cli will replace ${NPM_TOKEN} with the contents of the NPM_TOKEN environment variable. | ||
- bash: | | ||
echo '//registry.npmjs.org/:_authToken=$(npm-automation.token)' > .npmrc | ||
|
||
npm publish --ignore-scripts --tag prerelease | ||
exit_status=$? | ||
if [ $exit_status -eq 1 ]; then | ||
echo "##vso[task.logissue type=warning]Publishing TFX CLI was unsuccessful" | ||
echo "##vso[task.complete result=SucceededWithIssues;]" | ||
fi | ||
|
||
rm .npmrc | ||
displayName: Publish TFX CLI to npm | ||
condition: eq(variables['Build.SourceBranchName'], 'master') | ||
|
||
# Install node 16 for CodeQL 3000 | ||
- task: NodeTool@0 | ||
displayName: Use node 16 | ||
inputs: | ||
versionSpec: "16.x" | ||
- stage: Release | ||
displayName: Release to Latest | ||
trigger: manual | ||
jobs: | ||
- job: Release | ||
displayName: Release to Latest | ||
steps: | ||
- checkout: self | ||
clean: true | ||
|
||
- task: NodeTool@0 | ||
displayName: Use node 16 | ||
inputs: | ||
versionSpec: "16.x" | ||
- script: npm i -g npm@8.19.4 --force | ||
displayName: Use npm version 8.19.4 | ||
|
||
- bash: | | ||
echo '//registry.npmjs.org/:_authToken=$(npm-automation.token)' > .npmrc | ||
# Run the npm command and capture the output | ||
output=$(npm pkg get name version) | ||
echo "${output}" | ||
|
||
# Extract the name and version values using shell parameter expansion | ||
name=$(echo "$output" | grep -o '"name":\s*"[^"]*"' | sed 's/"name":\s*"\([^"]*\)"/\1/') | ||
version=$(echo "$output" | grep -o '"version":\s*"[^"]*"' | sed 's/"version":\s*"\([^"]*\)"/\1/') | ||
|
||
# Save them in a variable in the format name@version | ||
result="${name}@${version}" | ||
|
||
# Combine them in the format name@version | ||
echo "${result}" | ||
|
||
npm dist-tag add "$result" latest | ||
exit_status=$? | ||
if [ $exit_status -eq 1 ]; then | ||
echo "##vso[task.logissue type=error]Upgrading TFX CLI to latest was unsuccessful" | ||
echo "##vso[task.complete result=Failed;]" | ||
exit 1 | ||
fi | ||
|
||
npm dist-tag remove "$result" prerelease | ||
exit_status=$? | ||
if [ $exit_status -eq 1 ]; then | ||
echo "##vso[task.logissue type=error]Removing prerelease for TFX CLI was unsuccessful" | ||
echo "##vso[task.complete result=SucceededWithIssues;]" | ||
fi | ||
rm .npmrc | ||
displayName: Publish TFX CLI to npm | ||
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. | ||
# This pipeline will be extended to the OneESPT template | ||
|
||
trigger: none | ||
|
||
variables: | ||
- group: npm-tokens | ||
resources: | ||
repositories: | ||
- repository: 1esPipelines | ||
type: git | ||
name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
ref: refs/tags/release | ||
extends: | ||
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines | ||
parameters: | ||
settings: | ||
skipBuildTagsForGitHubPullRequests: true | ||
|
||
pool: | ||
name: 1ES-ABTT-Shared-Pool | ||
image: abtt-windows-2022 | ||
os: windows | ||
stages: | ||
- stage: Build | ||
displayName: Build the tfx-cli npm package | ||
jobs: | ||
- job: build | ||
templateContext: | ||
outputs: | ||
- output: pipelineArtifact | ||
displayName: 'Publish tfx-cli package to pipeline artifacts' | ||
targetPath: '$(Build.ArtifactStagingDirectory)' | ||
artifactType: 'pipeline' | ||
artifactName: 'tfx-cli-package' | ||
steps: | ||
- template: /.azure-pipelines/common-steps.yml@self | ||
- ${{ if in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual') }}: | ||
# Validate and publish packages | ||
# The npm cli will replace ${NPM_TOKEN} with the contents of the NPM_TOKEN environment variable. | ||
- bash: | | ||
echo '//registry.npmjs.org/:_authToken=$(npm-automation.token)' > .npmrc | ||
|
||
npm publish --ignore-scripts --tag prerelease | ||
exit_status=$? | ||
if [ $exit_status -eq 1 ]; then | ||
echo "##vso[task.logissue type=warning]Publishing TFX CLI was unsuccessful" | ||
echo "##vso[task.complete result=SucceededWithIssues;]" | ||
fi | ||
|
||
rm .npmrc | ||
displayName: Publish TFX CLI to npm | ||
condition: eq(variables['Build.SourceBranchName'], 'master') | ||
|
||
# Install node 16 for CodeQL 3000 | ||
- task: NodeTool@0 | ||
displayName: Use node 16 | ||
inputs: | ||
versionSpec: "16.x" | ||
- stage: Release | ||
displayName: Release to Latest | ||
trigger: manual | ||
jobs: | ||
- job: Release | ||
displayName: Release to Latest | ||
steps: | ||
- checkout: self | ||
clean: true | ||
|
||
- task: NodeTool@0 | ||
displayName: Use node 16 | ||
inputs: | ||
versionSpec: "16.x" | ||
- script: npm i -g npm@8.19.4 --force | ||
displayName: Use npm version 8.19.4 | ||
|
||
- bash: | | ||
echo '//registry.npmjs.org/:_authToken=$(npm-automation.token)' > .npmrc | ||
# Run the npm command and capture the output | ||
output=$(npm pkg get name version) | ||
echo "${output}" | ||
|
||
# Extract the name and version values using shell parameter expansion | ||
name=$(echo "$output" | grep -o '"name":\s*"[^"]*"' | sed 's/"name":\s*"\([^"]*\)"/\1/') | ||
version=$(echo "$output" | grep -o '"version":\s*"[^"]*"' | sed 's/"version":\s*"\([^"]*\)"/\1/') | ||
|
||
# Save them in a variable in the format name@version | ||
result="${name}@${version}" | ||
|
||
# Combine them in the format name@version | ||
echo "${result}" | ||
|
||
npm dist-tag add "$result" latest | ||
exit_status=$? | ||
if [ $exit_status -eq 1 ]; then | ||
echo "##vso[task.logissue type=error]Upgrading TFX CLI to latest was unsuccessful" | ||
echo "##vso[task.complete result=Failed;]" | ||
exit 1 | ||
fi | ||
|
||
npm dist-tag remove "$result" prerelease | ||
exit_status=$? | ||
if [ $exit_status -eq 1 ]; then | ||
echo "##vso[task.logissue type=error]Removing prerelease for TFX CLI was unsuccessful" | ||
echo "##vso[task.complete result=SucceededWithIssues;]" | ||
fi | ||
rm .npmrc | ||
displayName: Publish TFX CLI to npm | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.