Skip to content

Commit

Permalink
ci: refactor default branch naming to main
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme committed Dec 13, 2022
1 parent da596a5 commit 1e88b1d
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .buildkite/steps/ghp_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const ghpDeployStep = createStep<CustomCommandStep>(() => {
depends_on: ['build_storybook'],
commands: ['npx ts-node .buildkite/scripts/steps/ghp_deploy.ts'],
env: {
// ignore check run reporting when not master
// ignore check run reporting when not main
ECH_CHECK_ID: isMaster ? 'deploy_ghp' : undefined,
},
};
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/utils/buildkite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const bkEnv = (() => {
checkId,
username,
isPullRequest,
isMaster: branch === 'master',
isMaster: branch === 'main',
pullRequestNumber,
buildUrl: env.buildUrl,
canModifyPR: process.env.GITHUB_PR_MAINTAINER_CAN_MODIFY === 'true',
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Publish a Release
on:
workflow_dispatch:
branches:
- master
- main

env:
ECH_NODE_VERSION: '14.x'
Expand All @@ -16,9 +16,9 @@ jobs:
name: Release Checks
runs-on: ubuntu-latest
# needs: status # Not working atm
# Runs checks when others running on master may be in process
# Runs checks when others running on main may be in process
# This is likely an edge case unless published shortly following a merge
# This also covers a case where master checks did not complete/succeed
# This also covers a case where main checks did not complete/succeed
# if: needs.status.outputs.allSuccess
steps:
- name: Check out repository
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<h1 align="center">
<img src="https://raw.githubusercontent.com/elastic/elastic-charts/master/public/logo.png" alt="elastic-charts logo" width="100" /><br />
<img src="https://raw.githubusercontent.com/elastic/elastic-charts/main/public/logo.png" alt="elastic-charts logo" width="100" /><br />
Elastic Charts
</h1>
<p align="center">
<a href="https://buildkite.com/elastic/datavis-ci/builds?branch=master">
<img alt="Build Status - master branch" src="https://badge.buildkite.com/1b2f6369ef27e5b23a7fccf2545d7d6e31bff1957c7c941d31.svg?branch=master">
<a href="https://buildkite.com/elastic/datavis-ci/builds?branch=main">
<img alt="Build Status - main branch" src="https://badge.buildkite.com/1b2f6369ef27e5b23a7fccf2545d7d6e31bff1957c7c941d31.svg?branch=main">
</a>
<a href="https://www.npmjs.com/@elastic/charts"><img alt="NPM version" src="https://img.shields.io/npm/v/@elastic/charts.svg"></a>
<a href="http://commitizen.github.io/cz-cli/"><img alt="Commitizen friendly" src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg"></a>
Expand Down
2 changes: 1 addition & 1 deletion github_bot/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This GitHub app is a containerized node express application deployed on [GCP Clo
### Install dependencies

```
cd ./github_bot/CONTRIBUTING.md
cd ./github_bot
yarn install
```

Expand Down
2 changes: 1 addition & 1 deletion github_bot/DEPLOYING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deploying

Current deployment is [manual](https://cloud.google.com/build/docs/running-builds/start-build-command-line-api), though if necessary we can build this into a [trigger](https://cloud.google.com/build/docs/automating-builds/create-manage-triggers) via pushes to `master`. As of now this is not essential and could not be tested in a PR before merging and deploying.
Current deployment is [manual](https://cloud.google.com/build/docs/running-builds/start-build-command-line-api), though if necessary we can build this into a [trigger](https://cloud.google.com/build/docs/automating-builds/create-manage-triggers) via pushes to `main`. As of now this is not essential and could not be tested in a PR before merging and deploying.

## Setup to deploy

Expand Down
2 changes: 1 addition & 1 deletion github_bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The code is split into two main sections as listed below, excluding shared `util

API route: `/github`

This sections uses [Probot](https://github.com/probot/probot) to easily handle webhooks for any github event. These events are organized into their own directory grouping under [`github_bot/src/github/events/`](https://github.com/elastic/elastic-charts/tree/master/github_bot/src/github/events).
This sections uses [Probot](https://github.com/probot/probot) to easily handle webhooks for any github event. These events are organized into their own directory grouping under [`github_bot/src/github/events/`](https://github.com/elastic/elastic-charts/tree/main/github_bot/src/github/events).

This currently handles:

Expand Down
4 changes: 2 additions & 2 deletions github_bot/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const devEnv: Env = {
},
},
branch: {
base: ['master', 'alpha', 'next', /\d+.\d+.\d+/, /\d+.\d+.x/, /\d+.x/, /buildkite-.+/],
base: ['main', 'alpha', 'next', /\d+.\d+.\d+/, /\d+.\d+.x/, /\d+.x/, /buildkite-.+/],
},
label: {
buildkite: {
Expand Down Expand Up @@ -91,7 +91,7 @@ const prodEnv: Env = {
},
},
branch: {
base: ['master', 'alpha', 'next', /\d+.\d+.\d+/, /\d+.\d+.x/, /\d+.x/],
base: ['main', 'alpha', 'next', /\d+.\d+.\d+/, /\d+.\d+.x/, /\d+.x/],
},
label: {
buildkite: {
Expand Down
2 changes: 1 addition & 1 deletion github_bot/src/github/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export async function updateAllChecks(
): Promise<void> {
const headSha = ctx.name === 'pull_request' ? ctx.payload.pull_request.head.sha : sha;
if (!headSha) throw new Error('No sha provided to set check run');
const { main, jobs } = getBuildConfig(ctx.name === 'push' && ctx.payload.ref === 'refs/heads/master');
const { main, jobs } = getBuildConfig(ctx.name === 'push' && ctx.payload.ref === 'refs/heads/main');
const updatedCheckIds = new Set<string>();

if (!createNew) {
Expand Down
4 changes: 2 additions & 2 deletions github_bot/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface BuildkiteTriggerBuildOptions<

/**
* Branch the commit belongs to. This allows you to take advantage of your pipeline and step-level branch filtering rules.
* @example "master"
* @example "main"
*/
branch: string;

Expand Down Expand Up @@ -82,7 +82,7 @@ export interface BuildkiteTriggerBuildOptions<

/**
* For a pull request build, the base branch of the pull request.
* @example "master"
* @example "main"
*/
pull_request_base_branch?: string;

Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/_reset.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Used as base reset used with EuiProvider. TODO: remove need for this file export.
// https://github.com/elastic/eui/blob/master/src/global_styling/reset/reset.ts
// https://github.com/elastic/eui/blob/main/src/global_styling/reset/reset.ts

@import '../../../node_modules/@elastic/eui/src/themes/legacy/reset';

Expand Down
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": ["config:base", "schedule:weekends", ":disableDependencyDashboard"],
"ignorePaths": ["./.github/**"],
"enabledManagers": ["npm"],
"baseBranches": ["master"],
"baseBranches": ["main"],
"separateMajorMinor": false,
"rangeStrategy": "bump",
"assignAutomerge": true,
Expand Down

0 comments on commit 1e88b1d

Please sign in to comment.