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

🩹 [Patch]: Align function parameters and logging #207

Merged
merged 25 commits into from
Dec 16, 2024
Merged

Conversation

MariusStorhaug
Copy link
Contributor

@MariusStorhaug MariusStorhaug commented Dec 15, 2024

Description

This pull request introduces several new features and improvements, including new PowerShell filters for GitHub workflow runs, updates to the coverage report, and enhancements to existing scripts. The most important changes are summarized below:

Main change:

  • Update all functions to use a function for showing the execution path to the function in begin and end blocks of the functions. The exec path starts at the first non '' and non-powershell script so it doesn't drown out the logs with useless info. Main goal of this change is to clearly see where we are in the function execution. These only show if -Debug is provided.
  • Aligned all functions to use a $body hashtable for inputs to the API call, instead of having some strange function with automated case style management. Plain and simple, use a @Body hashtable, an $inputObject variable for the calls to the API and the API call itself. Easy as that. Likely more alignment to come via classes to drive consistency at a later point.
  • All functions should now have a begin process and end block. Debug functions are omitted from this requirement.

Function changes:

  • Splitting Get-GitHubWorkflowRun into two new private functions and referencing them in the public function.
    • Get-GitHubWorkflowRunByRepo
    • Get-GitHubWorkflowRunByWorkflow

Workflow Enhancements:

  • Added Initialize-PSModule step to the Set-CoverageReport.yml workflow, to install MarkdownPS automatically before the script is run.

Codebase Enhancements:

  • Updated Get-GitHubAppByName, Get-GitHubAuthenticatedApp, Assert-GitHubContext, Remove-GitHubContext, Resolve-GitHubContext, and Set-GitHubContext scripts to use Write-Debug instead of Write-Verbose for improved debugging.

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

@MariusStorhaug MariusStorhaug requested a review from a team as a code owner December 15, 2024 02:44
@MariusStorhaug MariusStorhaug self-assigned this Dec 16, 2024
@MariusStorhaug MariusStorhaug merged commit 0a503f8 into main Dec 16, 2024
20 checks passed
@MariusStorhaug MariusStorhaug deleted the paraline branch December 16, 2024 08:41
Copy link
Contributor

Module [GitHub - v0.11.12] published to the PowerShell Gallery.

Copy link
Contributor

GitHub release for GitHub v0.11.12 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.

🩹 [Patch]: Cleanup debug/verbose logging Align default parameter handling
1 participant