Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/setup-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ runs:
cache-to: type=gha,mode=max,scope=farmbot-web

- name: Cache bundle
uses: actions/cache@v5
uses: actions/cache@v6
with:
path: docker_volumes/bundle_cache
key: bundle-${{ runner.os }}-${{ hashFiles('Gemfile.lock') }}

- name: Cache node modules
uses: actions/cache@v5
uses: actions/cache@v6
with:
path: node_modules
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
Expand Down
86 changes: 76 additions & 10 deletions .github/workflows/render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Set render env
run: scripts/ci/export-render-env
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
sudo docker compose up -d
sudo docker compose ps

- name: Install playwright
- name: Install Playwright tooling
run: |
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
Expand All @@ -61,7 +61,73 @@ jobs:
echo "BUN_INSTALL=$BUN_INSTALL" >> "$GITHUB_ENV"
echo "$BUN_INSTALL/bin" >> "$GITHUB_PATH"
echo "PLAYWRIGHT_BROWSERS_PATH=$PLAYWRIGHT_BROWSERS_PATH" >> "$GITHUB_ENV"
bun run playwright install chromium --with-deps

- name: Set Playwright apt cache key
id: playwright_apt_cache_key
run: |
. /etc/os-release
echo "platform=${ID}-${VERSION_ID}-${{ runner.arch }}" >> "$GITHUB_OUTPUT"
echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT"

- name: Restore Playwright apt downloads
id: playwright_apt_cache
uses: actions/cache/restore@v6
with:
path: .cache/playwright-apt
key: playwright-apt-${{ steps.playwright_apt_cache_key.outputs.platform }}-${{ hashFiles('bun.lock') }}-${{ steps.playwright_apt_cache_key.outputs.week }}
restore-keys: |
playwright-apt-${{ steps.playwright_apt_cache_key.outputs.platform }}-${{ hashFiles('bun.lock') }}-
playwright-apt-${{ steps.playwright_apt_cache_key.outputs.platform }}-

- name: Configure Playwright apt download cache
run: |
sudo install -d -m 755 "$GITHUB_WORKSPACE/.cache/playwright-apt"
sudo install -d -o _apt -g root -m 700 "$GITHUB_WORKSPACE/.cache/playwright-apt/partial"
sudo tee /etc/apt/apt.conf.d/99-playwright-ci-cache >/dev/null <<EOF
Dir::Cache::archives "$GITHUB_WORKSPACE/.cache/playwright-apt";
Binary::apt::APT::Keep-Downloaded-Packages "true";
Binary::apt-get::APT::Keep-Downloaded-Packages "true";
APT::Update::Post-Invoke-Success {
"install -d -o _apt -g root -m 700 $GITHUB_WORKSPACE/.cache/playwright-apt/partial";
};
EOF

- name: Install cached Playwright system dependencies
run: |
shopt -s nullglob
packages=("$GITHUB_WORKSPACE/.cache/playwright-apt/"*.deb)
if [ "${#packages[@]}" -gt 0 ]; then
sudo apt-get install -y --no-install-recommends "${packages[@]}"
fi

- name: Install missing Playwright system dependencies
run: |
if ! bun run playwright install-deps chromium --dry-run; then
bun run playwright install-deps chromium
fi

- name: Prepare Playwright apt cache
id: prepare_playwright_apt_cache
run: |
sudo chmod -R a+rX "$GITHUB_WORKSPACE/.cache/playwright-apt"
du -sh "$GITHUB_WORKSPACE/.cache/playwright-apt"
shopt -s nullglob
packages=("$GITHUB_WORKSPACE/.cache/playwright-apt/"*.deb)
if [ "${#packages[@]}" -gt 0 ]; then
echo "has_packages=true" >> "$GITHUB_OUTPUT"
else
echo "has_packages=false" >> "$GITHUB_OUTPUT"
fi

- name: Save Playwright apt downloads
if: steps.playwright_apt_cache.outputs.cache-hit != 'true' && steps.prepare_playwright_apt_cache.outputs.has_packages == 'true'
uses: actions/cache/save@v6
with:
path: .cache/playwright-apt
key: playwright-apt-${{ steps.playwright_apt_cache_key.outputs.platform }}-${{ hashFiles('bun.lock') }}-${{ steps.playwright_apt_cache_key.outputs.week }}

- name: Install Playwright Chromium
run: bun run playwright install chromium

- name: Set up GPU
run: |
Expand Down Expand Up @@ -96,7 +162,7 @@ jobs:
exit 1

- name: Restore branch metric history cache
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: |
/tmp/${{ env.SCENE_METRICS_NAME }}*.csv
Expand All @@ -118,7 +184,7 @@ jobs:

- name: Restore staging metric history cache fallback
if: steps.restore_metric_history.outputs.scene_metrics_found != 'true'
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: |
/tmp/${{ env.SCENE_METRICS_NAME }}*.csv
Expand All @@ -127,7 +193,7 @@ jobs:
${{ env.STAGING_FPS_METRICS_CACHE_KEY }}-

- name: Restore branch FPS history cache
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: /tmp/${{ env.FPS_HISTORY }}.csv
key: ${{ env.FPS_HISTORY_CACHE_KEY }}-${{ env.CACHE_BASELINE_SHA }}-${{ env.CACHE_KEY_SUFFIX }}
Expand All @@ -148,7 +214,7 @@ jobs:

- name: Restore staging FPS history cache fallback
if: steps.restore_fps_history.outputs.fps_history_found != 'true'
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: /tmp/${{ env.FPS_HISTORY }}.csv
key: ${{ env.STAGING_FPS_HISTORY_CACHE_KEY }}-${{ env.CACHE_KEY_SUFFIX }}
Expand All @@ -157,7 +223,7 @@ jobs:

- name: Restore frontend coverage value
if: always()
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: /tmp/${{ env.FE_COVERAGE_NAME }}.csv
key: ${{ env.FE_COVERAGE_CACHE_KEY }}-${{ env.CACHE_KEY_SUFFIX }}
Expand Down Expand Up @@ -191,14 +257,14 @@ jobs:
bun scripts/ci/combine-render-images

- name: Save FPS metrics
uses: actions/cache/save@v5
uses: actions/cache/save@v6
with:
path: |
/tmp/${{ env.SCENE_METRICS_NAME }}*.csv
key: ${{ env.FPS_METRICS_CACHE_KEY }}-${{ env.CACHE_BASELINE_SHA }}-${{ env.CACHE_KEY_SUFFIX }}

