Skip to content

Commit

Permalink
Merge branch 'edge' into heroku-deploy-resurrection
Browse files Browse the repository at this point in the history
* edge:
  Fix typos (#1665)
  update bundlewatch config (#1621)
  • Loading branch information
ballPointPenguin committed Apr 9, 2023
2 parents b92d4b0 + 14ae6d4 commit 6b2d315
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 49 deletions.
32 changes: 16 additions & 16 deletions .bundlewatch.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module.exports = {
"ci": {
"trackBranches": [
process.env.CI_BRANCH_DEFAULT,
],
ci: {
trackBranches: [process.env.CI_BRANCH_DEFAULT],
baseBranch: process.env.CI_BRANCH_DEFAULT,
// Allows bundlewatch GitHub Actions workflow to work on: pull_request, or push
"commitSha": process.env.PR_COMMIT_SHA || process.env.PUSH_COMMIT_SHA,
"repoBranchBase": process.env.PR_BRANCH_BASE || process.env.PUSH_BRANCH_BASE,
"repoCurrentBranch": process.env.PR_BRANCH || process.env.PUSH_BRANCH,
commitSha: process.env.PR_COMMIT_SHA || process.env.PUSH_COMMIT_SHA,
repoBranchBase: process.env.PR_BRANCH_BASE || process.env.PUSH_BRANCH_BASE,
repoCurrentBranch: process.env.PR_BRANCH || process.env.PUSH_BRANCH,
},
"files": [
files: [
{
"path": "client-admin/dist/**/*.js",
"maxSize": "180 kB",
path: "client-admin/build/static/js/*.js",
maxSize: "250 kB",
},
{
"path": "client-participation/dist/cached/*/js/polis.js",
"maxSize": "150 kB",
path: "client-participation/dist/js/*.js",
maxSize: "450 kB",
},
{
"path": "client-participation/dist/cached/*/js/vis_bundle.js",
"maxSize": "200 kB",
},
]
path: "client-report/dist/*.js",
maxSize: "200 kB",
}
],
normalizeFileNames: /^.+?(\..+?)\.\w+$/,
};
51 changes: 22 additions & 29 deletions .github/workflows/bundlewatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,41 @@ name: "Bundlewatch Github Action"
on:
push:
# Required so that baseline for comparison is pushed to bundlewatch service.
branches: ["dev"]
branches:
- edge
paths:
- .github/workflows/bundlewatch.yml
- client-admin/**
- client-participation/**
- client-report/**
pull_request:
types: ["opened", "reopened", "synchronize"]
paths:
- .github/workflows/bundlewatch.yml
- client-admin/**
- client-participation/**
- client-report/**

jobs:
bundlewatch:
runs-on: ubuntu-latest
env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3

# Both components use this version
# Client components all use this version
- name: Use Node version for app builds
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v3
with:
node-version: 11.15.0
node-version: 18

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Restore npm cache directory
uses: actions/cache@v2.1.5
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -48,32 +49,24 @@ jobs:
run: |
npm install
npm run build:prod
mv dist/static/js/admin_bundle.*.js dist/static/js/admin_bundle.xxxxxxxx.js
- name: "Install & Build: client-participation"
working-directory: client-participation
run: |
npm install
npm run deploy:prod
# So directory stays consistent between builds for comparison.
mv dist/cached/* dist/cached/xxxxxxxxx
npm run build:prod
- name: "Install & Build: client-report"
working-directory: client-report
run: |
npm install
npm run build:prod
- name: Install Bundlewatch
run: npm install -g bundlewatch@0.2.6
run: npm install -g bundlewatch@0.3.3

- name: "Run Bundlewatch"
# TODO: Move config to root directory, so easier to run against all components.
# See: https://github.com/bundlewatch/bundlewatch/pull/170
env:
CI_BRANCH_DEFAULT: ${{ github.event.repository.default_branch }}

PR_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
# Overrides `ci.repoBranchBase` (bundlewatch config)
PR_BRANCH_BASE: ${{ github.event.pull_request.base.ref }}

PUSH_COMMIT_SHA: ${{ github.event.after }}
# PUSH_BRANCH: see below (needs processing)
PUSH_BRANCH_BASE: ${{ github.event.repository.default_branch }}
# GITHUB_REF is in format `refs/heads/branch-name`, so need to strip first part.
run: PUSH_BRANCH=${GITHUB_REF#refs/heads/} npx bundlewatch --config .bundlewatch.config.js
uses: jackyef/bundlewatch-gh-action@master
with:
bundlewatch-github-token: ${{ secrets.GITHUB_TOKEN }}
bundlewatch-config: .bundlewatch.config.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ make start
Any time you want to _rebuild_ the images, just reaffix `--build` when you run. Another way to
easily rebuild and start your containers is with `make start-rebuild`.

If you have only changed configuration values in .env, you can reacreate your containers without
If you have only changed configuration values in .env, you can recreate your containers without
fully rebuilding them with `--force-recreate`. For example:

```sh
Expand Down
2 changes: 1 addition & 1 deletion docs/scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Typically, this would be run on a single machine, and thus for even moderate sca
This complicates the process of adjusting in real time to changing demand in a cost and resource effective manner.

For small to medium size deployments with rather steady or predictable participation rates, this may be a tenable solution.
But for deployments which expect exceptionally high, uneven and/or unpredictable participation rates, it may prove too costly in terms of computational and operations personele resources.
But for deployments which expect exceptionally high, uneven and/or unpredictable participation rates, it may prove too costly in terms of computational and operations personnel resources.

#### Docker Compose over Docker Swarm

Expand Down
2 changes: 1 addition & 1 deletion math/doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The ones you're most frequently to need to tweak for one reason or another:
Conversations which have had vote or moderation activity in the specified range will be loaded into memory, and will be updated.
This prevents old inactive conversations from being loaded into memory every time the poller starts.

You'll also need to pass database credentials. If using docker compose, this will be inheritted from the `.env` file or process environment in which docker is being run.
You'll also need to pass database credentials. If using docker compose, this will be inherited from the `.env` file or process environment in which docker is being run.

`DATABASE_URL`: url for the database:

Expand Down
2 changes: 1 addition & 1 deletion server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ flavors of node.
the default behavior if you run `docker compose -f docker-compose.yml -f docker-compose.dev.yml up postgres` from the
root folder of the polis project. To run everything but the API server in this fashion you can use
`docker compose -f docker-compose.yml -f docker-compose.dev.yml up math postgres file-server maildev`. In this case
the polis-dev database should be accesssable at the default DATABASE_URL seen in server/example.env.
the polis-dev database should be accessible at the default DATABASE_URL seen in server/example.env.

3\. Connect to the new database then run the migrations in its shell. You can skip this step if you built the
database with docker compose.
Expand Down

0 comments on commit 6b2d315

Please sign in to comment.