percy / percy-js

[Deprecated] JavaScript API client library for Percy.
MIT License
31 stars 19 forks source link

Add new Azure DevOps PullRequestNumber env var #257

Closed jlindsayDev closed 3 years ago

jlindsayDev commented 3 years ago

Add support for Azure DevOps change in pull request number environment variable https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#system-variables-devops-services

System.PullRequest.PullRequestId

The ID of the pull request that caused this build. For example: 17. (This variable is initialized only if the build ran because of a Git PR affected by a branch policy).

System.PullRequest.PullRequestNumber

The number of the pull request that caused this build. This variable is populated for pull requests from GitHub which have a different pull request ID and pull request number. This variable is only available in a YAML pipeline if the PR is a affected by a branch policy.

jlindsayDev commented 3 years ago

Update here: holding off on merging since we might have to change more env variables to get the correct branch name, too. Additionally, I've shifted focus to ensuring we can fetch this information asynchronously via the APIs before integrating preemptive changes to the SDK.

Will revisit this mid next week, when I predict I'll have a better understanding of what other minor changes would have to be made to the SDK to support Azure DevOps

jlindsayDev commented 3 years ago

Was looking into capturing additional environment variables, but might not be as valuable in the grand scheme of things since it would require a great deal of refactoring. Will create a new PR if the need arises.