From aa54b71c74aa98f262747cb676bc577ef7fae32b Mon Sep 17 00:00:00 2001 From: Tamara Buch Date: Mon, 1 Jun 2026 09:51:11 -0500 Subject: [PATCH 1/6] Change limit for ReturnAll to 200 --- src/UofICDB/Functions/Public/Get-CDBItem.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/UofICDB/Functions/Public/Get-CDBItem.ps1 b/src/UofICDB/Functions/Public/Get-CDBItem.ps1 index 86dbc26..48f9753 100644 --- a/src/UofICDB/Functions/Public/Get-CDBItem.ps1 +++ b/src/UofICDB/Functions/Public/Get-CDBItem.ps1 @@ -102,18 +102,19 @@ function Get-CDBItem { $Return += Invoke-CDBRestCall -RelativeURI $Redirect } elseif($ReturnAll){ + Write-Verbose -Message "Using list_endpoint: $($Script:SubClassURIs[$SubClass].list_endpoint)" if($PSBoundParameters.Keys -contains 'Limit'){ Write-Warning -Message 'Ignoring provided limit since ReturnAll was also specified.' } - #CDB has a hard cap of 1000 items returned in a single call. So to get all results we have to first get the total count from the meta data and then iterate through batches of 1000 results using the offset parameter. + #CDB has a hard cap of 200 items returned in a single call. So to get all results we have to first get the total count from the meta data and then iterate through batches of 200 results using the offset parameter. [int]$TotalObjects = (Invoke-CDBRestCall -RelativeURI $Script:SubClassURIs[$SubClass].list_endpoint -Limit 1).meta.total_count Write-Verbose -Message "$($TotalObjects) total objects of subclass $($SubClass) available." [int]$Offset = 0 While($TotalObjects -gt 0){ - $Return += (Invoke-CDBRestCall -RelativeURI $Script:SubClassURIs[$SubClass].list_endpoint -Filter $Filter -Limit 1000 -Offset $Offset).Objects - $Offset += 1000 - $TotalObjects -= 1000 + $Return += (Invoke-CDBRestCall -RelativeURI $Script:SubClassURIs[$SubClass].list_endpoint -Filter $Filter -Limit 200 -Offset $Offset).Objects + $Offset += 200 + $TotalObjects -= 200 } } else{ From 66610c2e81f3a20410a7c04ae98ba98851d41bff Mon Sep 17 00:00:00 2001 From: Tamara Buch Date: Mon, 1 Jun 2026 09:53:04 -0500 Subject: [PATCH 2/6] changelog++ --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e7341..fed40d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed ### Removed +## [1.2.1] 2026-06-01 +### Changed +- Get-CDBItem -Returnall parameter changed to use limit of 200 to reduce errors from service + ## [1.2.0] 2023-10-03 ### Changed - Changed endpoint in settings.json from cdb.cites.illinois.edu to cdb.techservices.illinois.edu as the old endpoint will be going away From c44930a0e016e96615505ecda2498bf5b5bb6214 Mon Sep 17 00:00:00 2001 From: Tamara Buch Date: Mon, 1 Jun 2026 09:54:55 -0500 Subject: [PATCH 3/6] edit comment --- src/UofICDB/Functions/Public/Get-CDBItem.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/UofICDB/Functions/Public/Get-CDBItem.ps1 b/src/UofICDB/Functions/Public/Get-CDBItem.ps1 index 48f9753..791b6dd 100644 --- a/src/UofICDB/Functions/Public/Get-CDBItem.ps1 +++ b/src/UofICDB/Functions/Public/Get-CDBItem.ps1 @@ -102,12 +102,11 @@ function Get-CDBItem { $Return += Invoke-CDBRestCall -RelativeURI $Redirect } elseif($ReturnAll){ - Write-Verbose -Message "Using list_endpoint: $($Script:SubClassURIs[$SubClass].list_endpoint)" if($PSBoundParameters.Keys -contains 'Limit'){ Write-Warning -Message 'Ignoring provided limit since ReturnAll was also specified.' } - #CDB has a hard cap of 200 items returned in a single call. So to get all results we have to first get the total count from the meta data and then iterate through batches of 200 results using the offset parameter. + #To get all results we have to first get the total count from the meta data and then iterate through batches of 200 results using the offset parameter. [int]$TotalObjects = (Invoke-CDBRestCall -RelativeURI $Script:SubClassURIs[$SubClass].list_endpoint -Limit 1).meta.total_count Write-Verbose -Message "$($TotalObjects) total objects of subclass $($SubClass) available." [int]$Offset = 0 From 4799b71be383b58ede531d2b946a3b13352b253d Mon Sep 17 00:00:00 2001 From: Tamara Buch Date: Mon, 1 Jun 2026 09:59:54 -0500 Subject: [PATCH 4/6] update tests --- test/UofICDB.Tests.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/UofICDB.Tests.ps1 b/test/UofICDB.Tests.ps1 index d2373c9..a72f960 100644 --- a/test/UofICDB.Tests.ps1 +++ b/test/UofICDB.Tests.ps1 @@ -5,7 +5,7 @@ BeforeAll { $secStringPassword = ConvertTo-SecureString -String $ENV:TestAPIPw -AsPlainText $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ($ENV:TestAPIUser, $secStringPassword) - [int]$TestId = 1770 #This will likely break at some point and need updating. We have tests based around this object existing in CDB. + [int]$TestId = 8777 #This will likely break at some point and need updating. We have tests based around this object existing in CDB. } Describe 'New-CDBConnection'{ @@ -33,7 +33,7 @@ Describe 'New-CDBConnection'{ It 'Encrypts the saved password'{ { (Get-Content -Path $Script:SavedCredsDir | ConvertFrom-Json).password | ConvertTo-SecureString } | Should -Not -Throw - } + } } } } @@ -61,7 +61,7 @@ Describe 'Update-CDBSubclassUris'{ New-CDBConnection -Credential $Credential } - InModuleScope 'UofICDB' { + InModuleScope 'UofICDB' { It 'Does not throw'{ {Update-CDBSubclassUris} | Should -Not -Throw } @@ -124,7 +124,7 @@ Describe 'Get-CDBItem'{ BeforeAll { New-CDBConnection -Credential $Credential } - + It 'Handles the redirect off an Id'{ $null -eq (Get-CDBItem -id $TestId).subclass | Should -Be $True $null -ne (Get-CDBItem -id $TestId).name | Should -Be $True @@ -175,10 +175,10 @@ Describe 'Get-CDBItem'{ Describe 'Get-CDBItemPermission'{ It 'Returns permissions for a given item'{ - (Get-CDBItemPermission -id 1778).permissions | Should -Not -BeNullOrEmpty + (Get-CDBItemPermission -id 8777).permissions | Should -Not -BeNullOrEmpty } It 'Accepts pipeline input'{ - {Get-CDBItem -Id 1778 | Get-CDBItemPermission} | Should -Not -Throw + {Get-CDBItem -Id 8777 | Get-CDBItemPermission} | Should -Not -Throw } } From 6c59e810e87c35df96791d454440b4200d4229fb Mon Sep 17 00:00:00 2001 From: Tamara Buch Date: Mon, 1 Jun 2026 10:00:18 -0500 Subject: [PATCH 5/6] changelog++ --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fed40d0..b657c58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.2.1] 2026-06-01 ### Changed - Get-CDBItem -Returnall parameter changed to use limit of 200 to reduce errors from service +- Update CDBItem ID used for pester tests ## [1.2.0] 2023-10-03 ### Changed From 85da1610f7b4369f1268e0732100bc96150a7519 Mon Sep 17 00:00:00 2001 From: Tamara Buch Date: Mon, 1 Jun 2026 10:04:44 -0500 Subject: [PATCH 6/6] update ubuntu runner to latest --- .github/workflows/pester.yml | 2 +- CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pester.yml b/.github/workflows/pester.yml index 138cd4b..1ba1c33 100644 --- a/.github/workflows/pester.yml +++ b/.github/workflows/pester.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index b657c58..5b6fe65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.2.1] 2026-06-01 ### Changed - Get-CDBItem -Returnall parameter changed to use limit of 200 to reduce errors from service -- Update CDBItem ID used for pester tests +- Update CDBItem ID used for pester tests and update Ubuntu runner version to latest ## [1.2.0] 2023-10-03 ### Changed