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

Get-ALZGithubRelease.ps1 doesn't retrieve all releases from Github #85

Closed
MarkFarkas opened this issue Oct 16, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@MarkFarkas
Copy link

Expected Behavior

The function should be able to donwload any release of ALZ-Bicep

Current Behavior

The function can only find 30 releases. Since this list returned by Github is not consistent, releases are not found randomly. In my case It's unable to donwload the latest release, v0.16.5

Possible Solution

Implement pagination

Steps to Reproduce

Get-ALZGithubRelease -githubRepoUrl 'https://github.com/Azure/ALZ-Bicep' -releases $('v0.16.5')
WARNING: Release v0.16.5 was not found on GitHub Repo: Azure/ALZ-Bicep

Context (Environment)

I was trying to download the latest release of ALZ-Bicep using New-ALZEnvironment

  • Operating System and version as reported by $PSVersionTable.OS: Microsoft Windows 10.0.19045
  • PowerShell versions as reported by $PSVersionTable.PSEdition: Core

Get-ALZGithubRelease.ps1 doesn't retrieve all releases from Github

Detailed Description

The function Get-ALZGithubRelease.ps1 will only retrieve 30 releases from Github, as per https://docs.github.com/en/free-pro-team@latest/rest/releases/releases?apiVersion=2022-11-28#list-releases:~:text=per_page%20integer,Default%3A%2030

Since there are currently 44 releases for the ALZ-Bicep only a portion of them can be found by the function.

@MarkFarkas MarkFarkas added the bug Something isn't working label Oct 16, 2023
@jtracey93
Copy link
Collaborator

Hey @MarkFarkas,

Can you confirm the version of the ALZ PowerShell module you have installed?

get-module -name ALZ -ListAvailable

The latest is v0.2.20 and you can install that with Update-Module -Name 'ALZ'

There also looked to be an oddity on the GitHub side with v0.16.5 which I think I have just resolved so please try again and you should be all good 👍

Let us know

Thanks

@MarkFarkas
Copy link
Author

Hello @jtracey93 , I am using version v0.2.20. I have confirmed that this in indeed an issue with the module and already made a PR: #86

@oZakari
Copy link
Contributor

oZakari commented Oct 17, 2023

Hi @MarkFarkas, the function was refactored yesterday to pull specific release versions instead of all of the releases available for a particular repo, so this should no longer be an issue. I will also go ahead and close your PR for now, but if you end up running into any other issues, please let us know and thank you for bringing this up!

@oZakari oZakari closed this as completed Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants