Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Rename dev branch to main #2202

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ body:

Reference the diagram and discussion on [the release process docs](https://docs.calitp.org/benefits/deployment/release/).

* `Regular` release: propagates from `dev` to `test`, and then `test` to `prod`. Only possible if `dev` is ready to deploy.
* `Hotfix` release: fix is merged into `prod`. After release, fix is propagated to `dev` and `test`.
* `Regular` release: propagates from `main` to `test`, and then `test` to `prod`. Only possible if `main` is ready to deploy.
* `Hotfix` release: fix is merged into `prod`. After release, fix is propagated to `main` and `test`.
- type: dropdown
id: type
attributes:
Expand All @@ -78,12 +78,12 @@ body:
label: Regular release checklist
description: Complete these items in sequence as the `Regular` release progresses
options:
- label: Ensure the `dev` branch and secrets are up to date
- label: Ensure the `main` branch and secrets are up to date
- label: Create a branch called release/version from the source branch
- label: Bump the application version
- label: Open a PR for the release branch into `dev`, merge
- label: Open a PR for the release branch into `main`, merge
- label: Ensure `test` secrets are up to date
- label: Open another PR from `dev` to `test`, merge
- label: Open another PR from `main` to `test`, merge
- label: QA the app in test
- label: Ensure `prod` secrets are up to date
- label: Open a PR for the `test` branch into `prod`, merge
Expand All @@ -109,7 +109,7 @@ body:
- label: Create a release in GitHub for the tag, generating release notes
- label: Edit release notes to link back to this Release process issue
- label: Edit release notes with additional context, images, animations, etc. as-needed
- label: Create a branch off `dev`
- label: Create a branch off `main`
- label: Open a PR from `prod` into that branch, merge
- label: (optional) Adapt hotfix to current state of `dev` in that same branch
- label: Merge the PR into `dev`
- label: (optional) Adapt hotfix to current state of `main` in that same branch
- label: Merge the PR into `main`
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "**.js"
- "**.py"
pull_request:
branches: [dev, test, prod]
branches: [main, test, prod]
paths:
- "**.js"
- "**.py"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- dev
- main
- test
- prod

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Label dev deploys

on:
pull_request:
branches: [dev]
branches: [main]
types: [opened]
paths:
- ".github/workflows/deploy-*.yml"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Label docs

on:
pull_request:
branches: [dev]
branches: [main]
types: [opened]
paths:
- 'docs/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler-infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Label infrastructure

on:
pull_request:
branches: [dev]
branches: [main]
types: [opened]
paths:
- 'docs/deployment/**'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ on:
types:
- completed
branches:
- dev
- main
pull_request:
branches:
- dev
- main
paths:
- "docs/**"
- "mkdocs.yml"
- ".github/workflows/mkdocs.yml"
push:
branches:
- dev
- main
paths:
- "docs/**"
- "mkdocs.yml"
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
uses: dawidd6/action-download-artifact@v6
with:
workflow: tests-pytest.yml
branch: dev
branch: main
event: push
name: coverage-report
path: docs/tests/coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: UI & a11y tests
on:
workflow_dispatch:
pull_request:
branches: [dev, test, prod]
branches: [main, test, prod]

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion benefits/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_secret_by_name(secret_name, client=None):
elif client is None:
# construct the KeyVault URL from the runtime environment
# see https://docs.calitp.org/benefits/deployment/infrastructure/#environments
# and https://github.com/cal-itp/benefits/blob/dev/terraform/key_vault.tf
# and https://github.com/cal-itp/benefits/blob/main/terraform/key_vault.tf
vault_url = KEY_VAULT_URL.format(env=runtime_env[0])
logger.debug(f"Configuring Azure KeyVault secrets client for: {vault_url}")

Expand Down
6 changes: 3 additions & 3 deletions docs/configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ else:
# do something when this agency is inactive
```

[benefits-manage]: https://github.com/cal-itp/benefits/blob/dev/manage.py
[benefits-settings]: https://github.com/cal-itp/benefits/blob/dev/benefits/settings.py
[benefits-wsgi]: https://github.com/cal-itp/benefits/blob/dev/benefits/wsgi.py
[benefits-manage]: https://github.com/cal-itp/benefits/blob/main/manage.py
[benefits-settings]: https://github.com/cal-itp/benefits/blob/main/benefits/settings.py
[benefits-wsgi]: https://github.com/cal-itp/benefits/blob/main/benefits/wsgi.py
[django-model]: https://docs.djangoproject.com/en/5.0/topics/db/models/
[django-settings]: https://docs.djangoproject.com/en/5.0/topics/settings/
[django-using-settings]: https://docs.djangoproject.com/en/5.0/topics/settings/#using-settings-in-python-code
Expand Down
8 changes: 4 additions & 4 deletions docs/configuration/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ bin/reset_db.sh
See the [Django Environment Variables](environment-variables.md#django) section for details about how to configure the local
database rebuild.

[core-models]: https://github.com/cal-itp/benefits/blob/dev/benefits/core/models.py
[core-models]: https://github.com/cal-itp/benefits/blob/main/benefits/core/models.py
[django-fixtures]: https://docs.djangoproject.com/en/5.0/topics/db/fixtures/
[django-load-initial-data]: https://docs.djangoproject.com/en/5.0/howto/initial-data/
[eligibility-server]: https://docs.calitp.org/eligibility-server
[init]: https://github.com/cal-itp/benefits/blob/dev/bin/init.sh
[reset-db]: https://github.com/cal-itp/benefits/blob/dev/bin/reset_db.sh
[sample-fixtures]: https://github.com/cal-itp/benefits/tree/dev/benefits/core/migrations/local_fixtures.json
[init]: https://github.com/cal-itp/benefits/blob/main/bin/init.sh
[reset-db]: https://github.com/cal-itp/benefits/blob/main/bin/reset_db.sh
[sample-fixtures]: https://github.com/cal-itp/benefits/tree/main/benefits/core/migrations/local_fixtures.json
2 changes: 1 addition & 1 deletion docs/configuration/oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ use in e.g. views.
Consumers call `benefits.oauth.client.create_client(oauth, provider)` with the name of a client to obtain an Authlib client
instance. If that client name has not been registered yet, `_register_provider(oauth_registry, provider)` uses data from the given `AuthProvider` instance to register the client into this instance and returns the client object.

[oauth-client]: https://github.com/cal-itp/benefits/blob/dev/benefits/oauth/client.py
[oauth-client]: https://github.com/cal-itp/benefits/blob/main/benefits/oauth/client.py
4 changes: 2 additions & 2 deletions docs/deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Docker images for each of the deploy branches are available from GitHub Containe
[oet]: https://techblog.cdt.ca.gov/2020/06/cdt-taking-the-lead-in-digital-transformation/
[app-service-containers]: https://docs.microsoft.com/en-us/azure/app-service/configure-custom-container
[app-service]: https://docs.microsoft.com/en-us/azure/app-service/overview
[deploy-workflow]: https://github.com/cal-itp/benefits/blob/dev/.github/workflows/deploy.yml
[dockerfile]: https://github.com/cal-itp/benefits/blob/dev/Dockerfile
[deploy-workflow]: https://github.com/cal-itp/benefits/blob/main/.github/workflows/deploy.yml
[dockerfile]: https://github.com/cal-itp/benefits/blob/main/Dockerfile
[az-webapp]: https://azure.microsoft.com/en-us/services/app-service/containers/
[ghcr]: https://github.com/features/packages
12 changes: 6 additions & 6 deletions docs/deployment/infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The infrastructure is configured as code via [Terraform](https://www.terraform.i

Since the Benefits app is deployed into a Microsoft Azure account provided by the California Department of Technology (CDT)'s Office of Enterprise Technology (OET) team, you'll need to request access from them to the `CDT Digital CA` directory so you can get into the [Azure portal](https://portal.azure.com), and to the `California Department of Technology` directory so you can access [Azure DevOps](https://calenterprise.visualstudio.com/CDT.OET.CAL-ITP).

The Azure portal is where you can view the infrastructure resources for Benefits. Azure DevOps is where our [infrastructure pipeline](https://github.com/cal-itp/benefits/blob/dev/terraform/azure-pipelines.yml) is run to build and deploy those infrastructure resources.
The Azure portal is where you can view the infrastructure resources for Benefits. Azure DevOps is where our [infrastructure pipeline](https://github.com/cal-itp/benefits/blob/main/terraform/azure-pipelines.yml) is run to build and deploy those infrastructure resources.

## Environments

Expand All @@ -16,7 +16,7 @@ Each of our environments corresponds to a single Resource Group, [Terraform Work

| Environment | Subscription | Resource Group | Workspace | Branch |
| ----------- | --------------------- | ----------------------------- | --------- | ------ |
| Dev | `CDT/ODI Development` | `RG-CDT-PUB-VIP-CALITP-D-001` | `dev` | `dev` |
| Dev | `CDT/ODI Development` | `RG-CDT-PUB-VIP-CALITP-D-001` | `dev` | `main` |
| Test | `CDT/ODI Development` | `RG-CDT-PUB-VIP-CALITP-T-001` | `test` | `test` |
| Prod | `CDT/ODI Production` | `RG-CDT-PUB-VIP-CALITP-P-001` | `default` | `prod` |

Expand Down Expand Up @@ -146,15 +146,15 @@ Use the following shorthand for conveying the Resource Type as part of the Resou
1. Install dependencies:

- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
- [Terraform](https://www.terraform.io/downloads) - see exact version in [`deploy.yml`](https://github.com/cal-itp/benefits/blob/dev/terraform/pipeline/deploy.yml)
- [Terraform](https://www.terraform.io/downloads) - see exact version in [`deploy.yml`](https://github.com/cal-itp/benefits/blob/main/terraform/pipeline/deploy.yml)

1. [Authenticate using the Azure CLI](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/azure_cli).

```sh
az login
```

1. Outside the [dev container](../../getting-started/), navigate to the [`terraform/`](https://github.com/cal-itp/benefits/tree/dev/terraform) directory.
1. Outside the [dev container](../../getting-started/), navigate to the [`terraform/`](https://github.com/cal-itp/benefits/tree/main/terraform) directory.
1. [Initialize Terraform.](https://www.terraform.io/cli/commands/init) You can also use this script later to switch between [environments](#environments).

```sh
Expand Down Expand Up @@ -189,7 +189,7 @@ When configuration changes to infrastructure resources are needed, they should b

[![Build Status](https://calenterprise.visualstudio.com/CDT.OET.CAL-ITP/_apis/build/status/cal-itp.benefits%20Infra?branchName=dev)](https://calenterprise.visualstudio.com/CDT.OET.CAL-ITP/_build/latest?definitionId=828&branchName=dev)

When code is pushed to any branch on GitHub, our infrastructure pipeline in Azure DevOps runs [`terraform plan`](https://www.terraform.io/cli/commands/plan). When the pull request is merged into `dev`, the pipeline runs [`terraform apply`](https://www.terraform.io/cli/commands/apply).
When code is pushed to any branch on GitHub, our infrastructure pipeline in Azure DevOps runs [`terraform plan`](https://www.terraform.io/cli/commands/plan). When the pull request is merged into `main`, the pipeline runs [`terraform apply`](https://www.terraform.io/cli/commands/apply).

While other automation for this project is done through GitHub Actions, we use an Azure Pipeline for a couple of reasons:

Expand All @@ -203,6 +203,6 @@ These steps were followed when setting up our Azure deployment for the first tim
- CDT team creates the [resources that they own](#ownership)
- `terraform apply`
- Set up Slack notifications by [creating a Slack email](https://slack.com/help/articles/206819278-Send-emails-to-Slack) for the [#notify-benefits](https://cal-itp.slack.com/archives/C022HHSEE3F) channel, then [setting it as a Secret in the Key Vault](https://learn.microsoft.com/en-us/azure/key-vault/secrets/quick-create-portal#add-a-secret-to-key-vault) named `slack-benefits-notify-email`
- Set required [App Service configuration](../configuration/environment-variables.md) and [configuration](../configuration/data.md) by setting values in Key Vault (the mapping is defined in [app_service.tf](https://github.com/cal-itp/benefits/blob/dev/terraform/app_service.tf))
- Set required [App Service configuration](../configuration/environment-variables.md) and [configuration](../configuration/data.md) by setting values in Key Vault (the mapping is defined in [app_service.tf](https://github.com/cal-itp/benefits/blob/main/terraform/app_service.tf))

This is not a complete step-by-step guide; more a list of things to remember. This may be useful as part of [incident response](https://docs.google.com/document/d/1qtev8qItPiTB4Tp9FQ87XsLtWZ4HlNXqoe9vF2VuGcY/edit#).
12 changes: 6 additions & 6 deletions docs/deployment/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ version numbers look like: `YYYY.0M.R`

## 1. Prepare release in a branch

Typically changes for a release will move from `dev`, to `test`, to `prod`. This
assumes `dev` is in a state that it can be deployed without disruption. (This is called a `Regular` release.)
Typically changes for a release will move from `main`, to `test`, to `prod`. This
assumes `main` is in a state that it can be deployed without disruption. (This is called a `Regular` release.)

If `dev` or `test` contain in-progress work that is not ready for production,
If `main` or `test` contain in-progress work that is not ready for production,
and a hotfix is needed in production, a separate process to test the changes
before deploying to `prod` must be undertaken. (This is called a `Hotfix` release.)

Expand All @@ -41,8 +41,8 @@ different circumstances:

```mermaid
graph LR
A(Release branch) --> B{Are dev and test ready to deploy?};
B -->|Yes| C(dev);
A(Release branch) --> B{Are main and test ready to deploy?};
B -->|Yes| C(main);
C --> D(test);
D --> E(prod);
B -->|No| E;
Expand All @@ -54,7 +54,7 @@ upcoming version number.
## 2. Bump the application version number

The app code maintains a version number in
[`benefits/__init__.py`](https://github.com/cal-itp/benefits/blob/dev/benefits/__init__.py),
[`benefits/__init__.py`](https://github.com/cal-itp/benefits/blob/main/benefits/__init__.py),
used by the instrumentation and logging systems.

This version number must be updated to match the new version in the same format:
Expand Down
6 changes: 3 additions & 3 deletions docs/deployment/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ When a deployment workflow runs, the following steps are taken:

### 1. Checkout code

From the tip of the corresponding branch (e.g. `dev`)
From the tip of the corresponding branch (e.g. `main`)

### 2. Authenticate to GHCR

Expand All @@ -31,7 +31,7 @@ Push this image:tag into [GHCR][ghcr].

Push the new image:tag to the Azure App Service instance.

[deploy]: https://github.com/cal-itp/benefits/blob/dev/.github/workflows/deploy.yml
[dockerfile]: https://github.com/cal-itp/benefits/blob/dev/Dockerfile
[deploy]: https://github.com/cal-itp/benefits/blob/main/.github/workflows/deploy.yml
[dockerfile]: https://github.com/cal-itp/benefits/blob/main/Dockerfile
[ghcr]: https://github.com/features/packages
[gh-actions-trigger]: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
2 changes: 1 addition & 1 deletion docs/development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ To close out of the container and re-open the directory locally in Visual Studio
1. Type `Remote-Containers` to filter the commands
1. Select `Reopen Locally`

[config-file]: https://github.com/cal-itp/benefits/blob/dev/.devcontainer/devcontainer.json
[config-file]: https://github.com/cal-itp/benefits/blob/main/.devcontainer/devcontainer.json
[vscode]: https://code.visualstudio.com/
[vscode-containers]: https://code.visualstudio.com/docs/remote/containers
32 changes: 16 additions & 16 deletions docs/development/application-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ flowchart LR
enrollment --> complete
```

The structure of the source code in [`benefits/`](https://github.com/cal-itp/benefits/tree/dev/benefits)
The structure of the source code in [`benefits/`](https://github.com/cal-itp/benefits/tree/main/benefits)
generally follows from these phases:

- [`benefits/core/`](https://github.com/cal-itp/benefits/tree/dev/benefits/core) implements shared logic and models, and
- [`benefits/core/`](https://github.com/cal-itp/benefits/tree/main/benefits/core) implements shared logic and models, and
defines the user's entrypoint into the app
- [`benefits/oauth/`](https://github.com/cal-itp/benefits/tree/dev/benefits/oauth) implements identity proofing
- [`benefits/eligibility/`](https://github.com/cal-itp/benefits/tree/dev/benefits/eligibility) implements eligibility
- [`benefits/oauth/`](https://github.com/cal-itp/benefits/tree/main/benefits/oauth) implements identity proofing
- [`benefits/eligibility/`](https://github.com/cal-itp/benefits/tree/main/benefits/eligibility) implements eligibility
verification
- [`benefits/enrollment/`](https://github.com/cal-itp/benefits/tree/dev/benefits/enrollment) implements enrollment
- [`benefits/enrollment/`](https://github.com/cal-itp/benefits/tree/main/benefits/enrollment) implements enrollment

Each of these directories contains a standalone Django app registered in the [settings](../configuration/README.md#django-settings).

Expand Down Expand Up @@ -287,15 +287,15 @@ benefits-->>analytics: returned enrollment
deactivate benefits
```

[core-context-processors]: https://github.com/cal-itp/benefits/blob/dev/benefits/core/context_processors.py
[core-middleware]: https://github.com/cal-itp/benefits/blob/dev/benefits/core/middleware.py
[core-models]: https://github.com/cal-itp/benefits/blob/dev/benefits/core/models.py
[core-session]: https://github.com/cal-itp/benefits/blob/dev/benefits/core/session.py
[core-views]: https://github.com/cal-itp/benefits/blob/dev/benefits/core/views.py
[eligibility-verify]: https://github.com/cal-itp/benefits/blob/dev/benefits/eligibility/verify.py
[eligibility-views]: https://github.com/cal-itp/benefits/blob/dev/benefits/eligibility/views.py
[enrollment-views]: https://github.com/cal-itp/benefits/blob/dev/benefits/enrollment/views.py
[core-context-processors]: https://github.com/cal-itp/benefits/blob/main/benefits/core/context_processors.py
[core-middleware]: https://github.com/cal-itp/benefits/blob/main/benefits/core/middleware.py
[core-models]: https://github.com/cal-itp/benefits/blob/main/benefits/core/models.py
[core-session]: https://github.com/cal-itp/benefits/blob/main/benefits/core/session.py
[core-views]: https://github.com/cal-itp/benefits/blob/main/benefits/core/views.py
[eligibility-verify]: https://github.com/cal-itp/benefits/blob/main/benefits/eligibility/verify.py
[eligibility-views]: https://github.com/cal-itp/benefits/blob/main/benefits/eligibility/views.py
[enrollment-views]: https://github.com/cal-itp/benefits/blob/main/benefits/enrollment/views.py
[littlepay]: https://github.com/cal-itp/littlepay
[oauth-client]: https://github.com/cal-itp/benefits/blob/dev/benefits/oauth/client.py
[oauth-redirects]: https://github.com/cal-itp/benefits/blob/dev/benefits/oauth/redirects.py
[oauth-views]: https://github.com/cal-itp/benefits/blob/dev/benefits/oauth/views.py
[oauth-client]: https://github.com/cal-itp/benefits/blob/main/benefits/oauth/client.py
[oauth-redirects]: https://github.com/cal-itp/benefits/blob/main/benefits/oauth/redirects.py
[oauth-views]: https://github.com/cal-itp/benefits/blob/main/benefits/oauth/views.py
Loading
Loading