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

Change all references to master branch to trunk #45234

Merged
merged 2 commits into from
Nov 20, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 27 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ jobs:

# Build all artifacts only when project config changes.
# Otherwise only build application executable required for end-to-end testing.
! git diff --name-only origin/master...HEAD | grep -E -q 'desktop/package.json|desktop/yarn.lock' && ELECTRON_BUILDER_ARGS='-c.mac.target=dir'
! git diff --name-only origin/trunk...HEAD | grep -E -q 'desktop/package.json|desktop/yarn.lock' && ELECTRON_BUILDER_ARGS='-c.mac.target=dir'

ELECTRON_BUILDER_ARGS=$ELECTRON_BUILDER_ARGS yarn run build-desktop:app
- run:
Expand Down Expand Up @@ -835,7 +835,7 @@ jobs:

# Build all artifacts only when project config changes.
# Otherwise only build application executable required for end-to-end testing.
! git diff --name-only origin/master...HEAD | grep -E -q 'desktop/package.json|desktop/yarn.lock' && ELECTRON_BUILDER_ARGS='-c.linux.target=dir'
! git diff --name-only origin/trunk...HEAD | grep -E -q 'desktop/package.json|desktop/yarn.lock' && ELECTRON_BUILDER_ARGS='-c.linux.target=dir'

ELECTRON_BUILDER_ARGS=$ELECTRON_BUILDER_ARGS yarn run build-desktop:app
- run:
Expand Down Expand Up @@ -918,7 +918,7 @@ jobs:

# Build all artifacts only when project config changes.
# Otherwise only build application executable required for end-to-end testing.
If ( -Not $(git diff --name-only origin/master...HEAD | Select-String -Pattern desktop/package.json,desktop/yarn.lock) ) { $env:ARG2='-c.win.target=dir' }
If ( -Not $(git diff --name-only origin/trunk...HEAD | Select-String -Pattern desktop/package.json,desktop/yarn.lock) ) { $env:ARG2='-c.win.target=dir' }


make -f desktop/Makefile package ELECTRON_BUILDER_ARGS=$($env:ARG1,$env:ARG2 -join " ")
Expand Down Expand Up @@ -989,7 +989,7 @@ workflows:
- prime-calypso-live:
filters:
branches:
ignore: master
ignore: trunk
- build-notifications:
requires:
- setup
Expand Down Expand Up @@ -1063,8 +1063,8 @@ workflows:
filters:
branches:
ignore:
# Do not spin up calypso.live for `master`
- master
# Do not spin up calypso.live for `trunk`
- trunk
# Do not spin up calypso.live for fork pull requests. Calypso.live will not build them.
- /pull\/[0-9]+/
# - test-e2e-canary:
Expand Down Expand Up @@ -1156,7 +1156,7 @@ workflows:
filters:
branches:
only:
- master
- trunk

e2e-full-suite-scheduled:
jobs:
Expand All @@ -1169,7 +1169,7 @@ workflows:
cron: '0 3,15 * * *'
filters:
branches:
only: master
only: trunk

e2e-canary-scheduled:
jobs:
Expand All @@ -1193,23 +1193,23 @@ workflows:
cron: '0 12 * * *'
filters:
branches:
only: master
only: trunk

e2e-full-suite-edge-scheduled:
jobs:
- setup
- test-e2e-canary:
name: test-e2e-full-suite-edge
requires:
- setup
test-flags: '-g'
env-vars: 'SKIP_DOMAIN_TESTS=true GUTENBERG_EDGE=true'
- setup
- test-e2e-canary:
name: test-e2e-full-suite-edge
requires:
- setup
test-flags: '-g'
env-vars: 'SKIP_DOMAIN_TESTS=true GUTENBERG_EDGE=true'
triggers:
- schedule:
cron: '30 8 * * *'
filters:
branches:
only: master
- schedule:
cron: '30 8 * * *'
filters:
branches:
only: trunk

