-
Notifications
You must be signed in to change notification settings - Fork 376
fix: Prevent schema from being overwritten #3215
Changes from all commits
5745de9
790b90c
ed83b6e
f31b8eb
0713b72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,7 @@ jobs: | |
| scanType: 'Register' | ||
| verbosity: 'Verbose' | ||
| alertWarningLevel: 'High' | ||
| failOnAlert: false | ||
| failOnAlert: true | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| param ( | ||
| [string]$runtime = "azurewebapp" | ||
| ) | ||
| $SCHEMA_FILE="sdk.schema" | ||
| $BACKUP_SCHEMA_FILE="sdk-backup.schema" | ||
|
|
||
| Write-Host "Running schema merge on $runtime runtime." | ||
|
|
||
| Move-Item -Force -Path $SCHEMA_FILE -Destination $BACKUP_SCHEMA_FILE | ||
|
|
||
| bf dialog:merge "*.schema" "../runtime/$runtime/*.csproj" -o $SCHEMA_FILE -v | ||
|
|
||
| if (Test-Path $SCHEMA_FILE -PathType leaf) | ||
| { | ||
| Remove-Item -Force -Path $BACKUP_SCHEMA_FILE | ||
| Write-Host "Schema merged succesfully." | ||
| } | ||
| else | ||
| { | ||
| Move-Item -Force -Path $BACKUP_SCHEMA_FILE -Destination $SCHEMA_FILE | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/bash | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably want a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently bfdialog has two bugs
Unless they fix both these issues adding set -e might be risky for us. Let's say they fix just the error code bug. That still leaves our shell script in an unstable state since on error, the script exits immediately. This leaves the user with no .schema file as the portion of the script where I revert back to the original schema file will be skipped. Let me know if Im missing something here
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense. Are those issues with the CLI being tracked? Is that what you mean by "Both these are in GH"?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. |
||
| runtime=${runtime:-azurewebapp} | ||
| SCHEMA_FILE=sdk.schema | ||
| BACKUP_SCHEMA_FILE=sdk-backup.schema | ||
|
|
||
| while [ $# -gt 0 ]; do | ||
| if [[ $1 == *"-"* ]]; then | ||
| param="${1/-/}" | ||
| declare $param="$2" | ||
| fi | ||
| shift | ||
| done | ||
|
|
||
| echo "Running schema merge on $runtime runtime." | ||
| mv "./$SCHEMA_FILE" "./$BACKUP_SCHEMA_FILE" | ||
|
|
||
| bf dialog:merge "*.schema" "../runtime/$runtime/*.csproj" -o $SCHEMA_FILE -v | ||
|
|
||
| if [ -f "$SCHEMA_FILE" ]; then | ||
| echo "Schema merged succesfully." | ||
| rm -rf "./$BACKUP_SCHEMA_FILE" | ||
| else | ||
| mv "./$BACKUP_SCHEMA_FILE" "./$SCHEMA_FILE" | ||
| fi | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.