From 7e68ba85c60126cadb3c431ead7a993f1fef513f Mon Sep 17 00:00:00 2001 From: Vince Salvino Date: Thu, 4 Mar 2021 18:13:26 -0500 Subject: [PATCH] Rename master->main --- README.md | 2 +- azure-pipelines.yml | 2 +- ci/compare-codecov.ps1 | 30 +++++++++++++++--------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 890a277..d906d16 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Status | | | |------------------------|----------------------| | Python Package | [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-sass)](https://pypi.org/project/django-sass/) [![PyPI - Django Version](https://img.shields.io/pypi/djversions/django-sass)](https://pypi.org/project/django-sass/) [![PyPI - Wheel](https://img.shields.io/pypi/wheel/django-sass)](https://pypi.org/project/django-sass/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/django-sass)](https://pypi.org/project/django-sass/) [![PyPI](https://img.shields.io/pypi/v/django-sass)](https://pypi.org/project/django-sass/) | -| Build | [![Build Status](https://dev.azure.com/coderedcorp/cr-github/_apis/build/status/django-sass?branchName=master)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=10&branchName=master) [![Azure DevOps tests (branch)](https://img.shields.io/azure-devops/tests/coderedcorp/cr-github/10/master)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=10&branchName=master) [![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/coderedcorp/cr-github/10/master)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=10&branchName=master) | +| Build | [![Build Status](https://dev.azure.com/coderedcorp/cr-github/_apis/build/status/django-sass?branchName=main)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=10&branchName=main) [![Azure DevOps tests (branch)](https://img.shields.io/azure-devops/tests/coderedcorp/cr-github/10/main)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=10&branchName=main) [![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/coderedcorp/cr-github/10/main)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=10&branchName=main) | Installation diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b6745fa..5d5784f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,7 +15,7 @@ trigger: - - master + - main stages: diff --git a/ci/compare-codecov.ps1 b/ci/compare-codecov.ps1 index ce340b7..b1237b4 100644 --- a/ci/compare-codecov.ps1 +++ b/ci/compare-codecov.ps1 @@ -2,7 +2,7 @@ <# .SYNOPSIS -Compares code coverage percent of local coverage.xml file to master branch +Compares code coverage percent of local coverage.xml file to main branch (Azure Pipeline API). .PARAMETER wd @@ -41,25 +41,25 @@ $ApiBase = "https://dev.azure.com/$org/$project" # Get list of all recent builds. -$masterBuildJson = ( - Invoke-WebRequest "$ApiBase/_apis/build/builds?branchName=refs/heads/master&api-version=5.1" +$mainBuildJson = ( + Invoke-WebRequest "$ApiBase/_apis/build/builds?branchName=refs/heads/main&api-version=5.1" ).Content | ConvertFrom-Json # Get the latest matching build ID from the list of builds. -foreach ($build in $masterBuildJson.value) { +foreach ($build in $mainBuildJson.value) { if ($build.definition.name -eq $pipeline_name) { - $masterLatestId = $build.id + $mainLatestId = $build.id break } } # Retrieve code coverage for this build ID. -$masterCoverageJson = ( - Invoke-WebRequest "$ApiBase/_apis/test/codecoverage?buildId=$masterLatestId&api-version=5.1-preview.1" +$mainCoverageJson = ( + Invoke-WebRequest "$ApiBase/_apis/test/codecoverage?buildId=$mainLatestId&api-version=5.1-preview.1" ).Content | ConvertFrom-Json -foreach ($cov in $masterCoverageJson.coverageData.coverageStats) { +foreach ($cov in $mainCoverageJson.coverageData.coverageStats) { if ($cov.label -eq "Lines") { - $masterlinerate = [math]::Round(($cov.covered / $cov.total) * 100, 2) + $mainlinerate = [math]::Round(($cov.covered / $cov.total) * 100, 2) } } @@ -84,21 +84,21 @@ $branchlinerate = [math]::Round([decimal]$BranchXML.coverage.'line-rate' * 100, Write-Output "" -Write-Output "Master line coverage rate: $masterlinerate%" -Write-Output "Branch line coverage rate: $branchlinerate%" +Write-Output "Main coverage rate: $mainlinerate%" +Write-Output "Branch coverage rate: $branchlinerate%" -if ($masterlinerate -eq 0) { +if ($mainlinerate -eq 0) { $change = "Infinite" } else { - $change = [math]::Abs($branchlinerate - $masterlinerate) + $change = [math]::Abs($branchlinerate - $mainlinerate) } -if ($branchlinerate -gt $masterlinerate) { +if ($branchlinerate -gt $mainlinerate) { Write-Host "Coverage increased by $change% 😀" -ForegroundColor Green exit 0 } -elseif ($branchlinerate -eq $masterlinerate) { +elseif ($branchlinerate -eq $mainlinerate) { Write-Host "Coverage has not changed." -ForegroundColor Green exit 0 }