e2e-jetpack-be-scheduled:
jobs:
Expand All @@ -1227,7 +1227,7 @@ workflows:
cron: '0 7 * * *'
filters:
branches:
only: master
only: trunk

# Temporarily disabling these scheduled test runs
# e2e-jetpack-scheduled:
Expand All @@ -1246,7 +1246,7 @@ workflows:
# cron: "0 1,13 * * *"
# filters:
# branches:
# only: master
# only: trunk

e2e-canary-i18n-monthly:
jobs:
Expand All @@ -1259,13 +1259,13 @@ workflows:
test-flags: '-i'
filters:
branches:
only: master
only: trunk
triggers:
- schedule:
cron: '40 15 19 * *'
filters:
branches:
only: master
only: trunk

e2e-canary-i18n-nightly:
jobs:
Expand All @@ -1278,11 +1278,11 @@ workflows:
test-flags: '-I'
filters:
branches:
only: master
only: trunk
triggers:
- schedule:
cron: '46 4 * * *'
filters:
branches:
only: master
only: trunk
# vi: sts=2 ts=2 sw=2 et
9 changes: 6 additions & 3 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ object BuildBaseImages : BuildType({
schedulingPolicy = daily {
hour = 0
}
branchFilter = "+:master"
branchFilter = """
+:master
+:trunk
""".trimIndent()
triggerBuild = always()
withPendingChangesOnly = false
}
Expand Down Expand Up @@ -573,7 +576,7 @@ object CheckCodeStyle : BuildType({
if [ "%teamcity.build.branch.is_default%" = "true" ] || [ "%calypso.run_full_eslint%" = "true" ]; then
FILES_TO_LINT="."
else
FILES_TO_LINT=${'$'}(git diff --name-only --diff-filter=d refs/remotes/origin/master...HEAD | grep -E '(\.[jt]sx?|\.md)${'$'}' || exit 0)
FILES_TO_LINT=${'$'}(git diff --name-only --diff-filter=d refs/remotes/origin/trunk...HEAD | grep -E '(\.[jt]sx?|\.md)${'$'}' || exit 0)
fi
echo "Files to lint:"
echo ${'$'}FILES_TO_LINT
Expand Down Expand Up @@ -638,7 +641,7 @@ object WpCalypso : GitVcsRoot({
name = "wp-calypso"
url = "git@github.com:Automattic/wp-calypso.git"
pushUrl = "git@github.com:Automattic/wp-calypso.git"
branch = "refs/heads/master"
branch = "refs/heads/trunk"
branchSpec = "+:refs/heads/*"
useTagsAsBranches = true
authMethod = uploadedKey {
Expand Down
2 changes: 1 addition & 1 deletion apps/notifications/src/doc/note-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The result of this function (a string enhanced with HTML tag information) is the

Local development of Calypso logic for rendering notifications can take place making use of the Calypso dev server, as any changes made to `src/apps/notifications` will be reflected in the Calypso local development environment automatically.

However, as notifications can also be viewed in an iframe on non-Calypso sites using the masterbar (see <https://github.com/Automattic/wp-calypso/edit/master/apps/notifications/README.md>), any changes to the notifications sub-application should also be tested on a sandboxed WP.com site. To do this, run the following commands:
However, as notifications can also be viewed in an iframe on non-Calypso sites using the masterbar (see <https://github.com/Automattic/wp-calypso/edit/trunk/apps/notifications/README.md>), any changes to the notifications sub-application should also be tested on a sandboxed WP.com site. To do this, run the following commands:

```bash
# Builds files and places them in `apps/notifications/dist`
Expand Down
2 changes: 1 addition & 1 deletion bin/eslint-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const eslintBin = path.join( '.', 'node_modules', '.bin', 'eslint' );

const branchName = child_process.execSync( 'git rev-parse --abbrev-ref HEAD' ).toString().trim();
const rev = child_process
.execSync( 'git merge-base ' + branchName + ' master' )
.execSync( 'git merge-base ' + branchName + ' trunk' )
.toString()
.trim();
const files = child_process
Expand Down
4 changes: 2 additions & 2 deletions bin/get-circle-artifact-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ async function getCircleArtifactUrl( pathMatchRegex ) {
process.exit( 1 );
}
try {
// Fetch recent successful master builds
// Fetch recent successful trunk builds
const builds = await httpsGetJsonPromise( {
...baseOptions,
path: `${ basePath }/tree/master?filter=successful&limit=${ maxBuilds }`,
path: `${ basePath }/tree/trunk?filter=successful&limit=${ maxBuilds }`,
} );

const buildNumbersWithArtifacts = builds
Expand Down
2 changes: 1 addition & 1 deletion bin/get-circle-string-artifact-url
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

// This script will return a url of the calypso-strings.pot file generated in our latest master build.
// This script will return a url of the calypso-strings.pot file generated in our latest trunk build.
// eg: node bin/get-circle-string-artifact-url | xargs curl

const getCircleArtifactUrl = require( './get-circle-artifact-url' );
Expand Down
4 changes: 2 additions & 2 deletions bin/pre-push-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ console.log(

const currentBranch = execSync( 'git rev-parse --abbrev-ref HEAD' ).toString().trim();

if ( 'master' === currentBranch ) {
if ( ! readline.keyInYN( "You're about to push !!![ master ]!!!, is that what you intended?" ) ) {
if ( 'trunk' === currentBranch ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we need to support trunk and master for a period of time while we wait for everybody to rename their local branches?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's a good idea. That should also be helped by the calypso-doctor check I'm going to add as well.

if ( ! readline.keyInYN( "You're about to push !!![ trunk ]!!!, is that what you intended?" ) ) {
process.exit( 1 );
}
}
2 changes: 1 addition & 1 deletion client/components/environment-badge/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function TestHelper() {
}

export function Branch( { branchName, commitChecksum } ) {
return branchName === 'master' ? null : (
return branchName === 'trunk' ? null : (
/* eslint-disable wpcalypso/jsx-classname-namespace */
<span className="environment branch-name" title={ 'Commit ' + commitChecksum }>
{ branchName }
Expand Down
2 changes: 1 addition & 1 deletion client/components/head/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Head = ( { title = 'WordPress.com', children, branchName, inlineScriptNonc

<link rel="profile" href="http://gmpg.org/xfn/11" />

{ ! branchName || 'master' === branchName ? (
{ ! branchName || 'trunk' === branchName ? (
<link rel="manifest" href="/calypso/manifest.json" />
) : (
<link
Expand Down
2 changes: 1 addition & 1 deletion client/components/readme-viewer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class ReadmeViewer extends Component {
const editLink = (
<a
className="readme-viewer__doc-edit-link devdocs__doc-edit-link"
href={ `https://github.com/Automattic/wp-calypso/edit/master${ readmeFilePath }` }
href={ `https://github.com/Automattic/wp-calypso/edit/trunk${ readmeFilePath }` }
>
Improve this document on GitHub
</a>
Expand Down
2 changes: 1 addition & 1 deletion client/devdocs/doc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class extends React.Component {

renderBody() {
const editURL = encodeURI(
'https://github.com/Automattic/wp-calypso/edit/master/' + this.props.path
'https://github.com/Automattic/wp-calypso/edit/trunk/' + this.props.path
);
const { body, error } = this.state;

Expand Down
2 changes: 1 addition & 1 deletion client/layout/guided-tours/docs/TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ A few notes:
- The first step of a tour needs to have a name of `init` to be recognizable as the first step by the framework.
- The `target` is the DOM element the step should be "glued" to or will point at. There are two ways to do that: either the element has a `data-tip-target` attribute, and we pass that name, or we pass a CSS selector that selects that element (cf. method `targetForSlug`). In this case, it's a `data-tip-target`.
- The `scrollContainer` tells the framework which container it should attempt to scroll in case the `target` isn't visible. In this case, the framework will attempt to scroll the sidebar until the site preview button is in view.
- `translate` calls: we'd add those only after multiple iterations over the copy. Once you merge something with a `translate` call into `master`, the strings will be translated -- and we don't want to waste anyone's time with translating strings that will still change a few times.
- `translate` calls: we'd add those only after multiple iterations over the copy. Once you merge something with a `translate` call into `trunk`, the strings will be translated -- and we don't want to waste anyone's time with translating strings that will still change a few times.
- The `Continue` steps attributes basically say: when the user `click`s the `target`, proceed to the step called `close-preview` (the next step, below). The `hidden` attribute tells the framework to not add an explanatory text below the step.
- The `ButtonRow` with the `Quit` button doesn't really look nice, but it's important to provide a way for the user to get out of the tour. The framework will quit a tour if it believes that the user is trying to navigate away from it, but in this case we thought an explicit way to quit would be good to provide.

Expand Down
2 changes: 1 addition & 1 deletion client/server/pwa/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const buildManifest = ( { branchName } ) => {
// then this can be safely removed.
const environmentUrlOptions = { source: 'pwa' };

if ( branchName && 'master' !== branchName ) {
if ( branchName && 'trunk' !== branchName ) {
environmentUrlOptions.branch = branchName;
}

Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ Once you know what the first small piece of your feature will be, follow this ge
- Don’t be afraid to change, [squash](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html), and rearrange commits or to force push - `git push -f origin fix/something-broken`. Keep in mind, however, that if other people are committing on the same branch then you can mess up their history. You are perfectly safe if you are the only one pushing commits to that branch.
- Squash minor commits such as typo fixes or [fixes to previous commits](http://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html) in the pull request.
4. If you end up needing more than a few commits, consider splitting the pull request into separate components. Discuss in the new pull request and in the comments why the branch was broken apart and any changes that may have taken place that necessitated the split. Our goal is to catch early in the review process those pull requests that attempt to do too much.
5. When you feel that you are ready for a formal review or for merging into `master` make sure you check this list and our [merge checklist](../docs/merge-checklist.md).
- Make sure your branch merges cleanly and consider rebasing against `master` to keep the branch history short and clean.
5. When you feel that you are ready for a formal review or for merging into `trunk` make sure you check this list and our [merge checklist](../docs/merge-checklist.md).
- Make sure your branch merges cleanly and consider rebasing against `trunk` to keep the branch history short and clean.
- If there are visual changes, add before and after screenshots in the pull request comments.
- Add unit tests, or at a minimum, provide helpful instructions for the reviewer so they can test your changes. This will help speed up the review process.
- Ensure that your commit messages are [meaningful](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message).
6. Mention that the PR is ready for review or if you have write access remove the **<span class="label status-in-progress">[Status] In Progress</span>** label from the pull request and add the **<span class="label status-needs-review">[Status] Needs Review</span>** label - someone will provide feedback on the latest unreviewed changes. The reviewer will also mark the pull request as **<span class="label status-needs-author-reply">[Status] Needs Author Reply</span>** if they think you need to change anything.
7. If you get a 👍, 💥, 🚢, <img src="https://github.githubassets.com/images/icons/emoji/shipit.png" class="emoji" />, or a LGTM and the status has been changed to **<span class="label status-ready-to-merge">[Status] Ready to Merge</span>** – this is great – the pull request is ready to be merged into `master`.
7. If you get a 👍, 💥, 🚢, <img src="https://github.githubassets.com/images/icons/emoji/shipit.png" class="emoji" />, or a LGTM and the status has been changed to **<span class="label status-ready-to-merge">[Status] Ready to Merge</span>** – this is great – the pull request is ready to be merged into `trunk`.

Whether somebody is reviewing your code or you are reviewing somebody else’s code, [a positive mindset towards code reviews](https://medium.com/medium-eng/the-code-review-mindset-3280a4af0a89) helps a ton. We’re building something together that is greater than the sum of its parts.

Expand Down
2 changes: 1 addition & 1 deletion docs/data-persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ from changing data shapes, as described below.
As time passes, the shape of our data will change very drastically in our Redux store and in each subtree. If we now
persist state, we run into the issue of our persisted data shape no longer matching what the Redux store expects.

As a developer, this case is extremely easy to hit. If Redux persistence is enabled and we are running master, first
As a developer, this case is extremely easy to hit. If Redux persistence is enabled and we are running trunk, first
allow state to be persisted to the browser and then switch to another git branch that contains minor refactors for an
existing sub-tree. What happens when a selector reaches for a data property that doesn't exist or has been renamed?
Errors!
Expand Down
8 changes: 4 additions & 4 deletions docs/git-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Git Workflow
[Branch Naming Scheme](#branch-naming-scheme)
--------------------

All changes should be developed in a new branch created from the `master` branch.
All changes should be developed in a new branch created from the `trunk` branch.

Branches use the following naming conventions:

Expand All @@ -13,7 +13,7 @@ Branches use the following naming conventions:
* `fix/{something}` -- When you are fixing something broken in a feature
* `try/{something}` -- When you are trying out an idea and want feedback

For example, you can run: `git checkout master` and then `git checkout -b fix/whatsits` to create a new `fix/whatsits` branch off of `origin/master`.
For example, you can run: `git checkout trunk` and then `git checkout -b fix/whatsits` to create a new `fix/whatsits` branch off of `origin/trunk`.

**warning**: Using multiple slashes causes problems with Calypso Live testing. See: [Git branches with multiple slashes](https://stackoverflow.com/questions/2527355/using-the-slash-character-in-git-branch-name). Stick to a single slash.

Expand All @@ -27,9 +27,9 @@ For larger features, keeping branches small requires hiding work-in-progress (WI
Keeping Your Branch Up To Date
------------------------------------------------

While it is tempting to merge from `master` into your branch frequently, this leads to a messy history because each merge creates a merge commit. When working by yourself, it is best to use `git pull --rebase master`, but if you're pushing to a shared repo, it is best to not do any merging or rebasing until the feature is ready for final testing, and then do a [rebase](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request) at the very end. This is one reason why it is important to open pull requests whenever you have working code.
While it is tempting to merge from `trunk` into your branch frequently, this leads to a messy history because each merge creates a merge commit. When working by yourself, it is best to use `git pull --rebase trunk`, but if you're pushing to a shared repo, it is best to not do any merging or rebasing until the feature is ready for final testing, and then do a [rebase](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request) at the very end. This is one reason why it is important to open pull requests whenever you have working code.

If you have a Pull Request branch that cannot be merged into `master` due to a conflict (this can happen for long-running Pull Request discussions), it's still best to rebase the branch (rather than merge) and resolve any conflicts on your local copy.
If you have a Pull Request branch that cannot be merged into `trunk` due to a conflict (this can happen for long-running Pull Request discussions), it's still best to rebase the branch (rather than merge) and resolve any conflicts on your local copy.

Once you have resolved any conflicts locally you can update the Pull Request with `git push --force-with-lease` (note: we prefer using `--force-with-lease` over `--force` to help protect remote commits).

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ First thing is to enable your new feature in Calypso. We'll do that by opening `
"hello-world": true
```

Feature flags are a great way to enable/disable certain features in specific environments. For example, we can merge our "Hello, World!" code in `master,` but hide it behind a feature flag. We have [more documentation on feature flags](../../client/config).
Feature flags are a great way to enable/disable certain features in specific environments. For example, we can merge our "Hello, World!" code in `trunk,` but hide it behind a feature flag. We have [more documentation on feature flags](../../client/config).

### 2. Set up folder structure

Expand Down