Browse Source

Rename dev branch to main for consistency

Vince Salvino 1 year ago
parent
commit
dc3a607aae
4 changed files with 32 additions and 31 deletions
  1. 1 1
      README.md
  2. 1 1
      azure-pipelines.yml
  3. 14 14
      ci/compare-codecov.ps1
  4. 16 15
      docs/contributing/index.rst

+ 1 - 1
README.md

@@ -15,7 +15,7 @@ Wagtail and Bootstrap.
 |                        |                      |
 |------------------------|----------------------|
 | Python Package         | [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/coderedcms)](https://pypi.org/project/coderedcms/) [![PyPI - Django Version](https://img.shields.io/pypi/djversions/coderedcms)](https://pypi.org/project/coderedcms/) [![PyPI - Wheel](https://img.shields.io/pypi/wheel/coderedcms)](https://pypi.org/project/coderedcms/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/coderedcms)](https://pypi.org/project/coderedcms/) [![PyPI](https://img.shields.io/pypi/v/coderedcms)](https://pypi.org/project/coderedcms/) |
-| Build                  | [![Build Status](https://dev.azure.com/coderedcorp/cr-github/_apis/build/status/coderedcms?branchName=dev)](https://dev.azure.com/coderedcorp/coderedcms/_build/latest?definitionId=1&branchName=dev) [![Azure DevOps tests (branch)](https://img.shields.io/azure-devops/tests/coderedcorp/cr-github/1/dev)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=1&branchName=dev) [![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/coderedcorp/cr-github/1/dev)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=1&branchName=dev) |
+| Build                  | [![Build Status](https://dev.azure.com/coderedcorp/cr-github/_apis/build/status/coderedcms?branchName=main)](https://dev.azure.com/coderedcorp/coderedcms/_build/latest?definitionId=1&branchName=main) [![Azure DevOps tests (branch)](https://img.shields.io/azure-devops/tests/coderedcorp/cr-github/1/main)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=1&branchName=main) [![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/coderedcorp/cr-github/1/main)](https://dev.azure.com/coderedcorp/cr-github/_build/latest?definitionId=1&branchName=main) |
 
 
 ## What is Wagtail CRX?

+ 1 - 1
azure-pipelines.yml

@@ -17,7 +17,7 @@
 
 
 trigger:
-  - dev
+  - main
 
 
 stages:

+ 14 - 14
ci/compare-codecov.ps1

@@ -2,7 +2,7 @@
 
 <#
 .SYNOPSIS
-Compares code coverage percent of local coverage.xml file to dev 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.
-$devBuildJson = (
-    Invoke-WebRequest "$ApiBase/_apis/build/builds?branchName=refs/heads/dev&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 $devBuildJson.value) {
+foreach ($build in $mainBuildJson.value) {
     if ($build.definition.name -eq $pipeline_name) {
-        $devLatestId = $build.id
+        $mainLatestId = $build.id
         break
     }
 }
 
 # Retrieve code coverage for this build ID.
-$devCoverageJson = (
-    Invoke-WebRequest "$ApiBase/_apis/test/codecoverage?buildId=$devLatestId&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 $devCoverageJson.coverageData.coverageStats) {
+foreach ($cov in $mainCoverageJson.coverageData.coverageStats) {
     if ($cov.label -eq "Lines") {
-        $devlinerate = [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 "Dev branch coverage rate:   $devlinerate%"
+Write-Output "Main branch coverage rate:  $mainLinerate%"
 Write-Output "This branch coverage rate:  $branchlinerate%"
 
-if ($devlinerate -eq 0) {
+if ($mainLinerate -eq 0) {
     $change = "Infinite"
 }
 else {
-    $change = [math]::Abs($branchlinerate - $devlinerate)
+    $change = [math]::Abs($branchlinerate - $mainLinerate)
 }
 
-if ($branchlinerate -gt $devlinerate) {
+if ($branchlinerate -gt $mainLinerate) {
     Write-Host "Coverage increased by $change% 😀" -ForegroundColor Green
     exit 0
 }
-elseif ($branchlinerate -eq $devlinerate) {
+elseif ($branchlinerate -eq $mainLinerate) {
     Write-Host "Coverage has not changed." -ForegroundColor Green
     exit 0
 }

+ 16 - 15
docs/contributing/index.rst

@@ -7,7 +7,7 @@ Developing Wagtail CRX
 
 To create a test project locally:
 
-#. Clone the code from https://github.com/coderedcorp/coderedcms (dev branch).
+#. Clone the code from https://github.com/coderedcorp/coderedcms (main branch).
 #. Run ``pip install -r requirements-dev.txt`` from the root coderedcms
    directory. This will install development tools, and also make the install
    editable, which is relevant when running ``makemigrations`` in test project
@@ -38,22 +38,23 @@ Each production project that uses coderedcms should specify the appropriate
 version in its requirements.txt to prevent breakage.
 
 .. note::
-    When testing existing projects with coderedcms installed from a development
-    branch, be sure to use a disposable database, as it is likely that the
-    migrations will not be the same migrations that get released.
+
+   When testing existing projects with coderedcms installed from a development
+   branch, be sure to use a disposable database, as it is likely that the
+   migrations will not be the same migrations that get released.
 
 
 Branching Strategy
 ------------------
 
 Primary development takes place in individual branches for each feature or bug.
-Changes are then made as a pull request against the ``dev`` branch.
+Changes are then made as a pull request against the ``main`` branch.
 
-The ``dev`` branch is the primary working branch, representing the development
+The ``main`` branch is the primary working branch, representing the development
 version of coderedcms.
 
 Releases are maintained in ``release/X.Y`` branches, where X is the Major
-version and Y is the Minor version. Maintenance patches are applied in ``dev``
+version and Y is the Minor version. Maintenance patches are applied in ``main``
 (if applicable) and then merged or cherry-picked into the respective release
 branch.
 
@@ -112,7 +113,7 @@ license header comment states copyright, ownership, license, and also provides c
     /*!
     Wagtail CRX (https://www.coderedcorp.com/cms/)
     Copyright 2018-2021 CodeRed LLC
-    License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
+    License: https://github.com/coderedcorp/coderedcms/blob/main/LICENSE
     @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause
     */
 
@@ -155,8 +156,8 @@ code coverage percentage in the console:
 Detailed test coverage reports are now available by opening ``htmlcov/index.html``
 in your browser (which is ignored by version control).
 
-To compare your current code coverage against the code coverage of the dev
-branch (based on latest Azure Pipeline build from dev) run:
+To compare your current code coverage against the code coverage of the main
+branch (based on latest Azure Pipeline build from main) run:
 
 .. code-block:: console
 
@@ -240,10 +241,10 @@ request process to ensure quality.**
 Merging Pull Requests
 ---------------------
 
-Follow these guidelines to merge a pull request into the dev branch:
+Follow these guidelines to merge a pull request into the main branch:
 
 * Unit tests pass.
-* Code coverage is not lower than dev branch.
+* Code coverage is not lower than main branch.
 * Documentation builds, and the PR provides documentation (release notes at a
   minimum).
 * If there is a related issue, the issue is referenced and/or closed (if
@@ -255,11 +256,11 @@ Follow these guidelines to merge a pull request into the dev branch:
 In the event that the pull request needs more work that the author is unable to
 provide, the following process should be followed:
 
-* Create a new branch from dev in the form of ``merge/pr-123`` where 123 is
+* Create a new branch from main in the form of ``merge/pr-123`` where 123 is
   the original pull request number.
-* Edit the pull request to merge into the new branch instead of dev.
+* Edit the pull request to merge into the new branch instead of main.
 * Make the necessary changes and submit for review using the normal process.
-* When merging this branch into dev, follow the same process above, but be
+* When merging this branch into main, follow the same process above, but be
   sure to credit the original author(s) by adding their names to the bottom of
   the commit message as so (see
   `GitHub documentation <https://help.github.com/en/articles/creating-a-commit-with-multiple-authors>`_):