Skip to content

Exclude disabled repos by default #124

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

l-a-u-r-e-n-c-e
Copy link

@l-a-u-r-e-n-c-e l-a-u-r-e-n-c-e commented Mar 25, 2025

This fixes 404 responses when attempting to make requests to disabled repos.

Description

I added a new switch param as I figured it was best not to always exclude disabled repos from responses. However, the default is to exclude them as I didn't want to affect the rest of the code. I did check to see if AzDO supports OData filters but it doesn't look like that's the case so we have to filter it after the response is received.

Related Issue

#123

Motivation and Context

Currently, if you run the tool on a Project with a disabled repo then it throws an exception.

How Has This Been Tested?

I ran the Get-AzDevOpsRepos cmdlet after making the change and observed that the disabled repo in my project was no longer in the returned array. I ran the tests for DevOps.Repos.Tests against my project and got the following:

Before changes (fc472f3)

Tests Passed: 28, Failed: 24, Skipped: 0 NotRun: 0
BeforeAll \ AfterAll failed: 8
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsBranches on an empty repository
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsRepositoryAcls
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsRepositoryAcls with wrong parameters
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsRepositoryAcls with a ReadOnly TokenType
  - Functions: DevOps.Repos.Tests. Test-AzDevOpsFileExists
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsRepositoryPipelinePermissions
  - Functions: DevOps.Repos.Tests. Export-AzDevOpsReposAndBranchPolicies
  - Functions: DevOps.Repos.Tests. Export-AzDevOpsReposAndBranchPolicies -PassThru

After changes

Tests Passed: 28, Failed: 24, Skipped: 0 NotRun: 0
BeforeAll \ AfterAll failed: 8
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsBranches on an empty repository
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsRepositoryAcls
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsRepositoryAcls with wrong parameters
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsRepositoryAcls with a ReadOnly TokenType
  - Functions: DevOps.Repos.Tests. Test-AzDevOpsFileExists
  - Functions: DevOps.Repos.Tests. Get-AzDevOpsRepositoryPipelinePermissions
  - Functions: DevOps.Repos.Tests. Export-AzDevOpsReposAndBranchPolicies
  - Functions: DevOps.Repos.Tests. Export-AzDevOpsReposAndBranchPolicies -PassThru

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Fixes 404 responses when attempting to make requests to disabled repos
@l-a-u-r-e-n-c-e l-a-u-r-e-n-c-e marked this pull request as ready for review March 26, 2025 14:56
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.

1 participant