From 3bbf96e49599d2a52210cc56228bd9fa73087beb Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com> Date: Wed, 10 Feb 2021 16:20:14 +0530 Subject: [PATCH] chore: update devops docs (#41037) --- SECURITY.md | 12 +++---- docs/devops.md | 66 +++++++++++++++++++------------------- docs/moderator-handbook.md | 20 ++++++------ 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 0f9ad89ee2..9aef5db8b4 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,15 +4,15 @@ This document outlines our security policy for the codebase, and how to report v ## Versions -| Version | Branch | Supported | Website active | -| ----------- | ------------------------ | ------------------ | ---------------- | -| production | `production-current` | :white_check_mark: | freecodecamp.org | -| beta | `production-staging` | :white_check_mark: | freecodecamp.dev | -| development | `master` | | | +| Version | Branch | Supported | Website active | +| ----------- | -------------- | ------------------ | ---------------- | +| production | `prod-current` | :white_check_mark: | freecodecamp.org | +| beta | `prod-staging` | :white_check_mark: | freecodecamp.dev | +| development | `main` | | | ## Reporting a Vulnerability -If you think you have found a vulnerability, *please report responsibly*. Don't create GitHub issues for security issues. Instead, please send an email to `security@freecodecamp.org` and we'll look into it immediately. +If you think you have found a vulnerability, _please report responsibly_. Don't create GitHub issues for security issues. Instead, please send an email to `security@freecodecamp.org` and we'll look into it immediately. We appreciate any responsible disclosure of vulnerabilities that might impact the integrity of our platforms and users. While we do not offer any bounties or swags at the moment, we'll be happy to list your name in our [Hall of Fame](HoF.md) list. diff --git a/docs/devops.md b/docs/devops.md index 743c2440b0..385fc447e5 100644 --- a/docs/devops.md +++ b/docs/devops.md @@ -16,13 +16,13 @@ This involves three steps to be followed in sequence: #### Building the codebase - Mapping Git Branches to Deployments. -Typically, [`main`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main) (the default development branch) is merged into the [`production-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) branch once a day and is released into an isolated infrastructure. +Typically, [`main`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main) (the default development branch) is merged into the [`prod-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/prod-staging) branch once a day and is released into an isolated infrastructure. This is an intermediate release for our developers and volunteer contributors. It is also known as our "staging" or "beta" release. It is identical to our live production environment at `freeCodeCamp.org`, other than it using a separate set of databases, servers, web-proxies, etc. This isolation lets us test ongoing development and features in a "production" like scenario, without affecting regular users of freeCodeCamp.org's main platforms. -Once the developer team [`@freeCodeCamp/dev-team`](https://github.com/orgs/freeCodeCamp/teams/dev-team/members) is happy with the changes on the staging platform, these changes are moved every few days to the [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-current) branch. +Once the developer team [`@freeCodeCamp/dev-team`](https://github.com/orgs/freeCodeCamp/teams/dev-team/members) is happy with the changes on the staging platform, these changes are moved every few days to the [`prod-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/prod-current) branch. This is the final release that moves changes to our production platforms on freeCodeCamp.org. @@ -99,10 +99,10 @@ Currently, only members on the developer team can push to the production branche npm run clean-and-develop ``` -5. Move changes from `main` to `production-staging` via a fast-forward merge +5. Move changes from `main` to `prod-staging` via a fast-forward merge ``` - git checkout production-staging + git checkout prod-staging git merge main git push upstream ``` @@ -112,13 +112,10 @@ Currently, only members on the developer team can push to the production branche > > If they do, you may have done something incorrectly and you should just start over. -The above steps will automatically trigger a run on the build pipeline for the `production-staging` branch. Once the build is complete, the artifacts are saved as `.zip` files in a cold storage to be retrieved and used later. +The above steps will automatically trigger a run on the build pipeline for the `prod-staging` branch. Once the build is complete, the artifacts are saved as `.zip` files in a cold storage to be retrieved and used later. The release pipeline is triggered automatically when a fresh artifact is available from the connected build pipeline. For staging platforms, this process does not involve manual approval and the artifacts are pushed to the Client CDN and API servers. -> [!TIP|label:Estimates] -> Typically the build run takes ~20-25 minutes to complete followed by the release run which takes ~15-20 mins for the client, and ~5-10 mins for the API to be available live. From code push to being live on the staging platforms the whole process takes **~35-45 mins** in total. - ### Pushing changes to Production Applications. The process is mostly the same as the staging platforms, with a few extra checks in place. This is just to make sure, we do not break anything on freeCodeCamp.org which can see hundreds of users using it at any moment. @@ -127,19 +124,19 @@ The process is mostly the same as the staging platforms, with a few extra checks | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -1. Make sure your `production-staging` branch is pristine and in sync with the upstream. +1. Make sure your `prod-staging` branch is pristine and in sync with the upstream. ```sh - git checkout production-staging + git checkout prod-staging git fetch --all --prune - git reset --hard upstream/production-staging + git reset --hard upstream/prod-staging ``` -2. Move changes from `production-staging` to `production-current` via a fast-forward merge +2. Move changes from `prod-staging` to `prod-current` via a fast-forward merge ``` - git checkout production-current - git merge production-staging + git checkout prod-current + git merge prod-staging git push upstream ``` @@ -148,10 +145,7 @@ The process is mostly the same as the staging platforms, with a few extra checks > > If they do, you may have done something incorrectly and you should just start over. -The above steps will automatically trigger a run on the build pipeline for the `production-current` branch. Once a build artifact is ready, it will trigger a run on the release pipeline. - -> [!TIP|label:Estimates] -> Typically the build run takes ~20-25 minutes to complete. +The above steps will automatically trigger a run on the build pipeline for the `prod-current` branch. Once a build artifact is ready, it will trigger a run on the release pipeline. **Additional Steps for Staff Action** @@ -165,22 +159,18 @@ For staff use: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -Once one of the staff members approves a release, the pipeline will push the changes live to freeCodeCamp.org's production CDN and API servers. They typically take ~15-20 mins for the client, and ~5 mins for the API servers to be available live. - -> [!TIP|label:Estimates] -> The release run typically takes ~15-20 mins for each client instance, and ~5-10 mins for each API instance to be available live. From code push to being live on the production platforms the whole process takes **~90-120 mins** in total (not counting the wait time for the staff approval). +Once one of the staff members approves a release, the pipeline will push the changes live to freeCodeCamp.org's production CDN and API servers. ## Build, Test and Deployment Status Here is the current test, build and deployment status of the codebase. -| Type | Branch | Status | Dashboard | -| :--------------- | :------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------- | -| Build Pipeline | [`production-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | [](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_build/latest?definitionId=15&branchName=production-staging) | [Go to status dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_build) | -| Release Pipeline | [`production-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | | [Go to status dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | -| CI Tests | [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-current) |  | [Go to status dashboard](https://travis-ci.com/github/freeCodeCamp/freeCodeCamp/branches) | -| Build Pipeline | [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | [](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_build/latest?definitionId=17&branchName=production-current) | [Go to status dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_build) | -| Release Pipeline | [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | | [Go to status dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | +| Branch | Unit Tests | Integration Tests | Builds & Deployments | +| :------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | +| [`main`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main) | [](https://github.com/freeCodeCamp/freeCodeCamp/actions?query=workflow%3A%22Node.js+CI%22) | [](https://dashboard.cypress.io/projects/ke77ns/analytics/runs-over-time) | - | +| [`prod-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/prod-staging) | [](https://github.com/freeCodeCamp/freeCodeCamp/actions?query=workflow%3A%22Node.js+CI%22+branch%3Aprod-staging) | [](https://dashboard.cypress.io/projects/ke77ns/analytics/runs-over-time) | [Azure Pipelines](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_dashboards/dashboard/d59f36b9-434a-482d-8dbd-d006b71713d4) | +| [`prod-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/prod-staging) | [](https://github.com/freeCodeCamp/freeCodeCamp/actions?query=workflow%3A%22Node.js+CI%22+branch%3Aprod-current) | [](https://dashboard.cypress.io/projects/ke77ns/analytics/runs-over-time) | [Azure Pipelines](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_dashboards/dashboard/d59f36b9-434a-482d-8dbd-d006b71713d4) | +| `prod-next` (experimental, upcoming) | - | - | - | ## Early access and beta testing @@ -194,16 +184,26 @@ We thank you for reporting bugs that you encounter and help in making freeCodeCa Currently a public beta testing version is available at: -