Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release' into feature/SLB-295-Br…
Browse files Browse the repository at this point in the history
…eadcrumbs
  • Loading branch information
Luqmaan Essop committed Jun 11, 2024
2 parents 8e2940e + 2b815f7 commit 13ada68
Show file tree
Hide file tree
Showing 101 changed files with 4,509 additions and 2,009 deletions.
14 changes: 3 additions & 11 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,8 @@ runs:
- name: Install dependencies
shell: bash
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 pnpm i
run: pnpm i

- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install Playwright browsers
run: pnpm --filter "@custom-tests/e2e" download-browsers
- name: Check formatting
shell: bash
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm test:format
77 changes: 77 additions & 0 deletions .github/workflows/estimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Estimate
on:
pull_request:

jobs:
estimate:
name: Estimate
if: vars.JIRA_PROJECT_ID != ''
runs-on: ubuntu-20.04
steps:
- name: Start Check Run
id: check
env:
GH_TOKEN: ${{ github.token }}
run: |
CHECK_ID=$(gh api -X POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f 'name=Estimator' \
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \
-f 'status=in_progress' \
-f 'output[title]=🎲 Estimation in progress' \
-f 'output[summary]=🎲 Estimation in progress' \
/repos/${{ github.repository }}/check-runs --jq '.id')
echo "check_id=$CHECK_ID" >> $GITHUB_OUTPUT
- name: Install estimator
run: npm install -g @amazeelabs/estimator

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

- name: Find common ancestor
id: ancestor
env:
BASE_BRANCH: ${{ github.base_ref }}
run:
echo "hash=$(git merge-base --fork-point origin/$BASE_BRANCH)" >>
$GITHUB_OUTPUT

- name: Estimate
id: estimate
env:
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }}
PARENT_COMMIT: ${{ steps.ancestor.outputs.hash }}
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }}
run: echo "result=$(amazeelabs-estimator estimate)" >> $GITHUB_OUTPUT
continue-on-error: true

- name: Report success
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -X PATCH -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f 'name=Estimator' \
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \
-f 'conclusion=success' \
-f 'output[title]=🎲 ${{ steps.estimate.outputs.result }}' \
-f 'output[summary]=🎲 ${{ steps.estimate.outputs.result }}' \
/repos/${{ github.repository }}/check-runs/${{ steps.check.outputs.check_id }}
if: steps.estimate.outputs.result != ''

- name: Report error
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api -X PATCH -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-f 'name=Estimator' \
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \
-f 'conclusion=failure' \
-f 'output[title]=💥 Estimation failed' \
-f 'output[summary]=💥 Estimation failed' \
/repos/${{ github.repository }}/check-runs/${{ steps.check.outputs.check_id }}
if: steps.estimate.outputs.result == ''
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,25 @@ jobs:
target_branch: prod
github_token: ${{ secrets.GITHUB_TOKEN }}

update_dashboard:
name: Update dashboard
if: github.ref == 'refs/heads/release' && vars.JIRA_PROJECT_ID != ''
runs-on: ubuntu-20.04
steps:
- name: Install estimator
run: npm install -g @amazeelabs/estimator

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

- name: Update dashboard
env:
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }}
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }}
run: amazeelabs-estimator update

docker_build:
name: Docker Build
if:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/write-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Write dashboard history
on:
workflow_dispatch:

jobs:
write_dashboard:
name: Write dashboard history
if: github.ref == 'refs/heads/release' && vars.JIRA_PROJECT_ID != ''
runs-on: ubuntu-20.04
steps:
- name: Install estimator
run: npm install -g @amazeelabs/estimator

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

- name: Update dashboard
env:
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }}
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }}
run: amazeelabs-estimator write-history
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.idea/inspectionProfiles
.idea/git_toolbox_prj.xml
build-storybook.log
storybook-static
coverage
Expand Down
2 changes: 1 addition & 1 deletion .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .lagoon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node /usr/local/bin/node /usr/local/bin/node
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm

ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1

# Install pnpm
RUN npm install -g [email protected] && pnpm config set store-dir /tmp/cache/pnpm

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,21 @@ Other steps
- [Create a new Lagoon project](https://amazeelabs.atlassian.net/wiki/spaces/ALU/pages/368115717/Create+a+new+Lagoon+project)
- [Create a new Netlify project](https://amazeelabs.atlassian.net/wiki/spaces/ALU/pages/368017428/Create+a+new+Netlify+project)
- Check the [Environment overrides](#environment-overrides) section below
- Check the [Statistics and Estimations](#statistics-and-estimations) section
below
- Check the [Choose a CMS](#choose-a-cms) section below
- Create `dev` and `prod` branches (and optionally `stage`) from `release`

## Connect to automatic estimations

There are Github workflows that can connect to the
[Amazeelabs Dashboard](https://dashboard.amazeelabs.com) to log complexity
statistics and retrieve automatic estimations. To use that, provide a
`JIRA_PROJECT_ID` environment variable in the Github repository variables.

The project should then show up on
[Estimator page](https://dashboard.amazeelabs.com/estimator).

## Choose a CMS

The template comes with Drupal and Decap CMS enabled by default. To disable
Expand Down
3 changes: 3 additions & 0 deletions apps/cms/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
},
"amazeelabs/silverback_gatsby": {
"Autosave preview": "./patches/fetch-entity.patch"
},
"drupal/gutenberg": {
"Gutenberg enabled hook": "https://www.drupal.org/files/issues/2024-05-07/gutenberg_enabled_hook_3445677-2.patch"
}
},
"patchLevel": {
Expand Down
103 changes: 103 additions & 0 deletions apps/cms/config/sync/core.entity_form_display.node.page.split.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
uuid: a39d0011-2ebf-4b18-a9f0-8b5aeff5b9aa
langcode: en
status: true
dependencies:
config:
- core.entity_form_mode.node.split
- field.field.node.page.body
- field.field.node.page.field_metatags
- node.type.page
- workflows.workflow.basic
module:
- content_moderation
- metatag
- path
id: node.page.split
targetEntityType: node
bundle: page
mode: split
content:
created:
type: datetime_timestamp
weight: 3
region: content
settings: { }
third_party_settings: { }
field_metatags:
type: metatag_firehose
weight: 11
region: content
settings:
sidebar: true
use_details: true
third_party_settings: { }
langcode:
type: language_select
weight: 1
region: content
settings:
include_locked: true
third_party_settings: { }
moderation_state:
type: moderation_state_default
weight: 9
region: content
settings: { }
third_party_settings: { }
path:
type: path
weight: 7
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
weight: 5
region: content
settings:
display_label: true
third_party_settings: { }
status:
type: boolean_checkbox
weight: 10
region: content
settings:
display_label: true
third_party_settings: { }
sticky:
type: boolean_checkbox
weight: 6
region: content
settings:
display_label: true
third_party_settings: { }
title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
translation:
weight: 4
region: content
settings: { }
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 2
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
url_redirects:
weight: 8
region: content
settings: { }
third_party_settings: { }
hidden:
body: true
11 changes: 11 additions & 0 deletions apps/cms/config/sync/core.entity_form_mode.node.split.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
uuid: 5f26940d-fd06-41e0-8e59-9dfcdc9c86df
langcode: en
status: true
dependencies:
module:
- node
id: node.split
label: Split
description: ''
targetEntityType: node
cache: true
1 change: 1 addition & 0 deletions apps/cms/config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module:
dropzonejs: 0
dynamic_page_cache: 0
editor: 0
entity_create_split: 0
entity_usage: 0
environment_indicator: 0
field: 0
Expand Down
6 changes: 4 additions & 2 deletions apps/cms/config/sync/entity_usage.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ local_task_enabled_entity_types:
- node
track_enabled_source_entity_types:
- node
- content_moderation_state
- block_content
- content_moderation_state
- menu_link_content
- media
- redirect
- shortcut
- path_alias
track_enabled_target_entity_types:
- node
- content_moderation_state
- block_content
- content_moderation_state
- menu_link_content
- media
- redirect
Expand All @@ -32,6 +32,8 @@ track_enabled_plugins:
- html_link
- ckeditor_image
- block_field
- gutenberg_linked_content
- gutenberg_referenced_content
- gutenberg_media_embed
track_enabled_base_fields: false
site_domains: { }
Expand Down
2 changes: 1 addition & 1 deletion apps/cms/config/sync/linkit.linkit_profile.gutenberg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ matchers:
bundles:
document: document
group_by_bundle: 0
substitution_type: null
substitution_type: canonical
limit: '100'
weight: -9
4 changes: 1 addition & 3 deletions apps/cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"drush": "SB_ENVIRONMENT=1 SIMPLETEST_DB=sqlite://localhost/sites/default/files/.sqlite DRUSH_OPTIONS_URI=http://127.0.0.1:8888 vendor/bin/drush",
"silverback": "SB_ENVIRONMENT=1 SIMPLETEST_DB=sqlite://localhost/sites/default/files/.sqlite SB_ADMIN_USER=admin SB_ADMIN_PASS=admin vendor/bin/silverback",
"drupal-install": "SB_SETUP=1 pnpm silverback setup --profile minimal && pnpm content:import && pnpm drush php-eval 'node_access_rebuild();' && rm -rf install-cache.zip && pnpm fix-premissions && pnpm ensure-working-db",
"export-webforms": "pnpm run --filter '@custom-tests/e2e' download-browsers && pnpm run --filter '@custom-tests/e2e' webform-snapshots",
"export-webforms": "pnpm turbo --filter '@custom-tests/e2e' webform-snapshots",
"start": "cd web; SB_ENVIRONMENT=1 SIMPLETEST_DB=sqlite://localhost/sites/default/files/.sqlite DRUSH_OPTIONS_URI=http://127.0.0.1:8888 php -S 0.0.0.0:8888 .ht.router.php # no drush to avoid the drush server timeout",
"dev": "pnpm start",
"clear": "pnpm drush cr",
Expand All @@ -24,8 +24,6 @@
"content:import": "pnpm drush php-script web/modules/custom/test_content/import.php",
"config:export": "pnpm drush cex -y",
"config:import": "pnpm drush -y cim",
"schema:test": "pnpm jest --testMatch '<rootDir>/generated/__tests__/test-queries.js' --passWithNoTests",
"schema:test:update": "pnpm schema:test -u",
"import-translations": "pnpm drush scr scripts/translations-import.php"
},
"peerDependencies": {
Expand Down
Empty file removed apps/cms/patches/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@amazeelabs/gatsby-plugin-operations": "^1.1.3",
"@amazeelabs/gatsby-plugin-static-dirs": "^1.0.1",
"@amazeelabs/gatsby-source-silverback": "^1.14.0",
"@amazeelabs/publisher": "^2.4.17",
"@amazeelabs/publisher": "^2.4.30",
"@amazeelabs/strangler-netlify": "^1.1.9",
"@amazeelabs/token-auth-middleware": "^1.1.1",
"@custom/cms": "workspace:*",
Expand Down
Loading

0 comments on commit 13ada68

Please sign in to comment.