Skip to content

Conversation

@aishwaryabh
Copy link
Contributor

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

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Additional PR information

@aishwaryabh aishwaryabh requested a review from a team as a code owner November 14, 2025 20:45
setting nightly build to true for testing

fixing script to see if it works

fixing syntax

switching back to using nightly build conditional param
@aishwaryabh aishwaryabh force-pushed the aibhandari/fix-nightly-build branch from 966a12b to b3cb787 Compare November 14, 2025 20:47
$packageDetails = Invoke-RestMethod -Uri $packageUrl -Headers $headers -Method Get
return $packageDetails.versions[0].version
}
return $null

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)'
Copy link
Member

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'
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants