Skip to content

Commit

Permalink
Merge pull request #5808 from google/rc_2021_12
Browse files Browse the repository at this point in the history
release: Rc 2021 12
  • Loading branch information
maribethb authored Dec 9, 2021
2 parents e5c40e2 + bb9b64e commit 02a5712
Show file tree
Hide file tree
Showing 582 changed files with 102,602 additions and 67,438 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
*_compressed*.js
*_uncompressed*.js
blockly_uncompressed.js
gulpfile.js
/msg/*
/build/*
/dist/*
/core/utils/global.js
/tests/blocks/*
Expand Down
55 changes: 28 additions & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,6 @@
"rules": {
"curly": ["error"],
"eol-last": ["error"],
// Blockly/Google use 2-space indents.
// Blockly/Google uses +4 space indents for line continuations.
// Ignore default rules for ternary expressions.
"indent": [
"error", 2,
{
"SwitchCase": 1,
"MemberExpression": 2,
"ObjectExpression": 1,
"FunctionDeclaration": {
"body": 1,
"parameters": 2
},
"FunctionExpression": {
"body": 1,
"parameters": 2
},
"CallExpression": {
"arguments": 2
},
"ignoredNodes": ["ConditionalExpression"]
}
],
"keyword-spacing": ["error"],
"linebreak-style": ["error", "unix"],
"max-len": [
Expand All @@ -39,7 +16,7 @@
],
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
"no-unused-vars": [
"error",
"warn",
{
"args": "after-used",
// Ignore vars starting with an underscore.
Expand All @@ -48,7 +25,6 @@
"argsIgnorePattern": "^_"
}
],
"no-use-before-define": ["error"],
// Blockly uses for exporting symbols. no-self-assign added in eslint 5.
"no-self-assign": ["off"],
// Blockly uses single quotes except for JSON blobs, which must use double quotes.
Expand All @@ -72,16 +48,41 @@
"balanced": true
},
"exceptions": ["*"]
}],
// Blockly uses prefixes for optional arguments and test-only functions.
"camelcase": ["error", {
"properties": "never",
"allow": ["^opt_", "^_opt_", "^testOnly_"]
}],
// Use clang-format for indentation by running `npm run format`.
"indent": ["off"],
// Blockly uses capital letters for some non-constructor namespaces.
// Keep them for legacy reasons.
"new-cap": ["off"],
// Mostly use default rules for brace style, but allow single-line blocks.
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
// Blockly uses objects as maps, but uses Object.create(null) to
// instantiate them.
"guard-for-in": ["off"],
"prefer-spread": ["off"],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}]
},
"env": {
"es2020": true,
"browser": true
},
"globals": {
"Blockly": true,
"goog": true
"goog": true,
"exports": true
},
"extends": [
"eslint:recommended"
"eslint:recommended", "google"
]
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @google/blockly-eng
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ updates:
ignore:
- dependency-name: "jsdom"
# For jsdom, ignore all updates for version 16.
# We should test that this does not cause issue
# We should test that this does not cause issue
# google/blockly-samples#665 when version 17 is released.
versions: "16.x"
commit-message:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/assign_reviewers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Assign requested reviewers

# This workflow adds requested reviewers as assignees. If you remove a
# requested reviewer, it will not remove them as an assignee.
#
# See https://github.com/google/blockly/issues/5643 for more
# information on why this was added.
#
# N.B.: Runs with a read-write repo token. Do not check out the
# submitted branch!
on:
pull_request_target:
types: [review_requested]

jobs:
requested-reviewer:
runs-on: ubuntu-latest
steps:
- name: Assign requested reviewer
uses: actions/github-script@v5
with:
script: |
try {
if (context.payload.pull_request === undefined) {
throw new Error("Can't get pull_request payload. " +
'Check a request reviewer event was triggered.');
}
const reviewers = context.payload.pull_request.requested_reviewers;
// Assignees takes in a list of logins rather than the
// reviewer object.
const reviewerNames = reviewers.map(reviewer => reviewer.login);
const {number:issue_number} = context.payload.pull_request;
github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
assignees: reviewerNames
});
} catch (error) {
core.setFailed(error.message);
}
25 changes: 24 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ jobs:
# TODO (#2114): re-enable osx build.
# os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://git@github.com/
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
Expand All @@ -41,3 +48,19 @@ jobs:

env:
CI: true

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Npm Install
run: npm install

- name: Lint
run: npm run lint
25 changes: 25 additions & 0 deletions .github/workflows/check_clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check clang format

# N.B.: Runs with a read-only repo token. Safe(ish) to check out the
# submitted branch.
on: [pull_request]

jobs:
clang-formatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: DoozyX/clang-format-lint-action@v0.13
with:
source: 'core'
extensions: 'js'
# This should be as close as possible to the version that the npm
# package supports. This can be found by running:
# npx clang-format --version.
clangFormatVersion: 13

# The Report clang format workflow (report_clang_format.yml) will
# run (if required) after this one to post a comment to the PR.
# (Note that the version of that workflow run will be the one on
# the master (default) branch, not the PR target branch.)
26 changes: 26 additions & 0 deletions .github/workflows/develop_freeze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This workflow will comment on pull requests that are submitted while develop
# is frozen during the week of release. Skips any pull requests that have the
# label 'ignore-freeze'.
# This workflow should be enabled only while develop is frozen.

name: Develop Freeze PR Comment

on:
# Trigger the workflow on pull request on develop branch
pull_request:
types:
- opened
- reopened
branches:
- develop

jobs:
freeze-comment:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-freeze') }}
runs-on: ubuntu-latest
steps:
- name: PR Comment
uses: github-actions-up-and-running/pr-comment@f1f8ab2bf00dce6880a369ce08758a60c61d6c0b
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: "Thanks for the PR! The develop branch is currently frozen in preparation for the release so it may not be addressed until after release week."
38 changes: 38 additions & 0 deletions .github/workflows/tag_module_cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# For new pull requests against the goog_module branch, adds the 'type: cleanup'
# label and sets the milestone to q3 2021 release.

name: Tag module cleanup

# Trigger on pull requests against goog_module branch only
# Uses pull_request_target to get write permissions so that it can write labels.
on:
pull_request_target:
branches:
- goog_module

jobs:
tag-module-cleanup:

# Add the type: cleanup label
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@a3e7071a34d7e1f219a8a4de9a5e0a34d1ee1293
with:
script: |
// Note that pull requests are considered issues and "shared"
// actions for both features, like manipulating labels and
// milestones are provided within the issues API.
await github.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
// 2021 q3 release milestone.
// https://github.com/google/blockly/milestone/18
milestone: 18
})
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['type: cleanup']
})
40 changes: 40 additions & 0 deletions .github/workflows/update_metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow updates the check_metadata.sh script, which compares the current
# size of build artifacts against their size in the previous version of Blockly.

name: Update Metadata

on: [workflow_dispatch]

jobs:
update-metadata:
runs-on: ubuntu-latest

steps:
- name: Check Out Blockly
uses: actions/checkout@v2
with:
ref: 'develop'

- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Build Blockly
run: npm run build:compressed

- name: Build Blockly blocks
run: npm run build:blocks

- name: Update Metadata
run: source ./tests/scripts/update_metadata.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@9825ae65b1cb54b543b938503728b432a0176d29
with:
commit-message: Update build artifact sizes in check_metadata.sh
delete-branch: true
title: Update build artifact sizes in check_metadata.sh

- name: View Pull Request
run: echo "View Pull Request - ${{ steps.cpr.outputs.pull-request-url }}"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ tests/screenshot/outputs/*
local_build/*compiler*.jar
local_build/local_*_compressed.js
chromedriver
typings/tmp/*
build/
dist/
2 changes: 1 addition & 1 deletion appengine/add_timestamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
Start a venv: `python3 -m venv venv && source venv/bin/activate`
Inside your vm run `pip install google-cloud-ndb`
Run the script: `python add_timestamps.py`
Run the script: `python3 add_timestamps.py`
"""

__author__ = "fenichel@google.com (Rachel Fenichel)"
Expand Down
5 changes: 3 additions & 2 deletions appengine/expiration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ def delete_expired():
results = query.fetch(limit=QUERY_LIMIT, keys_only=True)
for x in results:
x.delete()
return len(results)


def app(environ, start_response):
out = ""
headers = [
("Content-Type", "text/plain")
]
start_response("200 OK", headers)
delete_expired()
n = delete_expired()
out = "%d records deleted." % n
return [out.encode("utf-8")]
Loading

0 comments on commit 02a5712

Please sign in to comment.