Skip to content

Conversation

MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Apr 21, 2025

Description

This pull request introduces several updates to improve functionality and consistency across the GitHub PowerShell module. Key changes include enhancements to repository and workflow handling, updates to parameter naming for clarity, and adjustments to data types and formatting.

Repository Enhancements

  • Added new properties to the GitHubRepository class, including FullName, CloneUrl, SshUrl, and GitUrl, to provide more comprehensive repository details.
  • Updated parameter names for better consistency:
    • Correct a typo AllowUpdateMerge to AllowUpdateBranch.
    • Replacing DefaultBranchOnly with IncludeAllBranches.
    • Replacing AutoInit with AddReadme
    • Replacing GitignoreTemplate with Gitignore, also no longer a dynamic parameter.
    • Replacing LicenseTemplate with License, also no longer a dynamic parameter.
    • Removed HasDownloads as it is deprecated.
  • Changed Owner to Organization in Get-GitHubRepositoryListByOrg for improved semantic accuracy.
  • Adjusted default sorting parameters for repository-related functions to pushed for better relevance.

Workflow Enhancements

  • Introduced examples in examples/Actions/Workflows.ps1 to demonstrate how to retrieve workflows, start a workflow, and get the latest workflow run.
  • Updated data types in GitHubWorkflowRun to improve accuracy, such as converting RunAttempt to uint and CreatedAt/UpdatedAt to nullable datetime.

Other smaller changes

  • Renamed Get-GitHubRepoBranch to Get-GitHubBranchList and updated related examples and parameters for clarity.

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

…nd improve functionality

- Updated parameter names for consistency across repository creation functions, changing `ForkRepo` to `ForkRepository` and `IncludeAllBranches` for clarity.
- Removed deprecated parameters and aliases to streamline the codebase.
- Enhanced documentation with clearer examples and descriptions for parameters.
- Added argument completers for `Gitignore` and `License` parameters in `New-GitHubRepository`.
- Adjusted logic in repository creation functions to ensure proper handling of parameters and context.
- Improved overall readability and maintainability of the scripts.
@MariusStorhaug MariusStorhaug self-assigned this Apr 21, 2025
@Copilot Copilot AI review requested due to automatic review settings April 21, 2025 11:20
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner April 21, 2025 11:20
Copy link
Contributor

@Copilot 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.

Copilot reviewed 1 out of 21 changed files in this pull request and generated no comments.

Files not reviewed (20)
  • examples/Actions/Workflows.ps1: Language not supported
  • src/classes/public/Repositories/GitHubRepository.ps1: Language not supported
  • src/classes/public/Workflows/GitHubWorkflowRun.ps1: Language not supported
  • src/formats/GitHubWorkflowRun.Format.ps1xml: Language not supported
  • src/functions/private/Branches/Get-GitHubBranch.ps1: Language not supported
  • src/functions/private/Repositories/Get-GitHubMyRepositories.ps1: Language not supported
  • src/functions/private/Repositories/Get-GitHubRepositoryListByID.ps1: Language not supported
  • src/functions/private/Repositories/Get-GitHubRepositoryListByOrg.ps1: Language not supported
  • src/functions/private/Repositories/Get-GitHubRepositoryListByUser.ps1: Language not supported
  • src/functions/private/Repositories/New-GitHubRepositoryAsFork.ps1: Language not supported
  • src/functions/private/Repositories/New-GitHubRepositoryFromTemplate.ps1: Language not supported
  • src/functions/private/Repositories/New-GitHubRepositoryOrg.ps1: Language not supported
  • src/functions/private/Repositories/New-GitHubRepositoryUser.ps1: Language not supported
  • src/functions/public/Repositories/Get-GitHubRepository.ps1: Language not supported
  • src/functions/public/Repositories/Move-GitHubRepository.ps1: Language not supported
  • src/functions/public/Repositories/New-GitHubRepository.ps1: Language not supported
  • src/functions/public/Repositories/Remove-GitHubRepository.ps1: Language not supported
  • src/functions/public/Repositories/Update-GitHubRepository.ps1: Language not supported
  • src/functions/public/Repositories/completers.ps1: Language not supported
  • tests/Users.Tests.ps1: Language not supported

…mes for clarity; refactor test files to improve readability
…ry to 'owner' and streamline parameter handling
- Created TEMPLATE.ps1 for structuring tests with Pester.
- Implemented Users.Tests.ps1 to cover user-related GitHub API functionalities.
- Developed Variables.Tests.ps1 to test GitHub variable management for users and organizations.
- Included necessary suppressions for Pester warnings and logging for GitHub Actions.
- Established context and test cases for authentication types and variable scopes.
…se 'private' flag instead of visibility string
…nd add debug flag in Environments.Tests for better testing visibility
…Environments.Tests for non-interactive execution
…w-GitHubRepository for consistency and clarity
- Created TEMPLATE.ps1 for structuring tests with Pester.
- Implemented user authentication tests in Users.Tests.ps1, including user retrieval and updates.
- Developed Variables.Tests.ps1 to manage GitHub variables, including organization and repository scopes.
- Added comprehensive logging for test contexts and results.
- Included necessary suppressions for Pester-related warnings.
@MariusStorhaug MariusStorhaug moved this from Todo to In Progress in GitHub PowerShell Module Apr 21, 2025
@MariusStorhaug MariusStorhaug changed the title Fix Repositories 🚀 [Feature]: Enhancements to repository and workflow Apr 21, 2025
@MariusStorhaug MariusStorhaug merged commit 37dd6fe into main Apr 22, 2025
10 checks passed
@MariusStorhaug MariusStorhaug deleted the repoFix branch April 22, 2025 05:00
@github-project-automation github-project-automation bot moved this from In Progress to Done in GitHub PowerShell Module Apr 22, 2025
@github-actions
Copy link
Contributor

Module GitHub - 0.25.0 published to the PowerShell Gallery.

@github-actions
Copy link
Contributor

GitHub release for GitHub v0.25.0 has been created.

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

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant