Skip to content

Commit

Permalink
Merge branch 'main' into issue_29100
Browse files Browse the repository at this point in the history
  • Loading branch information
CezaryKulakowski committed Sep 30, 2021
2 parents bb5f6aa + 1193a37 commit 39a825b
Show file tree
Hide file tree
Showing 1,013 changed files with 28,240 additions and 15,068 deletions.
741 changes: 284 additions & 457 deletions .circleci/config.yml

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions .devcontainer/README.md
@@ -0,0 +1,59 @@
# Electron Dev on Codespaces

Welcome to the Codespaces Electron Developer Environment.

## Quick Start

Upon creation of your codespace you should have [build tools](https://github.com/electron/build-tools) installed and an initialized gclient checkout of Electron. In order to build electron you'll need to run the following commands.

```bash
e sync -vv
e build
```

The initial sync will take approximately ~30 minutes and the build will take ~8 minutes. Incremental syncs and incremental builds are substantially quicker.

## Directory Structure

Codespaces doesn't lean very well into gclient based checkouts, the directory structure is slightly strange. There are two locations for the `electron` checkout that both map to the same files under the hood.

```graphql
# Primary gclient checkout container
/workspaces/gclient/*
└─ src/* - # Chromium checkout
└─ electron - # Electron checkout
# Symlinked Electron checkout (identical to the above)
/workspaces/electron
```

## Goma

If you are a maintainer [with Goma access](../docs/development/goma.md) it should be automatically configured and authenticated when you spin up a new codespaces instance. You can validate this by checking `e d goma_auth info` or by checking that your build-tools configuration has a goma mode of `cluster`.

## Running Electron

You can run Electron in a few ways. If you just want to see if it launches:

```bash
# Enter an interactive JS prompt headlessly
xvfb-run e start -i
```

But if you want to actually see Electron you will need to use the built-in VNC capability. If you click "Ports" in codespaces and then open the `VNC web client` forwarded port you should see a web based VNC portal in your browser. When you are asked for a password use `builduser`.

Once in the VNC UI you can open `Applications -> System -> XTerm` which will open a VNC based terminal app and then you can run `e start` like normal and Electron will open in your VNC session.

## Running Tests

You run tests via build-tools and `xvfb`.

```bash
# Run all tests
xvfb-run e test

# Run the main process tests
xvfb-run e test --runners=main

# Run the old remote tests
xvfb-run e test --runners=remote
```
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,43 @@
{
"dockerComposeFile": "docker-compose.yml",
"service": "buildtools",
"onCreateCommand": ".devcontainer/on-create-command.sh",
"workspaceFolder": "/workspaces/gclient/src/electron",
"extensions": [
"joeleinbinder.mojom-language",
"rafaelmaiolla.diff",
"surajbarkale.ninja",
"ms-vscode.cpptools",
"mutantdino.resourcemonitor",
"dbaeumer.vscode-eslint",
"shakram02.bash-beautify",
"marshallofsound.gnls-electron"
],
"settings": {
"[gn]": {
"editor.formatOnSave": true
},
"editor.tabSize": 2,
"bashBeautify.tabSize": 2
},
"forwardPorts": [8088, 6080, 5901],
"portsAttributes": {
"8088": {
"label": "Goma Control Panel",
"onAutoForward": "silent"
},
"6080": {
"label": "VNC web client (noVNC)",
"onAutoForward": "silent"
},
"5901": {
"label": "VNC TCP port",
"onAutoForward": "silent"
}
},
"hostRequirements": {
"storage": "32gb",
"cpus": 8
},
"remoteUser": "builduser"
}
19 changes: 19 additions & 0 deletions .devcontainer/docker-compose.yml
@@ -0,0 +1,19 @@
version: '3'

services:
buildtools:
image: ghcr.io/electron/devcontainer:27db4a3e3512bfd2e47f58cea69922da0835f1d9

volumes:
- ..:/workspaces/gclient/src/electron:cached

- /var/run/docker.sock:/var/run/docker.sock

command: /bin/sh -c "while sleep 1000; do :; done"

user: builduser

cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
74 changes: 74 additions & 0 deletions .devcontainer/on-create-command.sh
@@ -0,0 +1,74 @@
#!/bin/bash

set -eo pipefail

buildtools=$HOME/.electron_build_tools
gclient_root=/workspaces/gclient
buildtools_configs=/workspaces/buildtools-configs

export PATH="$PATH:$buildtools/src"

# Create the persisted buildtools config folder
mkdir -p $buildtools_configs
rm -f $buildtools/configs
ln -s $buildtools_configs $buildtools/configs

# Write the gclient config if it does not already exist
if [ ! -f $gclient_root/.gclient ]; then
echo "solutions = [
{ \"name\" : \"src/electron\",
\"url\" : \"https://github.com/electron/electron\",
\"deps_file\" : \"DEPS\",
\"managed\" : False,
\"custom_deps\" : {
},
\"custom_vars\": {},
},
]
" >$gclient_root/.gclient
fi

# Write the default buildtools config file if it does
# not already exist
if [ ! -f $buildtools/configs/evm.testing.json ]; then
write_config() {
echo "
{
\"root\": \"/workspaces/gclient\",
\"goma\": \"$1\",
\"gen\": {
\"args\": [
\"import(\\\"//electron/build/args/testing.gn\\\")\",
\"import(\\\"/home/builduser/.electron_build_tools/third_party/goma.gn\\\")\"
],
\"out\": \"Testing\"
},
\"env\": {
\"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\",
\"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\"
},
\"remotes\": {
\"electron\": {
\"origin\": \"https://github.com/electron/electron.git\"
}
}
}
" >$buildtools/configs/evm.testing.json
}

# Start out as cache only
write_config cache-only

e use testing

# Attempt to auth to the goma service via codespaces tokens
# if it works we can use the goma cluster
export NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN
if e d goma_auth login; then
write_config cluster
fi
else
# Even if the config file existed we still need to re-auth with the goma
# cluster
NOTGOMA_CODESPACES_TOKEN=$GITHUB_TOKEN e d goma_auth login || true
fi
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -12,4 +12,8 @@ DEPS @electron/wg-upgrades
/script/release @electron/wg-releases

# Security WG
/lib/browser/devtools.ts @electron/wg-security
/lib/browser/guest-view-manager.ts @electron/wg-security
/lib/browser/guest-window-proxy.ts @electron/wg-security
/lib/browser/rpc-server.ts @electron/wg-security
/lib/renderer/security-warnings.ts @electron/wg-security
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Expand Up @@ -8,9 +8,9 @@ body:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
required: true
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
required: true
- label: I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.
required: true
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Expand Up @@ -8,9 +8,9 @@ body:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
required: true
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
required: true
- label: I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.
required: true
Expand All @@ -37,4 +37,4 @@ body:
label: Additional Information
description: Add any other context about the problem here.
validations:
required: true
required: false
Expand Up @@ -7,9 +7,9 @@ body:
label: Preflight Checklist
description: Please ensure you've completed all of the following.
options:
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
required: true
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
required: true
- type: input
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -3,15 +3,15 @@
Thank you for your Pull Request. Please provide a description above and review
the requirements below.
Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md
Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [ ] PR description included and stakeholders cc'd
- [ ] `npm test` passes
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/master/docs/development/testing.md)
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [ ] relevant documentation is changed or added
- [ ] [PR release notes](https://github.com/electron/clerk/blob/master/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/master/README.md#examples).

Expand Down
6 changes: 3 additions & 3 deletions .github/config.yml
Expand Up @@ -2,7 +2,7 @@
newPRWelcomeComment: |
💖 Thanks for opening this pull request! 💖
We use [semantic commit messages](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines) to streamline the release process. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix.
We use [semantic commit messages](https://github.com/electron/electron/blob/main/docs/development/pull-requests.md#commit-message-guidelines) to streamline the release process. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix.
Examples of commit messages with semantic prefixes:
Expand All @@ -12,9 +12,9 @@ newPRWelcomeComment: |
Things that will help get your PR across the finish line:
- Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/master/docs/development/coding-style.md).
- Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/main/docs/development/coding-style.md).
- Run `npm run lint` locally to catch formatting errors earlier.
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/master/docs/styleguide.md).
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/main/docs/styleguide.md).
- Include tests when adding/changing behavior.
- Include screenshots and animated GIFs whenever possible.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -26,6 +26,7 @@ compile_commands.json
# npm package
/npm/dist
/npm/path.txt
/npm/checksums.json

.npmrc

Expand Down
5 changes: 4 additions & 1 deletion .markdownlint.json
Expand Up @@ -22,5 +22,8 @@
"no-trailing-spaces": {
"br_spaces": 0
},
"single-h1": false
"single-h1": false,
"no-inline-html": {
"allowed_elements": ["br"]
}
}
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
14

0 comments on commit 39a825b

Please sign in to comment.