Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PSModule/GitHub
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.36.7
Choose a base ref
...
head repository: PSModule/GitHub
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 2 commits
  • 16 files changed
  • 3 contributors

Commits on Sep 6, 2025

  1. 🩹 [Patch]: Align all formats that show data size (#498)

    This PR standardizes how size-related properties are handled across all
    GitHub classes to ensure consistency in storage format and display
    formatting.
    
    ## Changes Made
    
    ### 1. GitHubRepository
    - **Property**: Updated `Size` property to store bytes instead of
    kilobytes
    - **Storage**: Convert API values using `$Object.size * 1KB` and
    `$Object.diskUsage * 1KB`
    - **Display**: Updated format file to use
    `[GitHubFormatter]::FormatFileSize($_.Size)`
    - **Documentation**: Updated comments to reflect "in bytes" instead of
    "in kilobytes"
    
    ### 2. GitHubOrganization
    - **Property**: Renamed `DiskUsage` property to `Size` for consistency
    - **Storage**: Convert API values using `$Object.disk_usage * 1KB` 
    - **Compatibility**: Added `DiskUsage` alias property for backward
    compatibility
    - **Documentation**: Updated comments to reflect "size of organization's
    repositories, in bytes"
    
    ### 3. GitHubArtifact
    - **Display**: Updated format file to use
    `[GitHubFormatter]::FormatFileSize($_.Size)` instead of custom
    formatting
    - **Property**: Already correctly stores bytes and uses "Size" property
    name
    - **Label**: Updated table header from "Size (KB)" to "Size" for cleaner
    display
    
    ### 4. Format File Updates
    All affected format files now use the standardized
    `[GitHubFormatter]::FormatFileSize()` method instead of custom size
    calculations, ensuring consistent human-readable formatting across all
    size displays.
    
    ### 5. Comprehensive Test Coverage
    - **GitHubFormatter.Tests.ps1**: New test file validating unit
    conversion logic (KB→bytes), type boundaries, and format patterns
    - **Enhanced Integration Tests**: Added size property validation tests
    to Repositories.Tests.ps1, Organizations.Tests.ps1, and
    Artifacts.Tests.ps1
    - **Unit Verification**: Tests confirm all size properties store values
    in bytes and use expected denominations
    - **Compatibility Testing**: Validates DiskUsage alias functionality and
    backward compatibility
    
    ## Verification
    
    The changes maintain backward compatibility and existing functionality:
    - Size conversions work correctly: 108 KB → 110,592 bytes → "108.00 KB"
    display
    - Tests continue to pass (they only verify `Size > 0`)
    - New tests verify correct unit storage and formatting behavior
    - GitHubReleaseAsset was already implemented correctly as the reference
    standard
    
    ## Example Impact
    
    Before:
    ```powershell
    # GitHubRepository.Size = 108 (kilobytes)
    # Display: "0.11 MB" (custom calculation)
    
    # GitHubOrganization.DiskUsage = 10000 (kilobytes)  
    # Display: Not shown in table format
    ```
    
    After:
    ```powershell
    # GitHubRepository.Size = 110592 (bytes)
    # Display: "108.00 KB" (standardized formatter)
    
    # GitHubOrganization.Size = 10240000 (bytes)
    # GitHubOrganization.DiskUsage -> Size (alias for compatibility)
    # Display: "9.77 MB" (standardized formatter)
    ```
    
    Fixes #478.
    
    <!-- START COPILOT CODING AGENT TIPS -->
    ---
    
    💡 You can make Copilot smarter by setting up custom instructions,
    customizing its development environment and configuring Model Context
    Protocol (MCP) servers. Learn more [Copilot coding agent
    tips](https://gh.io/copilot-coding-agent-tips) in the docs.
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
    Co-authored-by: Marius Storhaug <marstor@hotmail.com>
    3 people authored Sep 6, 2025
    Configuration menu
    Copy the full SHA
    89c27cd View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2025

  1. 🪲[Fix]: Piping GitHubSecret and GitHubVariable objects to `Remove…

    …-GitHubSecret` and `Remove-GitHubVariable` (#499)
    
    This pull request improves the handling and testing of secret and
    variable removal in the GitHub module. The main focus is on making the
    removal functions (`Remove-GitHubSecret`, `Remove-GitHubVariable`) more
    robust and scope-aware, and on expanding the test coverage to ensure
    correct behavior across different usage patterns and scopes.
    
    - Fixes #388
    
    Key changes include:
    
    ### Functional improvements to removal logic
    
    * Updated `Remove-GitHubSecret.ps1` and `Remove-GitHubVariable.ps1` to
    dispatch removal actions based on the `Scope` property of each item,
    ensuring the correct removal function is called for environment,
    repository, or organization scopes, and providing clear error handling
    for unsupported scopes.
    
    ### Documentation and class property clarifications
    
    * Improved property descriptions in `GitHubSecret.ps1` and
    `GitHubVariable.ps1` to clarify that properties refer to where the
    secret or variable is stored, enhancing code readability and
    maintainability.
    
    ### Expanded and improved test coverage
    
    * Refactored and expanded tests in `Secrets.Tests.ps1` and
    `Variables.Tests.ps1` to:
    - Add separate tests for pipeline-based removal using both direct
    pipeline and variable assignment approaches.
    - Ensure secrets and variables are created and removed correctly in all
    supported scopes.
    - Add logging and verification steps to improve test clarity and
    debugging.
    
    These changes make the module's behavior more predictable and easier to
    test, especially when handling secrets and variables in different scopes
    and using pipeline operations.
    
    ---------
    
    Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
    Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
    Co-authored-by: Marius Storhaug <marstor@hotmail.com>
    3 people authored Sep 7, 2025
    Configuration menu
    Copy the full SHA
    9e7a331 View commit details
    Browse the repository at this point in the history
Loading