Skip to content

Commit

Permalink
Update references to the default branch name (#5344)
Browse files Browse the repository at this point in the history
* repo

* scripts

* ci

* packages

* wiki

* docs

* revert ci node change

* Update FAQ.md

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
  • Loading branch information
thompsongl and Constance authored Nov 4, 2021
1 parent 91b416d commit 6eb3b6f
Show file tree
Hide file tree
Showing 26 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .ci/jobs/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
parameters:
- string:
name: branch_specifier
default: refs/heads/master
default: refs/heads/main
description: the Git branch specifier to build (&lt;branchName&gt;,
&lt;tagName&gt;, &lt;commitId&gt;, etc.)
wrappers:
Expand Down
8 changes: 4 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Provide a detailed summary of your PR. Explain how you arrived at your solution.
- [ ] Check against **all themes** for compatibility in both light and dark modes
- [ ] Checked in **mobile**
- [ ] Checked in **Chrome**, **Safari**, **Edge**, and **Firefox**
- [ ] Props have proper **autodocs** and **[playground toggles](https://github.com/elastic/eui/blob/master/wiki/documentation-guidelines.md#adding-playground-toggles)**
- [ ] Added **[documentation](https://github.com/elastic/eui/blob/master/wiki/documentation-guidelines.md)**
- [ ] Props have proper **autodocs** and **[playground toggles](https://github.com/elastic/eui/blob/main/wiki/documentation-guidelines.md#adding-playground-toggles)**
- [ ] Added **[documentation](https://github.com/elastic/eui/blob/main/wiki/documentation-guidelines.md)**
- [ ] Checked **[Code Sandbox](https://codesandbox.io/)** works for any docs examples
- [ ] Added or updated **[jest](https://github.com/elastic/eui/blob/master/wiki/testing.md) and [cypress](https://github.com/elastic/eui/blob/master/wiki/cypress-testing.md) tests**
- [ ] Added or updated **[jest](https://github.com/elastic/eui/blob/main/wiki/testing.md) and [cypress](https://github.com/elastic/eui/blob/main/wiki/cypress-testing.md) tests**
- [ ] Checked for **breaking changes** and labeled appropriately
- [ ] Checked for **accessibility** including keyboard-only and screenreader modes
- [ ] A **[changelog](https://github.com/elastic/eui/blob/master/wiki/documentation-guidelines.md#changelog)** entry exists and is marked appropriately
- [ ] A **[changelog](https://github.com/elastic/eui/blob/main/wiki/documentation-guidelines.md#changelog)** entry exists and is marked appropriately
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Changelog required"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
branches: [ master ]
branches: [ main ]

jobs:
# Enforces the update of a changelog file on every pull request
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [`master`](https://github.com/elastic/eui/tree/master)
## [`main`](https://github.com/elastic/eui/tree/main)

**Bug fixes**

Expand Down
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See our licensing FAQ: [I’m using EUI or Elastic Charts in my application outs

We use [semver](https://semver.org/) for versioning and use that to denote breaking changes in EUI upgrades. Traditionally we consider API changes in our prop names or existing component functionality to be a reason for a breaking change, but do not track the renaming of CSS selectors, mixins or other style changes under this same rigor.

Traditionally releases are made weekly against whatever is in master and you can upgrade from NPM as you see fit.
Traditionally releases are made weekly against whatever is in the `main` branch and you can upgrade from NPM as you see fit.

## How do you handle Typescript, Sass and theming?

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type" : "git",
"url" : "https://github.com/elastic/eui.git"
},
"homepage": "https://github.com/elastic/eui/blob/master/packages/eslint-plugin",
"homepage": "https://github.com/elastic/eui/blob/main/packages/eslint-plugin",
"peerDependencies": {
"eslint": ">=5, <7"
},
Expand Down
4 changes: 2 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": ["config:base", ":disableDependencyDashboard"],
"ignorePaths": ["./.github/**"],
"enabledManagers": ["npm"],
"baseBranches": ["master"],
"baseBranches": ["main"],
"separateMajorMinor": false,
"rangeStrategy": "bump",
"semanticCommits": "disabled",
Expand All @@ -20,7 +20,7 @@
"groupName": "@elastic/charts",
"matchPackageNames": ["@elastic/charts"],
"matchUpdateTypes": ["major"],
"matchBaseBranches": ["master"],
"matchBaseBranches": ["main"],
"labels": ["dependencies", "skip-changelog"],
"automerge": true,
"enabled": true
Expand Down
4 changes: 2 additions & 2 deletions scripts/deploy/deploy_docs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set +x
# Expected env variables:
# * GPROJECT - GCE project name, e.g. elastic-bekitzur
# * GCE_ACCOUNT - credentials for the google service account (JSON blob)
# * GIT_BRANCH - current Git branch or tag (e.g. "refs/heads/master", "v18.2.1")
# * GIT_BRANCH - current Git branch or tag (e.g. "refs/heads/main", "v18.2.1")

if [[ -z "${GPROJECT}" ]]; then
echo "GPROJECT is not set, e.g. 'GPROJECT=elastic-bekitzur'"
Expand All @@ -24,7 +24,7 @@ if [[ -z "${GCE_ACCOUNT}" ]]; then
exit 1
fi
if [[ -z "${GIT_BRANCH}" ]]; then
echo "GIT_BRANCH is not set, e.g. 'GIT_BRANCH=refs/heads/master'"
echo "GIT_BRANCH is not set, e.g. 'GIT_BRANCH=refs/heads/main'"
exit 1
fi

Expand Down
14 changes: 7 additions & 7 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ if (args.dry_run) {
process.exit(1);
}

// ensure git is on the master branch
await ensureMasterBranch();
// ensure git is on the main branch
await ensureMainBranch();

// run linting and unit tests
if (args.steps.indexOf('test') > -1) {
Expand Down Expand Up @@ -121,8 +121,8 @@ function parseArguments() {
};
}

async function ensureMasterBranch() {
// ignore master check in CI since it's checking out the HEAD commit instead
async function ensureMainBranch() {
// ignore main check in CI since it's checking out the HEAD commit instead
if (process.env.CI === 'true') {
return;
}
Expand All @@ -133,8 +133,8 @@ async function ensureMasterBranch() {
const currentBranch = await repo.getCurrentBranch();
const currentBranchName = currentBranch.shorthand();

if (currentBranchName !== 'master') {
console.error(`Unable to release: currently on branch "${currentBranchName}", expected "master"`);
if (currentBranchName !== 'main') {
console.error(`Unable to release: currently on branch "${currentBranchName}", expected "main"`);
process.exit(1);
}
}
Expand All @@ -153,7 +153,7 @@ async function getVersionTypeFromChangelog() {
// get contents between the first two headings
// changelog headings always use ##, this matches:
//
// "##.+?[\r\n]+" consume the first heading & linebreak(s), which describes the master branch
// "##.+?[\r\n]+" consume the first heading & linebreak(s), which describes the main branch
// "(.+?)" capture (non-greedy) all changes until the rest of the regex matches
// "[\r\n]+##" any linebreak(s) leading up to the next ## heading
//
Expand Down
14 changes: 7 additions & 7 deletions scripts/update-changelog-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ const { version } = require(pathToPackage);
const pathToChangelog = path.resolve(cwd, 'CHANGELOG.md');
let changelogContents = fs.readFileSync(pathToChangelog).toString();

const masterHeading = '## [`master`](https://github.com/elastic/eui/tree/master)';
// sanity check, changelog should start with master heading
if (changelogContents.indexOf(masterHeading) !== 0) {
console.error(`Cannot update CHANGELOG.md: does not start with expected heading "${masterHeading}"`);
const mainHeading = '## [`main`](https://github.com/elastic/eui/tree/main)';
// sanity check, changelog should start with main heading
if (changelogContents.indexOf(mainHeading) !== 0) {
console.error(`Cannot update CHANGELOG.md: does not start with expected heading "${mainHeading}"`);
process.exit(1);
}

// Insert the changelog template after the master header
// Insert the changelog template after the main header
changelogContents = changelogContents.replace(
masterHeading,
`${masterHeading}
mainHeading,
`${mainHeading}
No public interface changes since \`${version}\`.
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/button/button_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export const ButtonExample = {
accept both props to be applied simultaneously to support certain
routing mechansims, it is not usually recommended. For more specific
information on how to integrate EUI buttons with react-router,{' '}
<EuiLink href="https://github.com/elastic/eui/blob/master/wiki/react-router.md#how-react-router-works">
<EuiLink href="https://github.com/elastic/eui/blob/main/wiki/react-router.md#how-react-router-works">
see this wiki page
</EuiLink>
.
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/code/code_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const CodeExample = {
or want to print long code (e.g., printing JSON from an API), we
recommend installing a version of Monaco. If you are building within
the Kibana platform, you can use their{' '}
<EuiLink href="https://github.com/elastic/kibana/tree/master/src/plugins/kibana_react/public/code_editor">
<EuiLink href="https://github.com/elastic/kibana/tree/main/src/plugins/kibana_react/public/code_editor">
<strong>CodeEditor</strong>
</EuiLink>
.
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/datagrid/datagrid_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export const DataGridExample = {
explanation on the lower level object types. The majority of the
types are defined in the{' '}
<a
href="https://github.com/elastic/eui/tree/master/src/components/datagrid/data_grid_types.ts"
href="https://github.com/elastic/eui/tree/main/src/components/datagrid/data_grid_types.ts"
target="_blank"
>
/datagrid/data_grid_types.ts
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/elastic_charts/theming_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const euiTheme = isDarkTheme ? EUI_CHARTS_THEME_DARK.theme : EUI_CHARTS_THEME_LI
theme object depending on the current Kibana theme. Learn more
from this{' '}
<EuiLink
href="https://github.com/elastic/kibana/tree/master/src/plugins/charts"
href="https://github.com/elastic/kibana/tree/main/src/plugins/charts"
target="_blank"
>
readme
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/guidelines/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To install the Elastic UI Framework into an existing project, use the `yarn` CLI
yarn add @elastic/eui
```

Note that EUI has [several `peerDependencies` requirements](https://github.com/elastic/eui/package.json) that will also need to be installed if starting with a blank project. You can read more about other ways to [consume EUI](https://github.com/elastic/eui/blob/master/wiki/consuming.md).
Note that EUI has [several `peerDependencies` requirements](https://github.com/elastic/eui/package.json) that will also need to be installed if starting with a blank project. You can read more about other ways to [consume EUI](https://github.com/elastic/eui/blob/main/wiki/consuming.md).

```js
yarn add @elastic/eui @elastic/datemath moment prop-types
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/guidelines/sass/color.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Color = () => {
<>
<EuiText>
<p>
<EuiLink href="https://github.com/elastic/eui/blob/master/src/global_styling/functions/_colors.scss">
<EuiLink href="https://github.com/elastic/eui/blob/main/src/global_styling/functions/_colors.scss">
View the Sass code for color functions
</EuiLink>
.
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/home/home_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const HomeView = () => (
</Link>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiLink href="https://github.com/elastic/eui/blob/master/CONTRIBUTING.md">
<EuiLink href="https://github.com/elastic/eui/blob/main/CONTRIBUTING.md">
<strong>Contributing</strong>
</EuiLink>
</EuiFlexItem>
Expand Down Expand Up @@ -220,11 +220,11 @@ export const HomeView = () => (
<EuiText size="xs" textAlign="center" color="subdued">
<p>
EUI is dual-licensed under{' '}
<EuiLink href="https://github.com/elastic/eui/blob/master/licenses/ELASTIC-LICENSE-2.0.md">
<EuiLink href="https://github.com/elastic/eui/blob/main/licenses/ELASTIC-LICENSE-2.0.md">
Elastic License 2.0
</EuiLink>{' '}
and{' '}
<EuiLink href="https://github.com/elastic/eui/blob/master/licenses/SSPL-LICENSE.md">
<EuiLink href="https://github.com/elastic/eui/blob/main/licenses/SSPL-LICENSE.md">
Server Side Public License, v 1
</EuiLink>{' '}
| Crafted with{' '}
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/icon/icon_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const IconExample = {
<p>
If you would like to contribute to our growing list of glyphs, you
can follow{' '}
<EuiLink to="https://github.com/elastic/eui/blob/master/wiki/creating-icons.md">
<EuiLink to="https://github.com/elastic/eui/blob/main/wiki/creating-icons.md">
these guidelines
</EuiLink>
.
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/link/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default () => (
<p>
Here is an example of a{' '}
<EuiLink
href="https://github.com/elastic/eui/blob/master/wiki/react-router.md#how-react-router-works"
href="https://github.com/elastic/eui/blob/main/wiki/react-router.md#how-react-router-works"
onClick={() => {}}
>
link
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/package/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EuiMarkdownFormat } from '../../../../src';
import { GuidePage } from '../../components/guide_page';

const changelogSource = require('!!raw-loader!../../../../CHANGELOG.md').default.replace(
/## \[`master`\].+?##/s, // remove the `master` heading & contents
/## \[`main`\].+?##/s, // remove the `main` heading & contents
'##'
);

Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/package/i18n_tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const columns = [
<EuiLink
target="_blank"
color="subdued"
href={`https://github.com/elastic/eui/blob/master/${filepath}#L${loc.start.line}`}
href={`https://github.com/elastic/eui/blob/main/${filepath}#L${loc.start.line}`}
>
{filepath}:{loc.start.line}:{loc.start.column}
</EuiLink>
Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/tool_tip/tool_tip_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const ToolTipExample = {
you&rsquo;ll need to make sure these props are applied to the root
element rendered by your component. The best way to do that is to
follow{' '}
<a href="https://github.com/elastic/eui/blob/master/wiki/component-design.md#pass-through-props">
<a href="https://github.com/elastic/eui/blob/main/wiki/component-design.md#pass-through-props">
EUI&rsquo;s guidelines on pass-through props
</a>
.
Expand Down
6 changes: 3 additions & 3 deletions wiki/documentation-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {

// ...

<EuiLink href="https://github.com/elastic/eui/blob/master/src/global_styling/mixins/_shadow.scss">
<EuiLink href="https://github.com/elastic/eui/blob/main/src/global_styling/mixins/_shadow.scss">
View the Sass code for shadow mixins
</EuiLink>.
```
Expand Down Expand Up @@ -136,7 +136,7 @@ Most documentation pages include a [playground section](https://elastic.github.i

### Toggles for required props

Props marked required for a component typically do not have default values and therefore need to be set for the playground to work well. For example, the `children` prop, which can be set in the component's [`playground.js` file](https://github.com/elastic/eui/blob/master/src-docs/src/views/accordion/playground.js):
Props marked required for a component typically do not have default values and therefore need to be set for the playground to work well. For example, the `children` prop, which can be set in the component's [`playground.js` file](https://github.com/elastic/eui/blob/main/src-docs/src/views/accordion/playground.js):

```js
propsToUse.children = {
Expand Down Expand Up @@ -216,7 +216,7 @@ import { ExampleContext } from '../../services';

Any updates to the `src/` folder require an entry in the [CHANGELOG.md](../CHANGELOG.md) file. Here are our guidelines for updating the file:

* Append your changes to the `master` sub-heading of `CHANGELOG.md`.
* Append your changes to the `main` sub-heading of `CHANGELOG.md`.
* Add a list item for each significant change in the PR: bugs that were fixed, new features, new components, or changes to the public API
* In the list item, always link to any relevant pull requests
* Add a summary of what has changed, making sure it's informative to consumers who might be unaware of implementation details
Expand Down
14 changes: 7 additions & 7 deletions wiki/releasing-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ When preparing for a backport a GitHub issue should be created in EUI referencin

This provides a walkthrough of the patching & backport release process; examples are taken from the release of v22.3.1 based on https://github.com/elastic/eui/issues/3386

* Unless it is unreasonable, begin by performing a full release from the `master` branch. This ensures the changelog is prepared for referencing later by the backport, and pulls in all commits that will be used by the backport.
* Switch to `master` - `git checkout master`
* Unless it is unreasonable, begin by performing a full release from the `main` branch. This ensures the changelog is prepared for referencing later by the backport, and pulls in all commits that will be used by the backport.
* Switch to `main` - `git checkout main`
* Run the release script and follow the prompts - `npm run release`
* Identify the target version of EUI to patch; GitHub issue says the new version should be `22.3.1` and I confirmed the patch's base is `22.3.0`
* in the EUI git repo, checkout the release tag the patch is intended for - `git checkout v22.3.0`
Expand All @@ -67,11 +67,11 @@ This provides a walkthrough of the patching & backport release process; examples
giving `797057a` as the commit hash
* For this release, we have `797057a`, `9ba25c0`, `68080d2`, and `42c7ced`
* Cherry pick the commit hashes into the backport branch and resolve any conflicts - `git cherry-pick 797057a 9ba25c0 68080d2 42c7ced`
* Resolve changelog conflicts by taking the base version (`22.3.0`'s side in this example) and adding the cherry-picked entry to the `master` heading
* Resolve changelog conflicts by taking the base version (`22.3.0`'s side in this example) and adding the cherry-picked entry to the `main` heading
* You may need to re-run yarn in order to commit changes, if the commit modified dependencies
* Remember to continue cherry picking with `git cherry-pick --continue` until all commits have been applied
* Start the dev server and check that the intended changes have been properly applied, you don't want to repeat this process to patch the patch - `yarn start`
* Once everything looks correct, it's time to release; the `yarn release` script only works when releasing from `master`, so we'll run [a subset of those steps](https://github.com/elastic/eui/blob/06fc9a6880766168aec1a622873e7f6fe1b3d42b/scripts/release.js#L34-L57) manually
* Once everything looks correct, it's time to release; the `yarn release` script only works when releasing from `main`, so we'll run [a subset of those steps](https://github.com/elastic/eui/blob/06fc9a6880766168aec1a622873e7f6fe1b3d42b/scripts/release.js#L34-L57) manually
* Run the unit tests again - `npm test`
* Create the release builds - `npm run build`
* Update the I18n tokens - `npm run update-token-changelog -- patch`
Expand All @@ -80,11 +80,11 @@ This provides a walkthrough of the patching & backport release process; examples
* Publish the new version to npm
* Get your npm One Time Password (OTP) from Google Authenticator, Authy, etc
* Publish with your OPT and the new version as the tag - `npm publish --tag=backport --otp=your-one-time-password`
* Update `master`'s changelog to include this release
* Update `main`'s changelog to include this release
* On the branch you used to build & release, copy the relevant changelog section - e.g. contents of ```## [`22.3.1`](https://github.com/elastic/eui/tree/v22.3.1)```
* Checkout `master` - `git checkout master`
* Checkout `main` - `git checkout main`
* Paste the changelog section at the correct location in _CHANGELOG.md_
* Include an extra line at the top of this section describing it as a backport, e.g. **Note: this release is a backport containing changes originally made in `23.0.0`, `23.1.0`, and `23.2.0`**
* Commit the changelog entry to master and push - `git commit -anm "changelog" && git push`
* Commit the changelog entry to main and push - `git commit -anm "changelog" && git push`
* Let people know the backport is released
* Celebrate profusely
Loading

0 comments on commit 6eb3b6f

Please sign in to comment.