Source Contributing Guide


How to contribute to this module

Please note: As a loose rule any pull requests for general code cleanup will generally be merged when a new version is released. I have a limited number of hours per week to review and test pull requests. I will do my best to test pull requests within a reasonable time frame, but no guarantees can be made

Did you find a bug?

  • Ensure the bug was not already reported by searching on GitHub under Issues

  • If you’re unable to find an open issue addressing the problem, open a new one

    • Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring

Did you write a patch that fixes a bug?

  • Submit a pull request to the main branch
  • Ensure the pull request description clearly describes the problem and solution

If the feature is accepted and I have time to test, the pull request will be approved

Do you intend to add a new feature or change an existing one?

  • Suggest your change by creating a GitHub issue tagged with “Enhancement”

  • Create a branch and start working on your new feature, following feedback from the community

  • Once the new feature is ready,

    • Update any documentation if needed
    • Submit a pulling request to the main branch

If the feature is accepted and I have time to test, the pull request will be approved

Working on the module

  • The public functions in Celerium.APITCG/Public are generated from the OpenAPI spec (docs/apitcg.json) by build/New-PublicFunctions.ps1. Do not edit them by hand, change the spec or the generator and run the script again. docs/endpoints.csv is updated by the same script and the CI fails when the generated files are out of date

  • Use build/Get-APITCGSpec.ps1 to download the latest spec from https://docs.apitcg.com/openapi.json and build/Compare-APITCGSpec.ps1 to see what changed

  • Install the prerequisites and run the tests before opening a pull request:

    ./build/Install-Prerequisites.ps1
    ./build/Invoke-PesterTests.ps1 -Version 1.0.0 -BuildTarget notBuilt
    

    The tests must pass on Windows PowerShell 5.1 and PowerShell 7+ (Windows, Linux, and macOS). The default run does not call the API. The Live tests need the APITCG_API_KEY environment variable and use the monthly request quota of that key, so only run them when you need to (-IncludeTag Live)

  • Commands use PascalCase and the APITCG prefix. The verb follows the HTTP method: GET is Get-, POST is New-, PUT and PATCH are Set-, and DELETE is Remove-

  • The documentation in docs is generated from the comment based help with build/Invoke-HelpContent.ps1. The home page is a copy of the README.md, so change the README and not docs/index.md

  • Never commit an API key. Keep keys in the APITCG_API_KEY environment variable or a repository secret and redact the x-api-key header from any logs, issues, or pull requests you share

Thanks! :heart:


Based off of the Ruby on Rails project contribution guide