Coder Social home page Coder Social logo

microsoft / pr-metrics Goto Github PK

View Code? Open in Web Editor NEW
52.0 11.0 8.0 6.31 MB

A GitHub Action & Azure Pipelines task for augmenting pull request titles to let reviewers quickly determine PR size and test coverage.

Home Page: https://github.com/microsoft/Omex

License: Other

TypeScript 100.00%
azure-devops azure-devops-extension github azure-pipelines typescript

pr-metrics's Introduction

PR Metrics

Open in GitHub Codespaces

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:heavy_check_mark: :black_small_square: Adding code
  • L:warning: :black_small_square: 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 the 'repos' scope. If you are using a Fine-Grained PAT, it will need at least Read and Write access to pull requests. 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/[email protected]
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/[email protected]
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.

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 [email protected] with any additional questions or comments.

pr-metrics's People

Contributors

aubreyquinn avatar ceakarsu avatar dependabot[bot] avatar gordonbeeming avatar microsoft-github-policy-service[bot] avatar muiriswoulfe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pr-metrics's Issues

Allow selecting the compare branch

Summary

Currently, if we make a PR from feature/abc-123 into project/acme, PR Metrics seems to compare against the default branch (e.g. dev) not the target branch (e.g. project/acme), which causes it to show a PR with two lines changed as a 2XL PR, because the feature/abc-123 branch is very different from dev, but only has minor differences to project/acme

I'd like to allow comparing to the destination branch, rather than the default compare branch.

Rationale

The metrics provided are not useful for long-running project branches, because the metrics are not based on the PR source and destination branches, but the source and default compare branches, giving you skewed data.

Additional Information

Example PR metrics
image

Actual PR changes between source and destination branches
image

Am i possible to use this actions for private (org) repository?

Summary

I want to use this action on a private (organizational) repository, but the action gets stuck with an "AxiosError: Request failed with status code 404" error, and the problem seems to occur at https://github.com/{org}/{repo}/pull/{PR number}.diff. I'm wondering if setting a PAT on PR_METRICS_ACCESS_TOKEN is enough.

Additional Information

I'm attaching the YML file I set up.

name: "PR-metric"

permissions:
  pull-requests: write
  statuses: write
  contents: read

env:
  GITHUB_TOKEN: ${{ github.token }}

on:
  pull_request:
    branches:
      - main

jobs:
  pr-metric:
    runs-on: ubuntu-latest
    name: PR Metrics
    env:
      PR_METRICS_ACCESS_TOKEN: ${{ secrets.ORG_GITHUB_PERSONAL_TOKEN }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: PR metric
        uses: microsoft/[email protected]
        continue-on-error: true
        with:
          file-matching-patterns: |
            app/src/*
            app/src-server/*
            !app/src-server/context/__generated__/*
            core/src/*
            packages/**/src/*
            studio/*
          code-file-extensions: |
            ts
            tsx

GitHub Actions support

Summary

This task should be able to run as a GitHub Action, as well as via the existing mechanism of Azure DevOps.

Rationale

This will compete GitHub support, allowing GitHub users to more easily use the functionality.

Additional Information

It is possible that some changes will be required to the project structure to support this, and it may be necessary to redesign the project from one that can hold a collection of tasks to one that can just accomodate one, due to GitHub Action constraints.

Note that retaining Azure DevOps support is necessary, as there are many current users of this functionality. The key is to provide both sets of functionality from a single codebase.

TypeError – stack: "TypeError: Cannot read property 'length' of null

Summary

PR Metrics 1.4.2
Version Dev18.M170.6

TypeError – stack: "TypeError: Cannot read property 'length' of null\n    at e.forEach (/home/azvmadmin/build_agent_01/_work/_tasks/PRMetrics_907d3b28-6b37-4ac7-ac75-9631ee53e512/1.4.2/index.js:66:130782)\n    at Array.forEach (<anonymous>)\n    at Function.convertPullRequestComments (/home/azvmadmin/build_agent_01/_work/_tasks/PRMetrics_907d3b28-6b37-4ac7-ac75-9631ee53e512/1.4.2/index.js:66:130287)\n    at AzureReposInvoker.getComments (/home/azvmadmin/build_agent_01/_work/_tasks/PRMetrics_907d3b28-6b37-4ac7-ac75-9631ee53e512/1.4.2/index.js:66:127682)\n    at process._tickCallback (internal/process/next_tick.js:68:7)"
TypeError – message: "Cannot read property 'length' of null"

Reproduction Steps

- task: PRMetrics@1
  displayName: PR Metrics
  env:
    PR_METRICS_ACCESS_TOKEN: $(PR_Metrics_Access_Token)
  continueOnError: true

Azure Devops token error

I'm having some problems getting the generation to work due to token errors. It errors out with:

"Could not access the resources. Ensure the 'PR_Metrics_Access_Token' secret environment variable has access to 'Code' > 'Read' and 'Pull Request Threads' > 'Read & write'.

I've tried using it both as my own PAT with those credentials, setup as a pipeline secret variable:

      - task: PRMetrics@1
        displayName: PR Metrics
        env:
          PR_METRICS_ACCESS_TOKEN: $(PR_Metrics_Access_Token)
        continueOnError: true

and by using the, to my knowledge not limited, system access token:

      - task: PRMetrics@1
        displayName: PR Metrics
        env:
          PR_METRICS_ACCESS_TOKEN: $(System.AccessToken)
        continueOnError: true

Both give the same error. Is there anything else that needs to be done?

TODO: Remove System.AccessToken support after a transition period has elapsed

Support for System.AccessToken should be removed after a transition period has elapsed, around December 2022.

This was temporarily required for backwards compatibility, but the goal is to move to the newer PR_METRICS_ACCESS_TOKEN going forwards, which will align with better security practices.

There are references to this within two files – pullRequestMetrics.ts and build.yml. Both instances should be removed when this issue is resolved.

Files are wrongfully counted as test files

Summary

A file like DuplicateStorageItemPlugin.java is considered as a test file because it contains the word test, even though the camel casing shows it's clearly not a test file.

Reproduction Steps

Calculate the metrics for a pull request where a file with a name like DuplicateStorageItemPlugin.java is one of the added/edited files.

file-matching-patterns only respects first match pattern

Summary

File/folder matching only respects the first match provided, subsequent matches are ignored

Reproduction Steps

Create a project with with 3 sibling folders
Add a test file (like a simple typescript file) to all 3 folders
So it will look like this:

  • Root
    • src
      • file.ts
    • __test__
      • file.test.ts
    • Other
      • Other.ts

Create a pipeline to run the github action

          file-matching-patterns: | 
            src/*.ts  
            __test__/*.ts 

Run the pipeline with the actions.

Notes

  1. Logs with indicate Setting the file matching patterns input to '["src/*.ts","__test__/*.ts"]
  2. Folder2 content is excluded

Troubleshooting Undertaken

Additional Information

Work around is to use this syntax:
file-matching-patterns: {src/**/*.ts ,__test__/**/*.ts}

Cannot read property 'forEach' of null - Azure DevOps error

With everything set up in our Azure DevOps, this error occurred to me: ##[error]Cannot read property 'forEach' of null

Since I tried with several different PRs in different repos, I assumed to be an error with the extension.

Basically how I configured: I adjusted the following template as a Build Validation:

variables:
- name: realBranchName
  value: $[replace(variables['Build.SourceBranch'], 'refs/heads/', '')]

pool:
  vmImage: ubuntu-latest

steps:
- checkout: git://$(System.TeamProject)/$(System.PullRequest.SourceRepositoryURI)@$(realBranchName)
  fetchDepth: 0
  
- task: PRMetrics@1
  displayName: 'PR Metrics'
  env:
    PR_METRICS_ACCESS_TOKEN: $(System.AccessToken)
  continueOnError: true

Everytime a new PR is started to main branch, this pipeline runs, however, this error always shows up. I have tried changing the PAT to a full permission. Running PR with README and python changes. Commented on some code and nothing seems to solve this error.

The logs:

Logs (at least the relevant part of it)

Adjusting the base size input to '200'.
Adjusting the growth rate input to '2'.
Adjusting the test factor input to '1'.
Adjusting the always-close-comment mode input to 'false'.
Adjusting the file matching patterns input to '["/*","!/package-lock.json"]'.
Adjusting the code file extensions input to '["js","_js","bones","cjs","es","es6","frag","gs","jake","jsb","jscad","jsfl","jsm","jss","jsx","mjs","njs","pac","sjs","ssjs","xsjs","xsjslib","epj","erb","py","cgi","fcgi","gyp","gypi","lmi","py3","pyde","pyi","pyp","pyt","pyw","rpy","smk","spec","tac","wsgi","xpy","pyx","pxd","pxi","eb","numpy","numpyw","numsc","pytb","java","jsp","ts","tsx","cs","cake","csx","linq","php","aw","ctp","fcgi","inc","php3","php4","php5","phps","phpt","cpp","c++","cc","cp","cxx","h","h++","hh","hpp","hxx","inc","inl","ino","ipp","re","tcc","tpp","c","cats","h","idc","cl","opencl","upc","xbm","xpm","pm","sh","bash","bats","cgi","command","env","fcgi","ksh","tmux","tool","zsh","fish","ebuild","eclass","ps1","psd1","psm1","tcsh","csh","rb","builder","eye","fcgi","gemspec","god","jbuilder","mspec","pluginspec","podspec","prawn","rabl","rake","rbi","rbuild","rbw","rbx","ru","ruby","spec","thor","watchr"]'.
TypeError – stack: "TypeError: Cannot read property 'forEach' of null\n at Function.convertPullRequestComments (/home/vsts/work/_tasks/PRMetrics_28-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:26390:87150)\n at AzureReposInvoker._callee2630$ (/home/vsts/work/_tasks/PRMetrics_28-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:26390:77772)\n at tryCatch (/home/vsts/work/_tasks/PRMetrics_928-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:13424)\n at Generator. (/home/vsts/work/_tasks/PRMetrics_28-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:15967)\n at Generator.next (/home/vsts/work/_tasks/PRMetrics_98-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:14198)\n at asyncGeneratorStep (/home/vsts/work/_tasks/PRMetrics_28-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:6068)\n at _next (/home/vsts/work/_tasks/PRMetrics_8-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:6382)\n at process._tickCallback (internal/process/next_tick.js:68:7)"
TypeError – message: "Cannot read property 'forEach' of null"
🔁 debug – * CodeMetricsCalculator.shouldSkip

...
🔁 info – TypeError – stack: "TypeError: Cannot read property 'forEach' of null\n at Function.convertPullRequestComments (/home/vsts/work/_tasks/PRMetrics_907d8-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:26390:87150)\n at AzureReposInvoker._callee2630$ (/home/vsts/work/_tasks/PRMetrics_28-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:26390:77772)\n at tryCatch (/home/vsts/work/_tasks/PRMetrics_28-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:13424)\n at Generator. (/home/vsts/work/_tasks/PRMetrics_8-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:15967)\n at Generator.next (/home/vsts/work/_tasks/PRMetrics_28-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:14198)\n at asyncGeneratorStep (/home/vsts/work/tasks/PRMetrics-6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:6068)\n at _next (/home/vsts/work/_tasks/PRMetrics_6b37-4ac7-ac75-9631ee53e512/1.5.6/index.js:1:6382)\n at process._tickCallback (internal/process/next_tick.js:68:7)"
🔁 info – TypeError – message: "Cannot read property 'forEach' of null"
##[error]Cannot read property 'forEach' of null
Finishing: PR Metrics

PR Metrics extension

We are trying to make use of PR Metrics extension in our builds. However, it is throwing the error “##[error]No agent found in pool On_Premises_Windows which satisfies the specified demands: api-version/6.0, Agent.Version -gtVersion 2.159.2 “

We tried building using on-prem as well as the hosted build agents.
Extension: https://marketplace.visualstudio.com/items?itemName=ms-omex.prmetrics

Can you please help look into this issue?

Request line change info from Azure DevOps and GitHub

Summary

Investigate the possibility of requesting line change information from Azure DevOps and GitHub, instead of from Git.

Rationale

This will provide results that precisely match the changed lines information within the Azure DevOps and GitHub PRs, avoid confusion caused by mismatches.

It will also work in more cases as there would no longer be a requirement for a large Git history to be present.

Additional Information

This issue needs to be investigated for feasibility. The relevant APIs may not be available on both platforms.

Secret PAT Token does not work on Azure DevOps OnPremise

Summary

PAT Token can not be set to secret to work with PR Metrics in AzureDevops on Premise

Reproduction Steps

Use PR Metrics as a (last) task in some pipeline on Azure DevOps Server On Premise.
Add a pipeline variable called "PR_METRICS_ACCESS_TOKEN" to the pipeline and activate "secret"
-> leads to error "Could not access the Personal Access Token (PAT). Add 'PR_Metrics_Access_Token' as a secret environment variable."
if you deactivate "secret" it works like a charm.

Troubleshooting Undertaken

  • tried to make it case sensitive more correct (PR_Metrics_Access_Token instead of PR_METRICS_ACCESS_TOKEN) and vice versa
  • tried to call it SECRET_PR_METRICS_ACCESS_TOKEN and put it to secret

Additional Information

Versions

Version Azure DevOps Server 2022.1 (AzureDevOpsServer_20231128.1)
PR Metrics v1.5.11

Yaml

yaml export file says: (so it was really added)
Variable 'PR_METRICS_ACCESS_TOKEN' was defined in the Variables tab

Debug Log

debug log of an unsuccessful run (name = pr_metrics_access_token and secret = on)
##[debug]Evaluating condition for step: 'PR Metrics'
##[debug]Evaluating: succeeded()
##[debug]Evaluating succeeded:
##[debug]=> True
##[debug]Result: True
Starting: PR Metrics
==============================================================================
Task         : PR Metrics v1.5.11
Description  : Augments pull request titles to let reviewers quickly determine PR size and test coverage.
Version      : 1.5.11
Author       : Microsoft Corporation
Help         : https://aka.ms/PRMetrics/README
==============================================================================
##[debug]Using node path: C:\agent\externals\node16\bin\node.exe
##[debug]agent.TempDirectory=C:\agent\_work\_temp
##[debug]loading inputs and endpoints
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading SECRET_PR_METRICS_ACCESS_TOKEN
##[debug]loaded 4
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]check path : C:\agent\_work\_tasks\PRMetrics_907d3b28-6b37-4ac7-ac75-9631ee53e512\1.5.11\task.json
##[debug]adding resource file: C:\agent\_work\_tasks\PRMetrics_907d3b28-6b37-4ac7-ac75-9631ee53e512\1.5.11\task.json
##[debug]system.culture=en-US
##[debug]* CodeMetricsCalculator.shouldSkip
##[debug]* PullRequest.isPullRequest
##[debug]* PullRequest.isSupportedProvider
##[debug]* CodeMetricsCalculator.shouldStop()
##[debug]* ReposInvoker.isAccessTokenAvailable
##[debug]* ReposInvoker.getReposInvoker()
##[debug]* AzureReposInvoker.isAccessTokenAvailable
##[debug]task result: Failed
##[error]Could not access the Personal Access Token (PAT). Add 'PR_Metrics_Access_Token' as a secret environment variable.
##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;]Could not access the Personal Access Token (PAT). Add 'PR_Metrics_Access_Token' as a secret environment variable.
##[debug]Processed: ##vso[task.complete result=Failed;]Could not access the Personal Access Token (PAT). Add 'PR_Metrics_Access_Token' as a secret environment variable.
Finishing: PR Metrics

Workflow completes with success despite expired token

Summary

The workflow action runs and completes successfully despite having an expired token. The error message is visible in the log for the workflow.

Reproduction Steps

Create a workflow action using a valid token and run it successfully.
Expire the token.
Re-run the workflow.

Troubleshooting Undertaken

Additional Information

UI list of "successful" runs
image

UI Details from run #3444
image

Error Messages from log

HttpError – stack: "HttpError: Could not access the resources. Ensure the 'PR_Metrics_Access_Token' secret environment variable 
has access to 'repos' (or Read and Write access to pull requests if using a Fine-Grained PAT).\n    
    at /home/runner/work/_actions/microsoft/PR-Metrics/v1.5.2/dist/index.js:1:197755\n    
    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    
    at async requestWithGraphqlErrorHandling (/home/runner/work/_actions/microsoft/PR-Metrics/v1.5.2/dist/index.js:1:189586)\n    
    at async Job.doExecute (/home/runner/work/_actions/microsoft/PR-Metrics/v1.5.2/dist/index.js:1:1157[36]
    (https://github.com/SchiavelloIT/Schiavello.Cyberdyne/actions/runs/7795962582/job/21259779652#step:3:37)0)"
HttpError – message: "Could not access the resources. Ensure the 'PR_Metrics_Access_Token' secret environment variable 
has access to 'repos' (or Read and Write access to pull requests if using a Fine-Grained PAT)."
HttpError – name: "HttpError"
HttpError – status: 401
HttpError – response: {"url":"https://api.github.com/repos/SchiavelloIT/Schiavello.Cyberdyne/pulls/1245",
    "status":401,"headers":{"access-control-allow-origin":"*",
    "access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, 
        X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, 
        X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset",
    "connection":"close","content-length":"80","content-security-policy":"default-src 'none'",
    "content-type":"application/json; charset=utf-8","date":"Tue, 06 Feb 2024 07:10:12 GMT",
    "referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin",
    "server":"GitHub.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload",
    "vary":"Accept-Encoding, Accept, X-Requested-With","x-content-type-options":"nosniff","x-frame-options":"deny",
    "x-github-media-type":"github.v3; format=json","x-github-request-id":"C[38]
    (https://github.com/SchiavelloIT/Schiavello.Cyberdyne/actions/runs/7795962582/job/21259779652#step:3:39)1:6F1B:CFB47A:1A4A76B:65C1DB54","x-ratelimit-limit":"60","x-ratelimit-remaining":"58",
    "x-ratelimit-reset":"1707205134","x-ratelimit-resource":"core","x-ratelimit-used":"2","x-xss-protection":"0"},
    "data":{"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}}

Can't get PR Metrics to work on Azure Devops Server (not cloud)

Summary

PR Metrics task fails with message Could not access sufficient Git history. Set 'fetchDepth: 0' as a parameter to the 'checkout' task (YAML) or disable 'Shallow fetch' under the build process phase settings (classic). even though fetchDepth is set.

Reproduction Steps

Here is an extract of the yaml present in the pipelines :

steps:
    - checkout: self
      lfs: true
      fetchDepth: 0

    - task: PRMetrics@1
      displayName: 'PR Metrics'
      continueOnError: true
      env:
        PR_METRICS_ACCESS_TOKEN: $(System.AccessToken)

Troubleshooting Undertaken

I injected a script to execute the command provided in the troubleshooting document, and one mimicking what the extension does.

variables:
- name: realBranchName
  value: $[replace(variables['Build.SourceBranch'], 'refs/', '')]
- name: realTargetName
  value: $[replace(variables['System.PullRequest.TargetBranch'], 'refs/heads/', 'origin/')]
# other stuff...
    - task: CmdLine@2
      inputs:
        script: |
          git diff --numstat --ignore-all-space $(realTargetName)...$(realBranchName)
          
          git rev-parse --branch $(realTargetName)...$(realBranchName)
Script output
warning: refname 'pull/42422/merge' is ambiguous.
6	1	Sources/azure-pipeline.yml
1	1	Sources/<redacted file 1>.cs
51	0	Sources/<redacted file 2>.sql
5	1	Sources/<redacted path>/PostDeploymentScript/Script.PostDeployment.sql
2	0	Sources/<redacted file 3>.sqlproj

warning: refname 'pull/42422/merge' is ambiguous.
--branch
b4c2a92a44a2d260de67bc0e06cbb338850986f7
27d8c29d9e661967e15e2a8f842d29932a10fdd8
^27d8c29d9e661967e15e2a8f842d29932a10fdd8
PR Metrics task output
2023-07-07T08:46:56.4357848Z ##[debug]Evaluating condition for step: 'PR Metrics'
2023-07-07T08:46:56.4359744Z ##[debug]Evaluating: SucceededNode()
2023-07-07T08:46:56.4361506Z ##[debug]Evaluating SucceededNode:
2023-07-07T08:46:56.4362936Z ##[debug]=> True
2023-07-07T08:46:56.4363455Z ##[debug]Result: True
2023-07-07T08:46:56.4363919Z ##[section]Démarrage : PR Metrics
2023-07-07T08:46:56.4556637Z ==============================================================================
2023-07-07T08:46:56.4556882Z Task         : PR Metrics v1.5.4
2023-07-07T08:46:56.4557010Z Description  : Augments pull request titles to let reviewers quickly determine PR size and test coverage.
2023-07-07T08:46:56.4557574Z Version      : 1.5.4
2023-07-07T08:46:56.4557702Z Author       : Microsoft Corporation
2023-07-07T08:46:56.4557854Z Help         : https://aka.ms/PRMetrics/README
2023-07-07T08:46:56.4557991Z ==============================================================================
2023-07-07T08:46:56.5161684Z ##[debug]Using node path: E:\agent\1\externals\node10\bin\node.exe
2023-07-07T08:46:56.7994100Z ##[debug]agent.TempDirectory=E:\_w\1\_temp
2023-07-07T08:46:56.8028164Z ##[debug]loading inputs and endpoints
2023-07-07T08:46:56.8029042Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2023-07-07T08:46:56.8045793Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2023-07-07T08:46:56.8056461Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2023-07-07T08:46:56.8066220Z ##[debug]loading SECRET_AGENT_PROXYPASSWORD
2023-07-07T08:46:56.8069697Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2023-07-07T08:46:56.8083988Z ##[debug]loaded 5
2023-07-07T08:46:56.8092562Z ##[debug]Agent.ProxyUrl=<redacted>
2023-07-07T08:46:56.8093216Z ##[debug]Agent.ProxyUsername=<redacted>
2023-07-07T08:46:56.8099977Z ##[debug]Agent.ProxyPassword=***
2023-07-07T08:46:56.8100848Z ##[debug]Agent.ProxyBypassList=[<redacted>]
2023-07-07T08:46:56.8103754Z ##[debug]Agent.TempDirectory=E:\_w\1\_temp
2023-07-07T08:46:56.8128618Z ##[debug]expose agent proxy configuration.
2023-07-07T08:46:56.8130317Z ##[debug]Agent.CAInfo=undefined
2023-07-07T08:46:56.8130849Z ##[debug]Agent.ClientCert=undefined
2023-07-07T08:46:56.8131384Z ##[debug]Agent.SkipCertValidation=undefined
2023-07-07T08:46:56.9596564Z ##[debug]check path : E:\_w\1\_tasks\PRMetrics_907d3b28-6b37-4ac7-ac75-9631ee53e512\1.5.4\task.json
2023-07-07T08:46:56.9601862Z ##[debug]adding resource file: E:\_w\1\_tasks\PRMetrics_907d3b28-6b37-4ac7-ac75-9631ee53e512\1.5.4\task.json
2023-07-07T08:46:56.9602570Z ##[debug]system.culture=fr-FR
2023-07-07T08:46:56.9630078Z ##[debug]* CodeMetricsCalculator.shouldSkip
2023-07-07T08:46:56.9630779Z ##[debug]* PullRequest.isPullRequest
2023-07-07T08:46:56.9631355Z ##[debug]* PullRequest.isSupportedProvider
2023-07-07T08:46:56.9639660Z ##[debug]* CodeMetricsCalculator.shouldStop()
2023-07-07T08:46:56.9641759Z ##[debug]* ReposInvoker.isAccessTokenAvailable
2023-07-07T08:46:56.9642885Z ##[debug]* ReposInvoker.getReposInvoker()
2023-07-07T08:46:56.9643623Z ##[debug]* AzureReposInvoker.isAccessTokenAvailable
2023-07-07T08:46:56.9645649Z ##[debug]* GitInvoker.isGitRepo()
2023-07-07T08:46:56.9646520Z ##[debug]* GitInvoker.invokeGit()
2023-07-07T08:46:56.9656277Z ##[debug]which 'git'
2023-07-07T08:46:56.9695592Z ##[debug]found: 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:56.9697545Z ##[debug]E:\agent\1\externals\git\cmd\git.exe arg: ["rev-parse","--is-inside-work-tree"]
2023-07-07T08:46:56.9698350Z ##[debug]E:\agent\1\externals\git\cmd\git.exe arg: ["rev-parse","--is-inside-work-tree"]
2023-07-07T08:46:56.9700325Z ##[debug]exec tool: E:\agent\1\externals\git\cmd\git.exe
2023-07-07T08:46:56.9701873Z ##[debug]exec tool: E:\agent\1\externals\git\cmd\git.exe
2023-07-07T08:46:56.9702380Z ##[debug]arguments:
2023-07-07T08:46:56.9702843Z ##[debug]arguments:
2023-07-07T08:46:56.9703292Z ##[debug]   rev-parse
2023-07-07T08:46:56.9704679Z ##[debug]   rev-parse
2023-07-07T08:46:56.9706083Z ##[debug]   --is-inside-work-tree
2023-07-07T08:46:56.9706623Z ##[debug]   --is-inside-work-tree
2023-07-07T08:46:56.9707581Z ##[debug][command]E:\agent\1\externals\git\cmd\git.exe rev-parse --is-inside-work-tree

2023-07-07T08:46:56.9850361Z (node:14028) Warning: Use Cipheriv for counter mode of aes-256-ctr
2023-07-07T08:46:56.9851887Z (node:14028) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
2023-07-07T08:46:57.0252184Z ##[debug]true

2023-07-07T08:46:57.0331105Z ##[debug]Exit code 0 received from tool 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.0332087Z ##[debug]Exit code 0 received from tool 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.0332746Z ##[debug]STDIO streams have closed for tool 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.0333408Z ##[debug]STDIO streams have closed for tool 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.0334000Z ##[debug]* GitInvoker.isPullRequestIdAvailable()
2023-07-07T08:46:57.0334532Z ##[debug]* GitInvoker.pullRequestIdInternal
2023-07-07T08:46:57.0335083Z ##[debug]* GitInvoker.pullRequestIdForAzurePipelines
2023-07-07T08:46:57.0335620Z ##[debug]* GitInvoker.isGitHistoryAvailable()
2023-07-07T08:46:57.0336130Z ##[debug]* GitInvoker.initialize()
2023-07-07T08:46:57.0336622Z ##[debug]* GitInvoker.targetBranch
2023-07-07T08:46:57.0337139Z ##[debug]* GitInvoker.pullRequestIdInternal
2023-07-07T08:46:57.0337643Z ##[debug]* GitInvoker.invokeGit()
2023-07-07T08:46:57.0338108Z ##[debug]which 'git'
2023-07-07T08:46:57.0353850Z ##[debug]found: 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.0354706Z ##[debug]E:\agent\1\externals\git\cmd\git.exe arg: ["rev-parse","--branch","origin/develop...pull/42422/merge"]
2023-07-07T08:46:57.0355556Z ##[debug]E:\agent\1\externals\git\cmd\git.exe arg: ["rev-parse","--branch","origin/develop...pull/42422/merge"]
2023-07-07T08:46:57.0356325Z ##[debug]exec tool: E:\agent\1\externals\git\cmd\git.exe
2023-07-07T08:46:57.0356960Z ##[debug]exec tool: E:\agent\1\externals\git\cmd\git.exe
2023-07-07T08:46:57.0357538Z ##[debug]arguments:
2023-07-07T08:46:57.0358058Z ##[debug]arguments:
2023-07-07T08:46:57.0358581Z ##[debug]   rev-parse
2023-07-07T08:46:57.0359094Z ##[debug]   rev-parse
2023-07-07T08:46:57.0359602Z ##[debug]   --branch
2023-07-07T08:46:57.0360118Z ##[debug]   --branch
2023-07-07T08:46:57.0360657Z ##[debug]   origin/develop...pull/42422/merge
2023-07-07T08:46:57.0361181Z ##[debug]   origin/develop...pull/42422/merge
2023-07-07T08:46:57.0361876Z ##[debug][command]E:\agent\1\externals\git\cmd\git.exe rev-parse --branch origin/develop...pull/42422/merge

2023-07-07T08:46:57.0929672Z ##[debug]warning: refname 'pull/42422/merge' is ambiguous.

2023-07-07T08:46:57.0974436Z ##[debug]--branch
3d834567b6d60ffde091dd3433f6bd12b3f02223
27d8c29d9e661967e15e2a8f842d29932a10fdd8
^27d8c29d9e661967e15e2a8f842d29932a10fdd8

2023-07-07T08:46:57.1011666Z ##[debug]Exit code 0 received from tool 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.1012608Z ##[debug]Exit code 0 received from tool 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.1013266Z ##[debug]STDIO streams have closed for tool 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.1013899Z ##[debug]STDIO streams have closed for tool 'E:\agent\1\externals\git\cmd\git.exe'
2023-07-07T08:46:57.1065787Z ##[debug]task result: Failed
2023-07-07T08:46:57.1092384Z ##[error]Could not access sufficient Git history. Set 'fetchDepth: 0' as a parameter to the 'checkout' task (YAML) or disable 'Shallow fetch' under the build process phase settings (classic).
2023-07-07T08:46:57.1100962Z ##[debug]Processed: ##vso[task.issue type=error;]Could not access sufficient Git history. Set 'fetchDepth: 0' as a parameter to the 'checkout' task (YAML) or disable 'Shallow fetch' under the build process phase settings (classic).
2023-07-07T08:46:57.1103974Z ##[debug]Processed: ##vso[task.complete result=Failed;]Could not access sufficient Git history. Set 'fetchDepth: 0' as a parameter to the 'checkout' task (YAML) or disable 'Shallow fetch' under the build process phase settings (classic).
2023-07-07T08:46:57.1163431Z ##[section]Fin : PR Metrics

Additional Information

My ADO agents are in version 2.218.1.

Thank you for your help.

Could not access sufficient Git history

Summary

Receive error "Could not access sufficient Git history. Add 'fetch-depth: 0' as a parameter to the 'actions/checkout' action." ever after adding fetch-depth parameter.

Reproduction Steps

Create workflow yaml file as per below. Execute workflow as part of PR status check.

name: PR Metrics
on:
  issues:
    types:
      - opened
      - edited
      - closed
      - reopened
  pull_request_target:
    types:
      - opened
      - edited
      - closed
      - reopened
      - synchronize
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/[email protected]
      with:
        fetch-depth: 0
    - name: PR Metrics
      uses: microsoft/[email protected]
      env:
        PR_METRICS_ACCESS_TOKEN: ${{ secrets.PR_METRICS_ACCESS_TOKEN }}
      continue-on-error: true

Additional Information

Repository is private if that has any implications.

PR Metrics: Rewrite extension in TypeScript

The PR Metrics extension was created when PowerShell was the only language supported for writing Azure DevOps extensions. This has the side effect of limiting the extension to Windows-based pipelines.

It would be preferable to rewrite the task in TypeScript, as per the current best practices, to allow the task to be run on all build pipeline platforms. Details on the process of writing TypeScript extensions can be found at https://github.com/microsoft/azure-pipelines-task-lib/blob/master/node/README.md.

This should also facilitate creating a version of the extension as a GitHub action as per the instructions at https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/creating-a-javascript-action.

Note that this issue will be fairly time consuming to resolve, particularly given that there appears to be no way to incrementally move from PowerShell to TypeScript.

Request for ignoring white spaces while computing diff count.

Summary

We have a typescript codebase, wrapping a component with a wrapper changes the indentation due to linters of the whole codebase. Can this tool avoid the white space changes in the lines for non-padding sensitive languages.

This ends up tagging the PR with a very abrupt size although the Azure Devops PR viewer shows the diff count as a few lines.

Rationale

Additional Information

Task input to configure how metrics count "Test" code

Summary

Currently the task determines test code metric by any file that has the word Test in its name

(/.((T|t)est|TEST)./.test(entry.fileName)

A lot of repos we work with have files with Test in name that are not test code. Would be nice if task had configuration option to accept some file glob patterns or similar to filter test code files. For example a lot of times our projects use a namespace / folder where tests are defined.

Example:
repo

  • SomeAssembly
    • SystemTest.cs
    • SystemTestModule.cs
    • TestModuleAdapter.cs
  • AutomatedTests
    • SomeAssemblyTest
      • TestSystemTest.cs
      • ....

Would like to set a file glob pattern to only count changes to files with "AutomatedTests" in their name for example as the code in "SomeAssembly" is not test code but has "Test" in the name. All the test code is contained under folder with AutomateTests in the name.

Rationale

Will allow for more accurate and meaningful information in the metrics provided back to the PR to use for review or gating purposes.

Changes are not detected - Invalid metrics

Not sure if there is another hidden settings I should set, but I'm not able to the a report from the tool.
What I did:

  1. Installed the tool via Markeplace
  2. Created 2 new pipeline, one using YAML and another using Classic, both using the default settings
  3. Created a file with cs extension with lots of lines. PR was marked as x-small without any additional metric
  4. Merged that PR and opened another one with 291 lines added (see screenshots below), and got the same results
  5. Setting the system.debug to true, I was able to see this output ##[debug]Test File: test.cs (0 lines) which seems wrong

image
image

    Adjusting the test factor input to '1'.
    ##[debug]FileMatchingPatterns=undefined
    ##[debug]* Inputs.initializeFileMatchingPatterns()
    Adjusting the file matching patterns input to '["**/*","!**/package-lock.json"]'.
    ##[debug]CodeFileExtensions=undefined
    ##[debug]* Inputs.initializeCodeFileExtensions()
    Adjusting the code file extensions input to '["js","_js","bones","cjs","es","es6","frag","gs","jake","jsb","jscad","jsfl","jsm","jss","jsx","mjs","njs","pac","sjs","ssjs","xsjs","xsjslib","epj","erb","py","cgi","fcgi","gyp","gypi","lmi","py3","pyde","pyi","pyp","pyt","pyw","rpy","smk","spec","tac","wsgi","xpy","pyx","pxd","pxi","eb","numpy","numpyw","numsc","pytb","java","jsp","ts","tsx","cs","cake","csx","linq","php","aw","ctp","fcgi","inc","php3","php4","php5","phps","phpt","cpp","c++","cc","cp","cxx","h","h++","hh","hpp","hxx","inc","inl","ino","ipp","re","tcc","tpp","c","cats","h","idc","cl","opencl","upc","xbm","xpm","pm","sh","bash","bats","cgi","command","env","fcgi","ksh","tmux","tool","zsh","fish","ebuild","eclass","ps1","psd1","psm1","tcsh","csh","rb","builder","eye","fcgi","gemspec","god","jbuilder","mspec","pluginspec","podspec","prawn","rabl","rake","rbi","rbuild","rbw","rbx","ru","ruby","spec","thor","watchr"]'.
    ##[debug]patternRoot: 'undefined'
    ##[debug]matchOptions.debug: 'false'
    ##[debug]matchOptions.nobrace: 'true'
    ##[debug]matchOptions.noglobstar: 'false'
    ##[debug]matchOptions.dot: 'true'
    ##[debug]matchOptions.noext: 'false'
    ##[debug]matchOptions.nocase: 'true'
    ##[debug]matchOptions.nonull: 'false'
    ##[debug]matchOptions.matchBase: 'false'
    ##[debug]matchOptions.nocomment: 'false'
    ##[debug]matchOptions.nonegate: 'false'
    ##[debug]matchOptions.flipNegate: 'false'
    ##[debug]pattern: '**/*'
    ##[debug]applying include pattern against original list
    ##[debug]1 matches
    ##[debug]pattern: '!**/package-lock.json'
    ##[debug]trimmed leading '!'. pattern: '**/package-lock.json'
    ##[debug]applying exclude pattern against original list
    ##[debug]0 matches
    ##[debug]1 final results
    ##[debug]* CodeMetrics.matchFileExtension()
    ##[debug]* Inputs.codeFileExtensions
    ##[debug]* Inputs.initialize()
    ##[debug]File name 'test.cs' has extension 'cs', which is included.
    ##[debug]* CodeMetrics.constructMetrics()
    ##[debug]Test File: test.cs (0 lines)
    ##[debug]* CodeMetrics.initializeIsSufficientlyTested()
    ##[debug]* Inputs.testFactor
    ##[debug]* Inputs.initialize()
    ##[debug]* Inputs.testFactor
    ##[debug]* Inputs.initialize()
    ##[debug]* CodeMetrics.initializeSizeIndicator()
    ##[debug]* CodeMetrics.calculateSize()
    ##[debug]* Inputs.baseSize
    ##[debug]* Inputs.initialize()
    ##[debug]* CodeMetrics.getDeletedFilesNotRequiringReview()

Kindly regards

  • Mario

Allow for the large pull request message to be optional

Summary

The large pull request message should be made optional by using a boolean config setting.

Other options:

  • Custom number of lines that determines when a PR is too large
  • Default set the comment closed using a config setting

Rationale

  • No need to close/resolve the comment (which can prevent the pull request from completing automatically)
  • If you choose a low base size (e.g. 50) a lot of pull requests end up too large

Additional Information

See also: #255

Show dashes (-) instead of 0 in the table

Summary

It would be great if the table showed dashes instead of 0s

Rationale

This would make it much easier to read the table and would match some other products' way of showing 0.

Additional Information

image

PR Metrics: Update tests to Pester 5.0+ idioms

Before the PR Metrics extension was open sourced, it was limited to using Pester 3.0. This older version of Pester resulted in many constraints when writing unit tests, which are no longer necessary following the upgrade (as part of open sourcing) to Pester 5.0. In addition, the API differences between Pester 3.0 and Pester 5.0 are significant and in many cases the legacy APIs are being used.

This task is to track upgrading the tests from Pester 3.0 idioms to Pester 5.0 idioms. This work should comprise:

  • Fixing the mocks to use the new idioms. The old idioms will eventually become unsupported, so moving to the new idioms will be necessary at some stage.
  • Extracting out mocks where possible, to avoid repetition.
  • Less reliance on console printing to validate calls have been made successfully. This will accelerate adding new functionality as it will require fewer test changes.
  • Better validation of JSON payloads. The payloads can differ depending on the environment in which they are run, which has led to incomplete JSON payload validation in the tests as a workaround. The guidance at https://dscottraynsford.wordpress.com/2015/08/23/comparing-objects-using-json-in-powershell-for-pester-tests/ can be used to help resolve this issue.
  • Better validation of array/collection response types. These responses can differ depending on the environment in which they are run, so all reliance on ordering should be removed for improved robustness.
  • Better use of mocks to increase the number of unit tests and reduce the number of integration tests.
  • Better splitting of the tests between unit and integration tests.
  • Re-enabling test coverage.

Information on migrating Pester tests can be found at https://pester.dev/docs/migrations/v3-to-v4 and https://dsccommunity.org/blog/converting-tests-to-pester5/, and the Pester docs can be found at https://pester.dev/.

Note that this is best implemented via a series of changes given the significant volume of issue highlighted above. If done incrementally, the change should be manageable.

The message for a pull request that is too large shows the wrong number

Summary

❌ Try to keep pull requests smaller than x lines...

x is not the same number as the number that is used too check the size
x equals the baseSize and the number to check is baseSize * 2

Reproduction Steps

Use the default growthRate. Create a pull request with size between baseSize and baseSize * 2 (= small).
The message will be ❌ Try to keep pull requests smaller than baseSize lines...

Additional Information

- task: PRMetrics@1
  displayName: PR Metrics
  env:
    PR_METRICS_ACCESS_TOKEN: $(PRmetrics)
  inputs:
    TestFactor: 0.0
    BaseSize: 50
    FileMatchingPatterns: |
      **/*
    CodeFileExtensions: |
      java
      xml
      html
      yaml
      jrxml
      txt
      meta
      sql
      js
      properties
      css
      xsd
      dlg
      yaml
      yml
      iml
  continueOnError: true  

Request: Make PR comment table horizontal vs vertical

Summary

Make the metrics table horizontal vs vertical to save space. This could be an optional format, or just the new default one.

Rationale

When there is a lot of activity in a pull request on GitHub, vertical screen real estate can quickly be eaten up by various Actions and bot comments. By switching the format of the PR metrics table, we can quickly re-gain some of that space.

Additional Information

Current:

Lines
Product Code 0
Test Code 2
Subtotal 2
Ignored Code 23
Total 25

Proposed:

Product Code Test Code Subtotal Ignored Code Total
Lines 0 2 2 23 25

PR validation time

Summary

We want to add metric about duration between published (not draft) and completed. This can be interesting to have the metric of how long the pull request is lasting directly on the PR but it should also be great to have it in Analytics view. Do you know an easy way to have the PR duration from the publication (not draft) to the completion ?
Also I know that we have the file count but can we have also the team count ?
is it possible to have this metrics for an overall Repo in a central place ?
Another metric could be interesting: the Count of published (how many time from draft to publish back to draft...)

Rationale

It's heart metric of a PR and will help to do proper PR

Additional Information

It would be great to have it directly in the tool without to build intermediate tool like CCOInsights report ADO Dashboard Deployment Guide · Azure/CCOInsights Wiki · GitHub

Git diff failing - classic non-yaml PR pipeline

Summary

This line is failing on my repo:
https://github.com/microsoft/OMEX-Azure-DevOps-Extensions/blob/7bdbb325db12c82e761991c4fa4d5a179e763c3e/PipelinesTasks/PRMetrics/buildAndReleaseTask/src/git/gitInvoker.ts#L33

This is a classic release pipeline with the OAuth token checkbox checked:
image

I have another classic release pipeline that works a-ok, so I'm a bit stumped. The only guess I have is that this one uses 'develop' instead of 'development'

screenshot of pipeline run:
image

Reproduction Steps

Open PR into 'develop' PR metrics step runs and then fails with this.

Additional Information

Option to skip PR title changes

Summary

An input option to not alter a pull request's title would be really helpful.

Rationale

In the scenario where you are squashing merge commits, the additional prefix on the pull request makes it difficult to apply standard semver parsing to get versioning for a set of commits. I've encountered difficult with this when using GitHub Actions (https://github.com/ietf-tools/semver-action) as well as trying to create regex for GitHub branch rulesets. Making this feature something that can be toggled should be relatively easy.

Additional Information

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.