- name: Save FPS history
uses: actions/cache/save@v5
uses: actions/cache/save@v6
with:
path: /tmp/${{ env.FPS_HISTORY }}.csv
key: ${{ env.FPS_HISTORY_CACHE_KEY }}-${{ env.CACHE_BASELINE_SHA }}-${{ env.CACHE_KEY_SUFFIX }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 100

Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

- name: Upload app coverage to Codecov
if: ${{ hashFiles('coverage_api/coverage.xml') != '' }}
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage_api/coverage.xml
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:

- name: Restore frontend coverage cache fallback
if: ${{ always() && steps.restore_fe_coverage_history.outputs.fe_coverage_found != 'true' }}
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: /tmp/${{ env.FE_COVERAGE_NAME }}.csv
key: ${{ env.FE_COVERAGE_CACHE_KEY }}-${{ env.CACHE_KEY_SUFFIX }}
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:

- name: Save frontend coverage value
if: ${{ always() && env.COVERAGE_AVAILABLE == 'true' }}
uses: actions/cache/save@v5
uses: actions/cache/save@v6
with:
path: /tmp/${{ env.FE_COVERAGE_NAME }}.csv
key: ${{ env.FE_COVERAGE_CACHE_KEY }}-${{ env.CACHE_KEY_SUFFIX }}
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ config/credentials.yml.enc
coverage_api
coverage_fe
coverage_jest_file
.jest-file-coverage.*
docker_volumes
erd_diagram.png
erd.pdf
Expand All @@ -33,5 +34,6 @@ upgrade_deps.sh
# ActiveStorage blobs:
storage/*
tmp
module_graph.*
scripts/graphs/*.svg
scripts/graphs/*.dot
scripts/ci/__pycache__
33 changes: 26 additions & 7 deletions .madgerc
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
{
"excludeRegExp": [
"^(?!.*three_d_garden)",
"[/\\\\]components\\.tsx$",
"[/\\\\]config\\.ts$",
"[/\\\\]helpers\\.ts$",
"[/\\\\]constants\\.ts$",
"[/\\\\]__tests__[/\\\\]"
"(^|[/\\\\])i18next_wrapper\\.tsx$",
"(^|[/\\\\])components\\.tsx$",
"(^|[/\\\\])config\\.ts$",
"(^|[/\\\\])helpers\\.ts$",
"(^|[/\\\\])constants\\.ts$",
"(^|[/\\\\])interfaces\\.ts$",
"/util/index.ts",
"internal_urls.ts",
"api/crud.ts",
"toast/toast.ts",
"redux/store.ts",
"resources/selectors.ts",
"session_keys.ts",
"farm_designer/map/util.ts",
"performance/perf.ts",
"config_storage/actions.ts",
"devices/actions.ts",
"link.tsx",
"error_boundary.tsx",
"(^|[/\\\\])__tests__[/\\\\]",
"(^|[/\\\\])__test_support__[/\\\\]",
"(^|[/\\\\])crops[/\\\\]",
"(^|[/\\\\])ui[/\\\\]"
],
"fileExtensions": [
"ts",
"tsx"
]
],
"tsConfig": "./tsconfig.json",
"layout": "sfdp"
}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ gem "pg"
gem "rabbitmq_http_api_client"
gem "rack-attack"
gem "rack-cors"
gem "redis", "~> 4.0"
gem "redis"
gem "request_store"
gem "rollbar"
gem "scenic"
Expand Down
20 changes: 12 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ GEM
brakeman (8.0.6)
racc
builder (3.3.0)
bunny (3.1.0)
amq-protocol (~> 2.7)
bunny (3.2.0)
amq-protocol (~> 2.8)
logger (~> 1, >= 1.7)
sorted_set (~> 1, >= 1.0.2)
case_transform (0.2)
Expand Down Expand Up @@ -279,7 +279,7 @@ GEM
parser (3.3.12.0)
ast (~> 2.4.1)
racc
passenger (6.1.8)
passenger (6.2.0)
logger (>= 1.7.0)
rack (>= 1.6.13)
rackup (>= 1.0.1)
Expand Down Expand Up @@ -365,7 +365,10 @@ GEM
prism (>= 1.6.0)
rbs (>= 4.0.0)
tsort
redis (4.8.1)
redis (6.0.0)
redis-client (= 0.30.1)
redis-client (0.30.1)
connection_pool
regexp_parser (2.12.0)
reline (0.7.0)
io-console (~> 0.5)
Expand Down Expand Up @@ -514,7 +517,7 @@ DEPENDENCIES
rack-attack
rack-cors
rails
redis (~> 4.0)
redis
request_store
rollbar
rspec
Expand Down Expand Up @@ -556,7 +559,7 @@ CHECKSUMS
brakeman (8.0.6) sha256=759cc69341115e6c2dcd47b6fd8649a0b9bd540e3585ac8a0a94e31c66fee386
builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
bundler (4.0.17) sha256=214e21431b5665dd2f99df8a5511c6b151d7a72e8015c8b38f8b775b61cbb6c1
bunny (3.1.0) sha256=fd09ea8be3fbb7fe4b1063f874094b444f762f2da1692b3341751af7c6d62f3c
bunny (3.2.0) sha256=b568e3cd6510feb9a12a07818c1d1d412dfc47eddf8b29d401288ecd52f288f1
case_transform (0.2) sha256=e2ad4418dceeb227cf474cc332cd5004c95c136c04186c1cceaad8ab8de6fe3b
cgi (0.5.2) sha256=61ca30298171190fd4fa0d8018e57ada456eae9b7a2b78526debf7f0a0e6f8bb
climate_control (1.2.0) sha256=36b21896193fa8c8536fa1cd843a07cf8ddbd03aaba43665e26c53ec1bd70aa5
Expand Down Expand Up @@ -641,7 +644,7 @@ CHECKSUMS
ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356
parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
passenger (6.1.8) sha256=01e9b5173048aceb1dcfaeea92bbc7f90ef045ca4240fe98ed2bcddbb6a67a1f
passenger (6.2.0) sha256=2b0497c097d12d1483f4d46008cb9e1268df09f56b36e941a93ab88ec2f1e11c
pg (1.6.3) sha256=1388d0563e13d2758c1089e35e973a3249e955c659592d10e5b77c468f628a99
pg (1.6.3-aarch64-linux) sha256=0698ad563e02383c27510b76bf7d4cd2de19cd1d16a5013f375dd473e4be72ea
pg (1.6.3-aarch64-linux-musl) sha256=06a75f4ea04b05140146f2a10550b8e0d9f006a79cdaf8b5b130cde40e3ecc2c
Expand Down Expand Up @@ -673,7 +676,8 @@ CHECKSUMS
rbs (4.1.3) sha256=0c4474a9751cdc14364bfad0b3e53678323bbdc2c31683b0445932867dbab8c4
rbtree (0.4.7) sha256=1efabbcb3fd5f12249c9c8a610a765074868164eed0c50c9db2531c00ed161cb
rdoc (8.0.0) sha256=03bf8c08a9639658855a0cfd77c0abca8325c227693f7f33f82957811348c469
redis (4.8.1) sha256=387ee086694fffc9632aaeb1efe4a7b1627ca783bf373320346a8a20cd93333a
redis (6.0.0) sha256=de71c10edd106986b759ec7ecdd08b63b9c0ee7414a0d0c1da73d31ba2bccda6
redis-client (0.30.1) sha256=5151bc5c7bbfe48623732cdae3b900d8a22dc691cc7cdfacfb351ac55116522d
regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
reline (0.7.0) sha256=5b012d8e55dbf9d450f12bde2cf7d15ff546ae80b3f8f3b30e570d431815583d
representable (3.2.0) sha256=cc29bf7eebc31653586849371a43ffe36c60b54b0a6365b5f7d95ec34d1ebace
Expand Down
Loading