Skip to content

Commit

Permalink
Rename default branch to main (#2662)
Browse files Browse the repository at this point in the history
* Rename default branch to main

* Bump git, curl, and openssl packages
  • Loading branch information
nitrocode authored Nov 14, 2022
1 parent caec10f commit d85662c
Show file tree
Hide file tree
Showing 77 changed files with 234 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- run: |
dockerize -wait tcp://localhost:8080 -- \
muffet \
-e 'https://github\.com/runatlantis/atlantis/edit/master/.*' \
-e 'https://github\.com/runatlantis/atlantis/edit/main/.*' \
-e 'https://github.com/runatlantis/helm-charts#customization' \
--header 'Accept-Encoding:deflate, gzip' \
--buffer-size 8192 \
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ assignees: ''

---

- [ ] I'd be willing to implement this feature ([contributing guide](https://github.com/runatlantis/atlantis/blob/master/CONTRIBUTING.md))
- [ ] I'd be willing to implement this feature ([contributing guide](https://github.com/runatlantis/atlantis/blob/main/CONTRIBUTING.md))

**Describe the user story**
<!--
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/atlantis-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'docker-base/**'
- '.github/workflows/atlantis-base.yml'
branches:
- "master"
- "main"
pull_request:
paths:
- 'docker-base/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/atlantis-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: atlantis-image
on:
push:
branches:
- 'master'
- 'main'
tags:
- v*.*.* # stable release like, v0.19.2
- v*.*.*-pre.* # pre release like, v0.19.0-pre.calendardate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-link-checker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- '.github/website_link_checker/**'
branches:
- "master"
- "main"
workflow_dispatch:

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
echo "::set-output name=RELEASE_TAG::${GITHUB_REF#refs/tags/}"
gh api repos/$GITHUB_REPOSITORY/releases/generate-notes \
-f tag_name="${GITHUB_REF#refs/tags/}" \
-f target_commitish=master \
-f target_commitish=main \
-q .body > tmp-CHANGELOG.md
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: tester
on:
push:
branches:
- "master"
- "main"
pull_request:
branches:
- "master"
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing-env-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "testing/**"
- ".github/workflows/testing-env-image.yml"
branches:
- "master"
- "main"
pull_request:
paths:
- 'testing/**'
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ These are the changes in detail:
```

The `w` group permission was added so that in OpenShift, the random uid can write
their own login entry (https://github.com/runatlantis/atlantis/blob/master/docker-entrypoint.sh#L28)
their own login entry (https://github.com/runatlantis/atlantis/blob/main/docker-entrypoint.sh#L28)
which is required because `terraform` expects the running user to have an entry
in `/etc/passwd`.

Expand Down Expand Up @@ -2466,7 +2466,7 @@ None
assume role session with the GitHub username of the user running the Atlantis command
use the `atlantis_user` terraform variable alongside Terraform's
[built-in support](https://www.terraform.io/docs/providers/aws/#assume-role) for assume role
(see https://github.com/runatlantis/atlantis/blob/master/README.md#assume-role-session-names)
(see https://github.com/runatlantis/atlantis/blob/main/README.md#assume-role-session-names)
* Atlantis has a docker image now ([#123](https://github.com/hootsuite/atlantis/pull/123)). Here is how you can try it out:

```bash
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We take security issues seriously. Please email us directly at security [at] run
# Updating The Website
* To view the generated website locally, run `yarn website:dev` and then
open your browser to http://localhost:8080.
* The website will be regenerated when your pull request is merged to master.
* The website will be regenerated when your pull request is merged to main.

# Developing

Expand Down Expand Up @@ -78,7 +78,7 @@ docker run --rm -v $(pwd):/go/src/github.com/runatlantis/atlantis -w /go/src/git
## Calling Your Local Atlantis From GitHub
- Create a test terraform repository in your GitHub.
- Create a personal access token for Atlantis. See [Create a GitHub token](https://github.com/runatlantis/atlantis/tree/master/runatlantis.io/docs/access-credentials.md#generating-an-access-token).
- Create a personal access token for Atlantis. See [Create a GitHub token](https://github.com/runatlantis/atlantis/tree/main/runatlantis.io/docs/access-credentials.md#generating-an-access-token).
- Start Atlantis in server mode using that token:
```
atlantis server --gh-user <your username> --gh-token <your token> --repo-allowlist <your repo> --gh-webhook-secret <your webhook secret> --log-level debug
Expand All @@ -88,7 +88,7 @@ atlantis server --gh-user <your username> --gh-token <your token> --repo-allowli
```
ngrok http 4141
```
- Create a Webhook in your repo and use the `https` url that `ngrok` printed out after running `ngrok http 4141`. Be sure to append `/events` so your webhook url looks something like `https://efce3bcd.ngrok.io/events`. See [Add GitHub Webhook](https://github.com/runatlantis/atlantis/blob/master/runatlantis.io/docs/configuring-webhooks.md#configuring-webhooks).
- Create a Webhook in your repo and use the `https` url that `ngrok` printed out after running `ngrok http 4141`. Be sure to append `/events` so your webhook url looks something like `https://efce3bcd.ngrok.io/events`. See [Add GitHub Webhook](https://github.com/runatlantis/atlantis/blob/main/runatlantis.io/docs/configuring-webhooks.md#configuring-webhooks).
- Create a pull request and type `atlantis help`. You should see the request in the `ngrok` and Atlantis logs and you should also see Atlantis comment back.
## Code Style
Expand Down Expand Up @@ -163,15 +163,15 @@ go get github.com/petergtz/pegomock/...
# Creating a New Release
1. Update version number in `main.go`.
1. Update image tag version in the [kustomize/bundle.yaml](kustomize/bundle.yaml).
1. Update `CHANGELOG.md` with latest release number and information (this URL might be useful: https://github.com/runatlantis/atlantis/compare/v0.3.5...master)
1. Create a pull request and merge to master
1. Check out master and fetch latest
1. Update `CHANGELOG.md` with latest release number and information (this URL might be useful: https://github.com/runatlantis/atlantis/compare/v0.3.5...main)
1. Create a pull request and merge to main
1. Check out main and fetch latest
1. Run `make release`
1. If you get `signal: killed` errors, bump up your Docker resources to have more memory, e.g. 6 G.B.
1. Go to https://github.com/runatlantis/atlantis/releases and click "Draft a new release"
1. Prefix version with `v`
1. The title of the release is the same as the tag (ex. v0.2.2)
1. Fill in description by copying from the CHANGELOG just without the Downloads section
1. Drag in binaries made with `make release`
1. Re-run master branch build to ensure tag gets pushed to Github: https://github.com/runatlantis/atlantis/pkgs/container/atlantis
1. Re-run main branch build to ensure tag gets pushed to Github: https://github.com/runatlantis/atlantis/pkgs/container/atlantis
1. Update the default version in `Chart.yaml` in [the official Helm chart](https://github.com/runatlantis/helm-charts/blob/main/charts/atlantis/values.yaml).
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![SuperDopeBadge](./runatlantis.io/.vuepress/public/hightower-super-dope.svg)](https://twitter.com/kelseyhightower/status/893260922222813184)
[![Go Report Card](https://goreportcard.com/badge/github.com/runatlantis/atlantis)](https://goreportcard.com/report/github.com/runatlantis/atlantis)
[![codecov](https://codecov.io/gh/runatlantis/atlantis/branch/master/graph/badge.svg)](https://codecov.io/gh/runatlantis/atlantis)
[![CircleCI](https://circleci.com/gh/runatlantis/atlantis/tree/master.svg?style=shield)](https://circleci.com/gh/runatlantis/atlantis/tree/master)
[![codecov](https://codecov.io/gh/runatlantis/atlantis/branch/main/graph/badge.svg)](https://codecov.io/gh/runatlantis/atlantis)
[![CircleCI](https://circleci.com/gh/runatlantis/atlantis/tree/main.svg?style=shield)](https://circleci.com/gh/runatlantis/atlantis/tree/main)
[![Slack](https://img.shields.io/badge/Join-Atlantis%20Community%20Slack-red)](https://join.slack.com/t/atlantis-community/shared_invite/enQtNzc4NDM3OTA3ODI0LTA5NDQ4YTA3NTAxM2I3ZmIxMGNiYWJhNmY4YjBjZjM3OWMzNGI0NTcxNzY2NjRhODIyODA4YmNjOTBiOThhNTI)

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ var stringFlags = map[string]stringFlag{
CheckoutStrategyFlag: {
description: "How to check out pull requests. Accepts either 'branch' (default) or 'merge'." +
" If set to branch, Atlantis will check out the source branch of the pull request." +
" If set to merge, Atlantis will check out the destination branch of the pull request (ex. master)" +
" If set to merge, Atlantis will check out the destination branch of the pull request (ex. main, master)" +
" and then locally perform a git merge of the source branch." +
" This effectively means Atlantis operates on the repo as it will look" +
" after the pull request is merged.",
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (t *E2ETester) Start() (*E2EResult, error) {
title := fmt.Sprintf("This is a test pull request for atlantis e2e test for %s project type", t.projectType.Name)
head := fmt.Sprintf("%s:%s", t.ownerName, branchName)
body := ""
base := "master"
base := "main"
newPullRequest := &github.NewPullRequest{Title: &title, Head: &head, Body: &body, Base: &base}

pull, _, err := t.githubClient.client.PullRequests.Create(t.githubClient.ctx, t.ownerName, t.repoName, newPullRequest)
Expand Down
2 changes: 1 addition & 1 deletion runatlantis.io/.vuepress/components/HomeCustom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
the Terraform plan output before it's applied.
</li>
<li><img class="checkmark" src="/checkmark.svg">Ensure that you
apply changes before merging to master.
apply changes before merging to main.
</li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions runatlantis.io/docs/apply-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ If you set up Protected Branches then you can enforce:
* Requiring certain status checks to be passing
* Requiring certain people to have reviewed and approved the pull request
* Requiring `CODEOWNERS` to have reviewed and approved the pull request
* Requiring that the branch is up to date with `master`
* Requiring that the branch is up to date with `main`

See [https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)
for more details.
Expand Down Expand Up @@ -176,7 +176,7 @@ You can set the `undiverged` requirement by:
#### Meaning
The `merge` checkout strategy creates a temporary merge commit and runs the `plan` on the Atlantis local version of the PR
source and destination branch. The local destination branch can become out of date since changes to the destination branch are not fetched
if there are no changes to the source branch. `undiverged` enforces that Atlantis local version of master is up to date
if there are no changes to the source branch. `undiverged` enforces that Atlantis local version of main is up to date
with remote so that the state of the source during the `apply` is identical to that if you were to merge the PR at that
time.

Expand Down
12 changes: 6 additions & 6 deletions runatlantis.io/docs/checkout-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ of the pull request.
For example, given the following git history:
![Git History](./images/branch-strategy.png)

If the pull request was asking to merge `branch` into `master`,
If the pull request was asking to merge `branch` into `main`,
Atlantis would check out `branch` at commit `C3`.

## Merge
The problem with the `branch` strategy, is that if users push branches that are
out of date with `master`, then their `terraform plan` could be deleting
some resources that were configured in the master branch.
out of date with `main`, then their `terraform plan` could be deleting
some resources that were configured in the main branch.

For example, in the above diagram if commits `C4` and `C5` have modified the
terraform state and added new resources, then when Atlantis runs `terraform plan`
at commit `C3`, because the code doesn't have the changes from `C4` and `C5`,
Terraform will try to delete those resources.

To fix this, users could merge `master` into their branch, *or* you can run
To fix this, users could merge `main` into their branch, *or* you can run
Atlantis with `--checkout-strategy=merge`. With this strategy, Atlantis will
try to perform a merge locally by:

* Checking out the destination branch of the pull request (ex. `master`)
* Checking out the destination branch of the pull request (ex. `main`)
* Locally performing a `git merge {source branch}`
* Then running its Terraform commands

Expand All @@ -44,5 +44,5 @@ Atlantis doesn't actually commit this merge anywhere. It just uses it locally.

:::warning
Atlantis only performs this merge during the `terraform plan` phase. If another
commit is pushed to `master` **after** Atlantis runs `plan`, nothing will happen.
commit is pushed to `main` **after** Atlantis runs `plan`, nothing will happen.
:::
4 changes: 2 additions & 2 deletions runatlantis.io/docs/locking.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Only the directory in the repo and Terraform workspace are locked, not the whole

## Why
1. Because `atlantis apply` is being done before the pull request is merged, after
an apply your `master` branch does not represent the most up to date version of your infrastructure
an apply your `main` branch does not represent the most up to date version of your infrastructure
anymore. With locking, you can ensure that no other changes will be made until the
pull request is merged.

::: tip Why not apply on merge?
Sometimes `terraform apply` fails. If the apply were to fail after the pull
request was merged, you would need to create a new pull request to fix it.
With locking + applying on the branch, you effectively mimic merging to master
With locking + applying on the branch, you effectively mimic merging to main
but with the added ability to re-plan/apply multiple times if things don't work.
:::
2. If there is already a `plan` in progress, other users won't see a plan that
Expand Down
2 changes: 1 addition & 1 deletion runatlantis.io/docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Atlantis could be exploited by
}
}
```
* Running malicious custom build commands specified in an `atlantis.yaml` file. Atlantis uses the `atlantis.yaml` file from the pull request branch, **not** `master`.
* Running malicious custom build commands specified in an `atlantis.yaml` file. Atlantis uses the `atlantis.yaml` file from the pull request branch, **not** `main`.
* Someone adding `atlantis plan/apply` comments on your valid pull requests causing terraform to run when you don't want it to.
## Bitbucket Cloud (bitbucket.org)
Expand Down
2 changes: 1 addition & 1 deletion runatlantis.io/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Check out the video below to see it in action:
### Increased visibility
When everyone is executing Terraform on their own computers, it's hard to know the
current state of your infrastructure:
* Is what's in `master` deployed?
* Is what's in `main` branch deployed?
* Did someone forget to create a pull request for that latest change?
* What was the output from that last `terraform apply`?

Expand Down
2 changes: 1 addition & 1 deletion server/controllers/events/events_controller_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ func GitHubPullRequestParsed(headSHA string) *github.PullRequest {
FullName: github.String("runatlantis/atlantis-tests"),
CloneURL: github.String("https://github.com/runatlantis/atlantis-tests.git"),
},
Ref: github.String("master"),
Ref: github.String("main"),
},
User: &github.User{
Login: github.String("atlantisbot"),
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/events/events_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ func TestPost_BBServerPullClosed(t *testing.T) {
HeadCommit: "2d9fb6b9a46eafb1dcef7b008d1a429d45ca742c",
URL: "https://bbserver.com/projects/PROJ/repos/repository/pull-requests/10",
HeadBranch: "decline-me",
BaseBranch: "master",
BaseBranch: "main",
Author: "admin",
State: models.OpenPullState,
BaseRepo: expRepo,
Expand Down
22 changes: 11 additions & 11 deletions server/controllers/events/gitlab_request_parser_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ var mergeEventJSON = `{
"namespace": "lkysow",
"visibility_level": 20,
"path_with_namespace": "lkysow/atlantis-example",
"default_branch": "master",
"default_branch": "main",
"ci_config_path": null,
"homepage": "https://gitlab.com/lkysow/atlantis-example",
"url": "[email protected]:lkysow/atlantis-example.git",
Expand Down Expand Up @@ -186,7 +186,7 @@ var mergeEventJSON = `{
"source_branch": "patch-1",
"source_project_id": 4580910,
"state": "opened",
"target_branch": "master",
"target_branch": "main",
"target_project_id": 4580910,
"time_estimate": 0,
"title": "Update main.tf",
Expand All @@ -204,7 +204,7 @@ var mergeEventJSON = `{
"namespace": "sourceorg",
"visibility_level": 20,
"path_with_namespace": "sourceorg/atlantis-example",
"default_branch": "master",
"default_branch": "main",
"ci_config_path": null,
"homepage": "https://gitlab.com/sourceorg/atlantis-example",
"url": "[email protected]:sourceorg/atlantis-example.git",
Expand All @@ -222,7 +222,7 @@ var mergeEventJSON = `{
"namespace": "lkysow",
"visibility_level": 20,
"path_with_namespace": "lkysow/atlantis-example",
"default_branch": "master",
"default_branch": "main",
"ci_config_path": null,
"homepage": "https://gitlab.com/lkysow/atlantis-example",
"url": "[email protected]:lkysow/atlantis-example.git",
Expand Down Expand Up @@ -286,7 +286,7 @@ var mergeEventJSON = `{
},
"target_branch": {
"previous": null,
"current": "master"
"current": "main"
},
"target_project_id": {
"previous": null,
Expand Down Expand Up @@ -333,7 +333,7 @@ var mergeCommentEventJSON = `{
"namespace":"Gitlab Org",
"visibility_level":10,
"path_with_namespace":"gitlabhq/gitlab-test",
"default_branch":"master",
"default_branch":"main",
"homepage":"http://example.com/gitlabhq/gitlab-test",
"url":"https://example.com/gitlabhq/gitlab-test.git",
"ssh_url":"[email protected]:gitlabhq/gitlab-test.git",
Expand Down Expand Up @@ -364,7 +364,7 @@ var mergeCommentEventJSON = `{
"merge_request": {
"id": 7,
"target_branch": "markdown",
"source_branch": "master",
"source_branch": "main",
"source_project_id": 5,
"author_id": 8,
"assignee_id": 28,
Expand All @@ -388,7 +388,7 @@ var mergeCommentEventJSON = `{
"namespace":"Gitlab Org",
"visibility_level":10,
"path_with_namespace":"gitlab-org/gitlab-test",
"default_branch":"master",
"default_branch":"main",
"homepage":"http://example.com/gitlab-org/gitlab-test",
"url":"https://example.com/gitlab-org/gitlab-test.git",
"ssh_url":"[email protected]:gitlab-org/gitlab-test.git",
Expand All @@ -405,15 +405,15 @@ var mergeCommentEventJSON = `{
"namespace":"Gitlab Org",
"visibility_level":10,
"path_with_namespace":"gitlabhq/gitlab-test",
"default_branch":"master",
"default_branch":"main",
"homepage":"http://example.com/gitlabhq/gitlab-test",
"url":"https://example.com/gitlabhq/gitlab-test.git",
"ssh_url":"[email protected]:gitlabhq/gitlab-test.git",
"http_url":"https://example.com/gitlabhq/gitlab-test.git"
},
"last_commit": {
"id": "562e173be03b8ff2efb05345d12df18815438a4b",
"message": "Merge branch 'another-branch' into 'master'\n\nCheck in this test\n",
"message": "Merge branch 'another-branch' into 'main'\n\nCheck in this test\n",
"timestamp": "2002-10-02T10:00:00-05:00",
"url": "http://example.com/gitlab-org/gitlab-test/commit/562e173be03b8ff2efb05345d12df18815438a4b",
"author": {
Expand Down Expand Up @@ -449,7 +449,7 @@ var commitCommentEventJSON = `{
"namespace":"GitlabHQ",
"visibility_level":20,
"path_with_namespace":"gitlabhq/gitlab-test",
"default_branch":"master",
"default_branch":"main",
"homepage":"http://example.com/gitlabhq/gitlab-test",
"url":"http://example.com/gitlabhq/gitlab-test.git",
"ssh_url":"[email protected]:gitlabhq/gitlab-test.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"id":"refs/heads/main",
"displayId":"main",
"latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
"repository":{
"slug":"repository",
Expand Down
Loading

0 comments on commit d85662c

Please sign in to comment.