Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into crwapp-listr-to-listr2
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Walker-GM committed Oct 3, 2022
2 parents 83e6cc1 + fc8ee95 commit f9f5653
Show file tree
Hide file tree
Showing 86 changed files with 2,220 additions and 1,715 deletions.
9 changes: 6 additions & 3 deletions .eslintrc.js
Expand Up @@ -15,6 +15,7 @@ const findBabelConfig = (cwd = process.cwd()) => {
module.exports = {
extends: path.join(__dirname, 'packages/eslint-config/shared.js'),
parserOptions: {
ecmaVersion: 'latest',
babelOptions: {
configFile: findBabelConfig(),
},
Expand All @@ -31,6 +32,11 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
curly: 'error',
},
env: {
// We use the most modern environment available. Then we rely on Babel to
// transpile it to something that can run on all node versions we support
es2022: true,
},
overrides: [
{
files: ['packages/structure/src/**'],
Expand All @@ -56,7 +62,6 @@ module.exports = {
'packages/web/src/**',
],
env: {
es6: true,
browser: true,
},
globals: {
Expand Down Expand Up @@ -100,7 +105,6 @@ module.exports = {
{
files: ['packages/web/src/entry/index.js'],
env: {
es6: true,
browser: true,
},
globals: {
Expand All @@ -125,7 +129,6 @@ module.exports = {
'packages/telemetry/src/**',
],
env: {
es6: true,
node: true,
},
},
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/cherry-pick-into-release-branch.yml
@@ -0,0 +1,70 @@
# When a PR is merged into the main branch, this workflow tries to cherry pick the squashed commit into the release branch
# by fast forwarding the release branch via the `--ff` option.
# If that doesn't work (i.e. main and release have diverged), it'll open a PR against the release branch with the squashed commit.

name: 🍒 Cherry pick into release branch

on:
pull_request_target:
branches: [main]
types: [closed]

jobs:
cherry-pick-fast-forward:
# Don't cherry pick commits with breaking changes.
# The quotes prevent yaml from interpreting the `!` as a "non-specific tag".
if: ${{ github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'release:feature-breaking') }}
name: ⏩ Cherry pick fast forward
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: release
# git isn't able to work with $GITHUB_SHA if we don't checkout everything.
fetch-depth: 0
# Since release is a protected branch, we need a token to run `git push` later.
token: ${{ secrets.JTOAR_TOKEN }}

- name: ⏩ Cherry pick fast forward
run: |
# Here, $GITHUB_SHA is the last merge commit on the $GITHUB_REF branch.
# That merge commit is already in the main branch at this point (this action runs on "pull_request closed" events).
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
git cherry-pick --ff $GITHUB_SHA
# If the HEAD of main and release point to the same commit, then the fast forward worked and we can go ahead and push.
if [[ "$(git rev-parse origin/main)" = "$(git rev-parse release)" ]]; then
git push
else
exit 1
fi
cherry-pick-into-release-pr:
needs: cherry-pick-fast-forward
if: failure()
name: Cherry pick into release PR
runs-on: ubuntu-latest

steps:
- name: 🔑 Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Cherry pick into release PR
uses: carloscastrojumo/github-cherry-pick-action@v1.0.2
with:
# We specify a token because we want other workflows (like CI) to run on this PR.
# If we omit this, it uses the default token (GITHUB_TOKEN) which doesn't trigger other workflows.
token: ${{ steps.generate_token.outputs.token }}
branch: release
labels: cherry-pick
31 changes: 0 additions & 31 deletions .github/workflows/cherry-pick-into-release-pr.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -315,3 +315,73 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- run: echo "Only doc changes"

cherry-pick:
needs: [build-lint-test, tutorial-e2e, smoke-test]
if: github.event.pull_request.user.login == 'redwoodjs-bot[bot]' && github.base_ref == 'release' && !contains(join(needs.*.result, ','), 'failure')
name: cherry-pick
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: release
fetch-depth: 0
token: ${{ secrets.JTOAR_TOKEN }}

- name: 🍒 Cherry pick
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git cherry-pick ${{ github.event.pull_request.head.sha }}
git push
- name: Close PR
env:
GH_TOKEN: ${{ secrets.JTOAR_TOKEN }}
run: |
gh api graphql -F id=${{ github.event.pull_request.node_id }} -f query='
mutation($id: ID!) {
closePullRequest(input: {
pullRequestId: $id
}) {
clientMutationId
}
}
'
cherry-pick-docs:
needs: [build-lint-test-docs, tutorial-e2e-docs, smoke-test-docs]
if: github.event.pull_request.user.login == 'redwoodjs-bot[bot]' && github.base_ref == 'release' && !contains(join(needs.*.result, ','), 'failure')
name: cherry-pick-docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: release
fetch-depth: 0
token: ${{ secrets.JTOAR_TOKEN }}

- name: 🍒 Cherry pick
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git cherry-pick ${{ github.event.pull_request.head.sha }}
git push
- name: Close PR
env:
GH_TOKEN: ${{ secrets.JTOAR_TOKEN }}
run: |
gh api graphql -F id=${{ github.event.pull_request.node_id }} -f query='
mutation($id: ID!) {
closePullRequest(input: {
pullRequestId: $id
}) {
clientMutationId
}
}
'
20 changes: 0 additions & 20 deletions .github/workflows/enable-auto-merge.yml

This file was deleted.

4 changes: 2 additions & 2 deletions __fixtures__/test-project/api/package.json
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@redwoodjs/api": "3.0.2",
"@redwoodjs/graphql-server": "3.0.2"
"@redwoodjs/api": "3.0.3",
"@redwoodjs/graphql-server": "3.0.3"
}
}
Expand Up @@ -10,7 +10,7 @@ import {
import type { StandardScenario } from './contacts.scenarios'

// Generated boilerplate tests do not account for all circumstances
// and can fail without adjustments, e.g. Float and DateTime types.
// and can fail without adjustments, e.g. Float.
// Please refer to the RedwoodJS Testing Docs:
// https://redwoodjs.com/docs/testing#testing-services
// https://redwoodjs.com/docs/testing#jest-expect-type-considerations
Expand Down
Expand Up @@ -10,7 +10,7 @@ export const standard = defineScenario<Prisma.PostCreateArgs>({
body: 'String',
author: {
create: {
email: 'String4857147',
email: 'String9043010',
hashedPassword: 'String',
fullName: 'String',
salt: 'String',
Expand All @@ -24,7 +24,7 @@ export const standard = defineScenario<Prisma.PostCreateArgs>({
body: 'String',
author: {
create: {
email: 'String1125871',
email: 'String3280784',
hashedPassword: 'String',
fullName: 'String',
salt: 'String',
Expand Down
Expand Up @@ -4,7 +4,7 @@ import { posts, post, createPost, updatePost, deletePost } from './posts'
import type { StandardScenario } from './posts.scenarios'

// Generated boilerplate tests do not account for all circumstances
// and can fail without adjustments, e.g. Float and DateTime types.
// and can fail without adjustments, e.g. Float.
// Please refer to the RedwoodJS Testing Docs:
// https://redwoodjs.com/docs/testing#testing-services
// https://redwoodjs.com/docs/testing#jest-expect-type-considerations
Expand Down
Expand Up @@ -6,15 +6,15 @@ export const standard = defineScenario<Prisma.UserCreateArgs>({
user: {
one: {
data: {
email: 'String4815975',
email: 'String4277909',
hashedPassword: 'String',
fullName: 'String',
salt: 'String',
},
},
two: {
data: {
email: 'String3376651',
email: 'String493680',
hashedPassword: 'String',
fullName: 'String',
salt: 'String',
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project/package.json
Expand Up @@ -8,7 +8,7 @@
]
},
"devDependencies": {
"@redwoodjs/core": "3.0.2"
"@redwoodjs/core": "3.0.3"
},
"eslintConfig": {
"extends": "@redwoodjs/eslint-config",
Expand Down
11 changes: 6 additions & 5 deletions __fixtures__/test-project/web/package.json
Expand Up @@ -13,16 +13,17 @@
]
},
"dependencies": {
"@redwoodjs/auth": "3.0.2",
"@redwoodjs/forms": "3.0.2",
"@redwoodjs/router": "3.0.2",
"@redwoodjs/web": "3.0.2",
"@redwoodjs/auth": "3.0.3",
"@redwoodjs/forms": "3.0.3",
"@redwoodjs/router": "3.0.3",
"@redwoodjs/web": "3.0.3",
"humanize-string": "2.1.0",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"devDependencies": {
"autoprefixer": "^10.4.11",
"autoprefixer": "^10.4.12",
"postcss": "^8.4.16",
"postcss-loader": "^7.0.1",
"prettier-plugin-tailwindcss": "^0.1.13",
Expand Down
7 changes: 3 additions & 4 deletions __fixtures__/test-project/web/src/Routes.tsx
Expand Up @@ -10,8 +10,7 @@
import { Router, Route, Private, Set } from '@redwoodjs/router'

import BlogLayout from 'src/layouts/BlogLayout'
import ContactsLayout from 'src/layouts/ContactsLayout'
import PostsLayout from 'src/layouts/PostsLayout'
import ScaffoldLayout from 'src/layouts/ScaffoldLayout'
import HomePage from 'src/pages/HomePage'

const Routes = () => {
Expand All @@ -21,13 +20,13 @@ const Routes = () => {
<Route path="/signup" page={SignupPage} name="signup" />
<Route path="/forgot-password" page={ForgotPasswordPage} name="forgotPassword" />
<Route path="/reset-password" page={ResetPasswordPage} name="resetPassword" />
<Set wrap={ContactsLayout}>
<Set wrap={ScaffoldLayout} title="Contacts" titleTo="contacts" buttonLabel="New Contact" buttonTo="newContact">
<Route path="/contacts/new" page={ContactNewContactPage} name="newContact" />
<Route path="/contacts/{id:Int}/edit" page={ContactEditContactPage} name="editContact" />
<Route path="/contacts/{id:Int}" page={ContactContactPage} name="contact" />
<Route path="/contacts" page={ContactContactsPage} name="contacts" />
</Set>
<Set wrap={PostsLayout}>
<Set wrap={ScaffoldLayout} title="Posts" titleTo="posts" buttonLabel="New Post" buttonTo="newPost">
<Route path="/posts/new" page={PostNewPostPage} name="newPost" />
<Route path="/posts/{id:Int}/edit" page={PostEditPostPage} name="editPost" />
<Route path="/posts/{id:Int}" page={PostPostPage} name="post" />
Expand Down

0 comments on commit f9f5653

Please sign in to comment.