c8cf5920e4
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.8 to 2.0.9. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/softprops/action-gh-release/releases">softprops/action-gh-release's releases</a>.</em></p> <blockquote> <h2>v2.0.9</h2> <!-- raw HTML omitted --> <h2>What's Changed</h2> <ul> <li>maintenance release with updated dependencies</li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/kbakdev"><code>@kbakdev</code></a> made their first contribution in <a href="https://redirect.github.com/softprops/action-gh-release/pull/521">softprops/action-gh-release#521</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/softprops/action-gh-release/compare/v2...v2.0.9">https://github.com/softprops/action-gh-release/compare/v2...v2.0.9</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md">softprops/action-gh-release's changelog</a>.</em></p> <blockquote> <h2>2.0.9</h2> <ul> <li>maintenance release with updated dependencies</li> </ul> <h2>2.0.8</h2> <h3>Other Changes 🔄</h3> <ul> <li>chore(deps): bump prettier from 2.8.0 to 3.3.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/480">softprops/action-gh-release#480</a></li> <li>chore(deps): bump <code>@types/node</code> from 20.14.9 to 20.14.11 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/483">softprops/action-gh-release#483</a></li> <li>chore(deps): bump <code>@octokit/plugin-throttling</code> from 9.3.0 to 9.3.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/484">softprops/action-gh-release#484</a></li> <li>chore(deps): bump glob from 10.4.2 to 11.0.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/477">softprops/action-gh-release#477</a></li> <li>refactor: write jest config in ts by <a href="https://github.com/chenrui333"><code>@chenrui333</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/485">softprops/action-gh-release#485</a></li> <li>chore(deps): bump <code>@actions/github</code> from 5.1.1 to 6.0.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/470">softprops/action-gh-release#470</a></li> </ul> <h2>2.0.7</h2> <h3>Bug fixes 🐛</h3> <ul> <li>Fix missing update release body by <a href="https://github.com/FirelightFlagboy"><code>@FirelightFlagboy</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/365">softprops/action-gh-release#365</a></li> </ul> <h3>Other Changes 🔄</h3> <ul> <li>Bump <code>@octokit/plugin-retry</code> from 4.0.3 to 7.1.1 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/443">softprops/action-gh-release#443</a></li> <li>Bump typescript from 4.9.5 to 5.5.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/467">softprops/action-gh-release#467</a></li> <li>Bump <code>@types/node</code> from 20.14.6 to 20.14.8 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/469">softprops/action-gh-release#469</a></li> <li>Bump <code>@types/node</code> from 20.14.8 to 20.14.9 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/473">softprops/action-gh-release#473</a></li> <li>Bump typescript from 5.5.2 to 5.5.3 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/472">softprops/action-gh-release#472</a></li> <li>Bump ts-jest from 29.1.5 to 29.2.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/479">softprops/action-gh-release#479</a></li> <li>docs: document that existing releases are updated by <a href="https://github.com/jvanbruegge"><code>@jvanbruegge</code></a> in <a href="https://redirect.github.com/softprops/action-gh-release/pull/474">softprops/action-gh-release#474</a></li> </ul> <h2>2.0.6</h2> <ul> <li>maintenance release with updated dependencies</li> </ul> <h2>2.0.5</h2> <ul> <li>Factor in file names with spaces when upserting files <a href="https://redirect.github.com/softprops/action-gh-release/pull/446">#446</a> via <a href="https://github.com/MystiPanda"><code>@MystiPanda</code></a></li> <li>Improvements to error handling <a href="https://redirect.github.com/softprops/action-gh-release/pull/449">#449</a> via <a href="https://github.com/till"><code>@till</code></a></li> </ul> <h2>2.0.4</h2> <ul> <li>Minor follow up to <a href="https://redirect.github.com/softprops/action-gh-release/pull/417">#417</a>. <a href="https://redirect.github.com/softprops/action-gh-release/pull/425">#425</a></li> </ul> <h2>2.0.3</h2> <ul> <li>Declare <code>make_latest</code> as an input field in <code>action.yml</code> <a href="https://redirect.github.com/softprops/action-gh-release/pull/419">#419</a></li> </ul> <h2>2.0.2</h2> <ul> <li>Revisit approach to <a href="https://redirect.github.com/softprops/action-gh-release/pull/384">#384</a> making unresolved pattern failures opt-in <a href="https://redirect.github.com/softprops/action-gh-release/pull/417">#417</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
---|---|---|
.devcontainer | ||
.github | ||
.vscode | ||
dist | ||
docs | ||
src | ||
.c8rc.json | ||
.editorconfig | ||
.gitignore | ||
.markdownlint.json | ||
.npmrc | ||
LICENSE | ||
README.md | ||
SECURITY.md | ||
action.yml | ||
babel.config.json | ||
eslint.config.mjs | ||
package-lock.json | ||
package.json |
README.md
PR Metrics
PR Metrics is a both a GitHub Action and Azure DevOps Pipelines task for adding size and test coverage indicators to the start of each Pull Request title.
The Azure Pipelines task can be downloaded from the Visual Studio Marketplace.
For example, a PR with the title "Adding code" could become either:
- XS ✔️ ▪️ Adding code
- L ⚠️ ▪️ Adding code
The former would indicate an extra small PR with sufficient test coverage, whereas the latter would indicate a large PR with insufficient test coverage.
This task helps ensure engineers keep PRs to an appropriate size with appropriate test coverage, while informing reviewers of the expected time commitment for a thorough review of the code.
The task will also add a comment to the PR with a detailed breakdown of the metrics:
Metrics for iteration 1
✔️ Thanks for keeping your pull request small.
✔️ Thanks for adding tests.
Lines Product Code 100 Test Code 50 Subtotal 150 Ignored 5 Total 155
It will furthermore add a comment to indicate that review of specific excluded files is unnecessary.
❗ This file doesn't require review.
If no PR description is provided, the description will be set to:
❌ Add a description.
Inputs
You will need to set the environment variable PR_Metrics_Access_Token
to a
Personal Access Token (PAT) with at least Read and Write access to pull
requests. If you are using a Classic PAT, it will need at least the 'repos'
scope. Instructions on creating a new PAT can be found here.
Alternatively, you can use the in-built GITHUB_TOKEN
.
If using GITHUB_TOKEN
, the following permissions are required:
permissions:
pull-requests: write
statuses: write
GitHub token permissions can be set for an individual job, workflow, or for Actions as a whole.
It is also recommended that you set continue-on-error: true
as a failure
within the action should not break your pipelines and prevent code development.
base-size
The maximum number of new lines in an extra small PR. If left blank, a default
of 200
will be used.
growth-rate
The growth rate applied to the base size for calculating the size of larger PRs.
If left blank, a default of 2.0
will be used. With a base size of 200
and a
growth rate of 2.0
, 400
new lines would constitute a medium PR while 800
new lines would constitute a large PR.
test-factor
The lines of test code expected for each line of product code. If left blank, a
default of 1.0
will be used. This can be set to 0.0
in order to skip the
reporting of the test code coverage.
file-matching-patterns
Globs specifying the files and folders to include. Autogenerated files should typically be excluded. Excluded files will contain a comment to inform reviewers that they are unlikely to need to review those files. If left blank, a default of
**/*
!**/package-lock.json
(all files except package-lock.json
) will be used.
code-file-extensions
Extensions for files containing code, so that non-code files can be excluded. If left blank, a default set of file extensions will be used, which are listed here.
Example Usage
The default input values are expected to be appropriate for most builds. Therefore, the following YAML definition is recommended:
uses: microsoft/PR-Metrics@v1.6.3
name: PR Metrics
env:
PR_METRICS_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
If you wish to modify the inputs, YAML akin the to the following can be used:
uses: microsoft/PR-Metrics@v1.6.3
name: PR Metrics
env:
PR_METRICS_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
base-size: 200
growth-rate: 2.0
test-factor: 1.0
file-matching-patterns: |
**/*
!Ignore.cs
code-file-extensions: |
cs
ps1
continue-on-error: true
pull_request
must be used as the pipeline trigger to ensure that sufficient
information, including the Pull Request ID, is available to PR Metrics.
pull_request_target
will not work as insufficient information is available
when using this trigger.
Instructions on using the action within Azure Pipelines can be found here.
Git History
If your repository contains any non-linear history, it will be necessary to
fetch Git history during checkout. This can be done by updating the
actions/checkout
step:
- uses: actions/checkout@4.1.7
fetch-depth: 0
In many cases, fetch-depth
will not be required so it is recommended not to
set this unless the action explicitly requests it. It may also be possible to
set this to a value greater than 0 if you only require a partial history, but it
can be difficult to determine a value that will work consistently, due to the
nature of Git history.
To avoid this, it is recommended to only use commit types that squash the Git history such as "squash merge" or "rebase and fast-forward".
Troubleshooting
A set of steps for troubleshooting any issues encountered can be found here.
Contributing
Instructions on contributing can be located in CONTRIBUTING.md.
The code is released under the MIT license.
PR Metrics is created by the OMEX team in Microsoft, which is part of the Office organization. Additional source code released by the OMEX team can be located at https://github.com/microsoft/Omex.
Code of Conduct
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.