-
Notifications
You must be signed in to change notification settings - Fork 465
Fix nightly build to pull correct version from feed #4730
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
base: main
Are you sure you want to change the base?
Conversation
setting nightly build to true for testing fixing script to see if it works fixing syntax switching back to using nightly build conditional param
966a12b to
b3cb787
Compare
| $packageDetails = Invoke-RestMethod -Uri $packageUrl -Headers $headers -Method Get | ||
| return $packageDetails.versions[0].version | ||
| } | ||
| return $null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid duplicated feed url,
function Get-LatestPackageVersion {
param($packageName)
$feedUrl = "https://feeds.dev.azure.com/azfunc/internal/_apis/packaging/feeds/core-tools-nightly-build/packages"
$apiVersion = "7.1"
$searchUrl = "$feedUrl?packageNameQuery=$packageName&api-version=$apiVersion"
$searchResponse = Invoke-RestMethod -Uri $searchUrl -Headers $headers -Method Get
$package = $searchResponse.value | Where-Object { $_.name -eq $packageName } | Select-Object -First 1
if (!$package) {
Write-Warning "Package '$packageName' not found in the feed."
return $null
}
$packageUrl = "$feedUrl/$($package.id)?api-version=$apiVersion"
$packageDetails = Invoke-RestMethod -Uri $packageUrl -Headers $headers -Method Get
return $packageDetails.versions[0].version
}| feed: 'internal/core-tools-nightly-build' | ||
| definition: 'func-cli-host' | ||
| version: '$(FUNC_CLI_VERSION)' | ||
| version: '$(FUNC_CLI_HOST_VERSION)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have its own version? I don't see us bumping this ever? I think its fine to use FUNC_CLI_VERSION for this
| - task: PowerShell@2 | ||
| displayName: 'Get latest artifact version' | ||
| inputs: | ||
| targetType: 'inline' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to a script file in eng/scripts?
Issue describing the changes in this PR
Fixes the core-tools nightly build to correctly pull the version from the feed (even if in-proc and default versions are different)
example of feed pulling correct version: https://azfunc.visualstudio.com/internal/_build/results?buildId=247857&view=logs&j=68b07a0c-358d-5e75-20be-40071c730e07&t=b5fed0a2-4354-5cee-7064-c98b7b5a6328
Pull request checklist
release_notes.mdAdditional information
Additional PR information