Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Mar 19, 2025

Description

This pull request includes several changes to enhance the GitHub PowerShell module, focusing on adding retry logic, improving error handling, and cleaning up the codebase.

Enhancements to retry logic and error handling:

  • Added RetryCount and RetryInterval parameters to Invoke-GitHubAPI for retrying API calls on failure. (src/functions/public/API/Invoke-GitHubAPI.ps1) (Fb135fafL29R29, src/functions/public/API/Invoke-GitHubAPI.ps1R164-R187)
  • Introduced default values for RetryCount and RetryInterval in GitHubConfig and GitHub.ps1. (src/classes/public/Config/GitHubConfig.ps1, src/variables/private/GitHub.ps1) [1] [2]

Improvements to debugging and error messages:

  • Enhanced error handling in Connect-GithubCli to provide more detailed warnings and debug messages. (src/functions/private/Auth/Cli/Connect-GithubCli.ps1)
  • Improved debug output in Invoke-GitHubAPI by formatting and displaying parameters and settings. (src/functions/public/API/Invoke-GitHubAPI.ps1)

Code cleanup and minor fixes:

  • Removed redundant debug statements and cleaned up code in various files. (src/functions/private/Auth/Context/Resolve-GitHubContextSetting.ps1, src/functions/public/Auth/Connect-GitHubAccount.ps1) [1] [2]
  • Added [AllowNull()] attribute to the Context parameter in Resolve-GitHubContext. (src/functions/private/Auth/Context/Resolve-GitHubContext.ps1)

XML formatting adjustments:

  • Removed unnecessary comments from XML format files to improve readability. (src/formats/GitHubContext.Format.ps1xml, src/formats/GitHubWebhook.Format.ps1xml, src/formats/GitHubWebhookRedelivery.Format.ps1xml) [1] [2] [3]

Test script updates:

  • Updated test scripts to connect to GitHub App by default in the BeforeAll block. (tests/TEMPLATE.ps1) [1] [2]

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

pmatthews05 and others added 30 commits March 16, 2025 08:42
## Description
This includes new commands:
- Get-GitHubVariable.ps1
- Set-GitHubVariable.ps1
- Remove-GitHubVariable.ps1
- Get-GitHubEnvironment.ps1
- Set-GitHubEnvironment.ps1
- Remove-GitHubEnvironment.ps1

## Type of change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [ ] 📖 [Docs]
- [ ] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [x] 🚀 [Feature]
- [ ] 🌟 [Breaking change]

## Checklist
<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas

---------

Co-authored-by: Marius Storhaug <marstor@hotmail.com>
…ing GitHub variables on repositories and environments
…s for consistency and clarity; add Update-GitHubVariableOnRepository and Update-GitHubVariableOnEnvironment functions for managing GitHub variables.
…-GitHubVariableOnOwner function for improved flexibility
…nction to include variable name for precise targeting
…tHubVariable functions for optional return of updated variable object
…dd ErrorAction parameter for improved error handling
…zation and update tests to streamline output display
@Copilot Copilot AI review requested due to automatic review settings March 19, 2025 14:30
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner March 19, 2025 14:30
@MariusStorhaug MariusStorhaug changed the title 🩹 [Patch]: Improvments to managing context, cli and Invoke-GitHubAPI 🩹 [Patch]: Improvements to managing context, cli and Invoke-GitHubAPI Mar 19, 2025
@MariusStorhaug MariusStorhaug self-assigned this Mar 19, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the coverage documentation to reflect new statuses and counts for various API endpoints, aligning reported data with recent improvements. Key changes include:

  • Updating the "Covered functions" count from 164 to 181.
  • Changing status indicators for several endpoints in the actions variables and organization variables sections.
  • Adjusting status marks for endpoints under environments variables.
Files not reviewed (11)
  • src/classes/public/Config/GitHubConfig.ps1: Language not supported
  • src/formats/GitHubContext.Format.ps1xml: Language not supported
  • src/formats/GitHubWebhook.Format.ps1xml: Language not supported
  • src/formats/GitHubWebhookRedelivery.Format.ps1xml: Language not supported
  • src/functions/private/Auth/Cli/Connect-GithubCli.ps1: Language not supported
  • src/functions/private/Auth/Context/Resolve-GitHubContext.ps1: Language not supported
  • src/functions/private/Auth/Context/Resolve-GitHubContextSetting.ps1: Language not supported
  • src/functions/public/API/Invoke-GitHubAPI.ps1: Language not supported
  • src/functions/public/Auth/Connect-GitHubAccount.ps1: Language not supported
  • src/variables/private/GitHub.ps1: Language not supported
  • tests/TEMPLATE.ps1: Language not supported
Comments suppressed due to low confidence (2)

Coverage.md:12

  • Verify that the updated covered functions count (181) correctly reflects the current state of the codebase and documentation.
<td>181</td>

Coverage.md:134

  • Confirm that the new status indicators for the '/orgs/{org}/actions/variables' endpoint are consistent with the actual API support and coverage definitions.
| `/orgs/{org}/actions/variables`                                                                                           |                    | :white_check_mark: |                    | :white_check_mark: |                    |

@MariusStorhaug MariusStorhaug moved this from Todo to In Progress in GitHub PowerShell Module Mar 19, 2025
@MariusStorhaug MariusStorhaug merged commit 1e14577 into main Mar 19, 2025
10 checks passed
@MariusStorhaug MariusStorhaug deleted the updateAPI branch March 19, 2025 15:30
@github-project-automation github-project-automation bot moved this from In Progress to Done in GitHub PowerShell Module Mar 19, 2025
@github-actions
Copy link
Contributor

Module GitHub - 0.17.2 published to the PowerShell Gallery.

@github-actions
Copy link
Contributor

GitHub release for GitHub v0.17.2 has been created.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants