Browse Source

Rename master to dev (#359)

* Rename master -> dev
* Fix pipeline warnings
Vince Salvino 4 years ago
parent
commit
59bc83e8e3

+ 2 - 2
README.md

@@ -19,8 +19,8 @@
 
 |                        |                      |
 |------------------------|----------------------|
-| 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/coderedcms/_apis/build/status/coderedcms?branchName=master)](https://dev.azure.com/coderedcorp/coderedcms/_build/latest?definitionId=1&branchName=master) [![Azure DevOps tests (branch)](https://img.shields.io/azure-devops/tests/coderedcorp/coderedcms/1/master)](https://dev.azure.com/coderedcorp/coderedcms/_build/latest?definitionId=1&branchName=master) [![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/coderedcorp/coderedcms/1/master)](https://dev.azure.com/coderedcorp/coderedcms/_build/latest?definitionId=1&branchName=master) |
+| 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/coderedcms/_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/coderedcms/1/dev)](https://dev.azure.com/coderedcorp/coderedcms/_build/latest?definitionId=1&branchName=dev) [![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/coderedcorp/coderedcms/1/dev)](https://dev.azure.com/coderedcorp/coderedcms/_build/latest?definitionId=1&branchName=dev) |
 
 
 

+ 6 - 4
azure-pipelines.yml

@@ -17,7 +17,7 @@
 
 
 trigger:
-  - master
+  - dev
 
 
 stages:
@@ -103,16 +103,18 @@ stages:
       vmImage: 'ubuntu-latest'
 
     steps:
-    - task: DownloadPipelineArtifact@2
+    - task: DownloadBuildArtifacts@0
       displayName: 'Download code coverage from current build'
       inputs:
-        source: 'current'
-        path: '$(Agent.WorkFolder)/current-artifacts'
+        buildType: 'current'
         project: '$(System.TeamProjectId)'
         pipeline: '$(System.DefinitionId)'
+        downloadType: 'specific'
+        downloadPath: '$(Agent.WorkFolder)/current-artifacts'
 
     - pwsh: ./ci/compare-codecov.ps1 -wd $Env:WorkDir
       displayName: 'CR-QC: Compare code coverage'
+      failOnStderr: false
       env:
         WorkDir: $(Agent.WorkFolder)
 

+ 20 - 20
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 dev 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"
+$devBuildJson = (
+    Invoke-WebRequest "$ApiBase/_apis/build/builds?branchName=refs/heads/dev&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 $devBuildJson.value) {
     if ($build.definition.name -eq $pipeline_name) {
-        $masterLatestId = $build.id
+        $devLatestId = $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"
+$devCoverageJson = (
+    Invoke-WebRequest "$ApiBase/_apis/test/codecoverage?buildId=$devLatestId&api-version=5.1-preview.1"
 ).Content | ConvertFrom-Json
-foreach ($cov in $masterCoverageJson.coverageData.coverageStats) {
+foreach ($cov in $devCoverageJson.coverageData.coverageStats) {
     if ($cov.label -eq "Lines") {
-        $masterlinerate = [math]::Round(($cov.covered / $cov.total) * 100, 2)
+        $devlinerate = [math]::Round(($cov.covered / $cov.total) * 100, 2)
     }
 }
 
@@ -73,8 +73,8 @@ if (Test-Path -Path $coveragePath) {
     [xml]$BranchXML = Get-Content $coveragePath
 }
 else {
-    Write-Host  -ForegroundColor Red `
-        "No code coverage from this build. Is pytest configured to output code coverage? Exiting."
+    Write-Host `
+        "##vso[task.LogIssue type=warning;]No code coverage from this build. Is pytest configured to output code coverage?"
     exit 1
 }
 $branchlinerate = [math]::Round([decimal]$BranchXML.coverage.'line-rate' * 100, 2)
@@ -84,26 +84,26 @@ $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 "Dev branch coverage rate:   $devlinerate%"
+Write-Output "This branch coverage rate:  $branchlinerate%"
 
-if ($masterlinerate -eq 0) {
+if ($devlinerate -eq 0) {
     $change = "Infinite"
 }
 else {
-    $change = [math]::Abs($branchlinerate - $masterlinerate)
+    $change = [math]::Abs($branchlinerate - $devlinerate)
 }
 
-if ($branchlinerate -gt $masterlinerate) {
+if ($branchlinerate -gt $devlinerate) {
     Write-Host "Coverage increased by $change% 😀" -ForegroundColor Green
     exit 0
 }
-elseif ($branchlinerate -eq $masterlinerate) {
+elseif ($branchlinerate -eq $devlinerate) {
     Write-Host "Coverage has not changed." -ForegroundColor Green
     exit 0
 }
 else {
-    # Write the error in a way that shows up as the failure reason in Azure Pipelines.
-    Write-Host "##vso[task.LogIssue type=error;]Coverage decreased by $change% 😭"
-    exit 4
+    # Write the error in a way that shows up as a warning in Azure Pipelines.
+    Write-Host "##vso[task.LogIssue type=warning;]Coverage decreased by $change% 😭"
+    exit 0
 }

+ 2 - 2
ci/run-flake8.ps1

@@ -14,9 +14,9 @@ Push-Location $projectDir
 
 # Get the diff for the current branch.
 $ExitCode = 0
-$GitDiff = git diff origin/master
+$GitDiff = git diff origin/dev
 
-# If there is no diff between master, then flake8 everything.
+# If there is no diff between dev, then flake8 everything.
 if ( $null -eq $GitDiff ) {
     flake8 .
     if ($LastExitCode -ne 0) { $ExitCode = $LastExitCode }

+ 1 - 1
coderedcms/static/coderedcms/css/codered-admin.css

@@ -1,7 +1,7 @@
 /*
 CodeRed CMS (https://www.coderedcorp.com/cms/)
 Copyright 2018-2019 CodeRed LLC
-License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
+License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 */
 
 /* Font sizes and inputs */

+ 1 - 1
coderedcms/static/coderedcms/css/codered-editor.css

@@ -1,7 +1,7 @@
 /*
 CodeRed CMS (https://www.coderedcorp.com/cms/)
 Copyright 2018-2019 CodeRed LLC
-License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
+License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 */
 
 /* Reset fonts to system */

+ 2 - 2
coderedcms/static/coderedcms/css/codered-front.css

@@ -1,7 +1,7 @@
 /*
 CodeRed CMS (https://www.coderedcorp.com/cms/)
 Copyright 2018-2019 CodeRed LLC
-License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
+License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 */
 .hero-bg {
   background-size: cover;
@@ -338,4 +338,4 @@ License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
   height: 500px;
 }
 
-/*# sourceMappingURL=codered-front.css.map */
+/*# sourceMappingURL=codered-front.css.map */

File diff suppressed because it is too large
+ 1 - 1
coderedcms/static/coderedcms/css/codered-front.min.css


+ 2 - 2
coderedcms/static/coderedcms/js/codered-editor.js

@@ -1,7 +1,7 @@
 /*
 CodeRed CMS (https://www.coderedcorp.com/cms/)
 Copyright 2018-2019 CodeRed LLC
-License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
+License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause
 */
 
@@ -19,4 +19,4 @@ $(document).ready(function(){
     });
 });
 
-/* @license-end */
+/* @license-end */

+ 1 - 1
coderedcms/static/coderedcms/js/codered-front.js

@@ -1,7 +1,7 @@
 /*
 CodeRed CMS (https://www.coderedcorp.com/cms/)
 Copyright 2018-2019 CodeRed LLC
-License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
+License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause
 */
 

+ 2 - 2
coderedcms/static/coderedcms/js/codered-maps.js

@@ -1,7 +1,7 @@
 /*
 CodeRed CMS (https://www.coderedcorp.com/cms/)
 Copyright 2018-2019 CodeRed LLC
-License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
+License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause
 */
 
@@ -144,4 +144,4 @@ function CurrentLocationControl(controlDiv, map) {
     });
 }
 
-/* @license-end */
+/* @license-end */

+ 1 - 1
coderedcms/static/coderedcms/scss/codered-front.scss

@@ -4,7 +4,7 @@
 /*
 CodeRed CMS (https://www.coderedcorp.com/cms/)
 Copyright 2018-2019 CodeRed LLC
-License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
+License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 */
 
 // Hero unit block

+ 29 - 15
docs/contributing/index.rst

@@ -7,7 +7,7 @@ Developing CodeRed CMS
 
 To create a test project locally:
 
-#. Clone the code from https://github.com/coderedcorp/coderedcms.
+#. Clone the code from https://github.com/coderedcorp/coderedcms (dev 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,10 +38,24 @@ 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 the master or
-    development branches, be sure to use a disposable database, as it is likely
-    that the migrations in master 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.
+
+The ``dev`` 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``
+(if applicable) and then merged or cherry-picked into the respective release
+branch.
 
 
 A Note on Cross-Platform Support
@@ -101,7 +115,7 @@ license header comment states copyright, ownership, license, and also provides c
     /*
     CodeRed CMS (https://www.coderedcorp.com/cms/)
     Copyright 2018-2019 CodeRed LLC
-    License: https://github.com/coderedcorp/coderedcms/blob/master/LICENSE
+    License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
     @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause
     */
 
@@ -144,8 +158,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 master
-branch (based on latest Azure Pipeline build from master) run:
+To compare your current code coverage against the code coverage of the dev
+branch (based on latest Azure Pipeline build from dev) run:
 
 .. code-block:: console
 
@@ -202,8 +216,8 @@ codebase, run:
     $ flake8 .
 
 Alternatively, our continuous integration only analyzes the diff between your
-changes and master. To analyze just the diff of your current changes, run the
-PowerShell script:
+changes and the dev branch. To analyze just the diff of your current changes,
+run the PowerShell script:
 
 .. code-block:: console
 
@@ -231,10 +245,10 @@ request process to ensure quality.**
 Merging Pull Requests
 ---------------------
 
-Follow these guidelines to merge a pull request into the master branch:
+Follow these guidelines to merge a pull request into the dev branch:
 
 * Unit tests pass.
-* Code coverage is not lower than master branch.
+* Code coverage is not lower than dev 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
@@ -246,11 +260,11 @@ Follow these guidelines to merge a pull request into the master 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 master in the form of ``merge/pr-123`` where 123 is
+* Create a new branch from dev 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 master.
+* Edit the pull request to merge into the new branch instead of dev.
 * Make the necessary changes and submit for review using the normal process.
-* When merging this branch into master, follow the same process above, but be
+* When merging this branch into dev, 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>`_):

+ 2 - 2
docs/how_to/headers_and_footers.rst

@@ -27,7 +27,7 @@ override the ``navbar.html`` file included with CodeRed CMS.
 It is advisable to initially copy the contents of `CodeRed CMS navbar.html`_, but
 not necessary.
 
-.. _CodeRed CMS navbar.html: https://github.com/coderedcorp/coderedcms/blob/master/coderedcms/templates/coderedcms/snippets/navbar.html
+.. _CodeRed CMS navbar.html: https://github.com/coderedcorp/coderedcms/blob/dev/coderedcms/templates/coderedcms/snippets/navbar.html
 
 
 Footer
@@ -55,4 +55,4 @@ override the ``footer.html`` file included with CodeRed CMS.
 Similarly, it is advisable to initially copy the contents of `CodeRed CMS
 footer.html`_, but not necessary.
 
-.. _CodeRed CMS footer.html: https://github.com/coderedcorp/coderedcms/blob/master/coderedcms/templates/coderedcms/snippets/footer.html
+.. _CodeRed CMS footer.html: https://github.com/coderedcorp/coderedcms/blob/dev/coderedcms/templates/coderedcms/snippets/footer.html

+ 1 - 1
docs/releases/v0.19.0.rst

@@ -94,7 +94,7 @@ Upgrade considerations
   ``python manage.py migrate`` after upgrading.
 
 
-.. _the files from our sass starter project: https://github.com/coderedcorp/coderedcms/tree/master/coderedcms/project_template/sass/website/static/website/src
+.. _the files from our sass starter project: https://github.com/coderedcorp/coderedcms/tree/dev/coderedcms/project_template/sass/website/static/website/src
 .. _download a copy of the Bootstrap 4.3 sources: https://getbootstrap.com/docs/4.3/getting-started/download/
 
 

Some files were not shown because too many files changed in this diff