Skip to content

Commit 464a9d1

Browse files
authored
feat: Add dynamic provider loader with improved error handling (#734)
* feat: Add dynamic provider loader with improved error handling - Create provider-loader.ts with function-based dynamic import functionality - Update CloudRunner.setupSelectedBuildPlatform to use dynamic loader for unknown providers - Add comprehensive error handling for missing packages and interface validation - Include test coverage for successful loading and error scenarios - Maintain backward compatibility with existing built-in providers - Add ProviderLoader class wrapper for backward compatibility - Support both built-in providers (via switch) and external providers (via dynamic import) * fix: Resolve linting errors in provider loader - Fix TypeError usage instead of Error for type checking - Add missing blank lines for proper code formatting - Fix comment spacing issues * build: Update built artifacts after linting fixes - Rebuild dist/ with latest changes - Include updated provider loader in built bundle - Ensure all changes are reflected in compiled output * build: Update built artifacts after linting fixes - Rebuild dist/ with latest changes - Include updated provider loader in built bundle - Ensure all changes are reflected in compiled output * build: Update built artifacts after linting fixes - Rebuild dist/ with latest changes - Include updated provider loader in built bundle - Ensure all changes are reflected in compiled output * build: Update built artifacts after linting fixes - Rebuild dist/ with latest changes - Include updated provider loader in built bundle - Ensure all changes are reflected in compiled output * fix: Fix AWS job dependencies and remove duplicate localstack tests - Update AWS job to depend on both k8s and localstack jobs - Remove duplicate localstack tests from k8s job (now only runs k8s tests) - Remove unused cloud-runner-localstack job from main integrity check - Fix AWS SDK warnings by using Uint8Array(0) instead of empty string for S3 PutObject - Rename localstack-and-k8s job to k8s job for clarity * feat: Implement provider loader dynamic imports with GitHub URL support - Add URL detection and parsing utilities for GitHub URLs, local paths, and NPM packages - Implement git operations for cloning and updating repositories with local caching - Add automatic update checking mechanism for GitHub repositories - Update provider-loader.ts to support multiple source types with comprehensive error handling - Add comprehensive test coverage for all new functionality - Include complete documentation with usage examples - Support GitHub URLs: https://github.com/user/repo, user/repo@branch - Support local paths: ./path, /absolute/path - Support NPM packages: package-name, @scope/package - Maintain backward compatibility with existing providers - Add fallback mechanisms and interface validation * feat: Implement provider loader dynamic imports with GitHub URL support - Add URL detection and parsing utilities for GitHub URLs, local paths, and NPM packages - Implement git operations for cloning and updating repositories with local caching - Add automatic update checking mechanism for GitHub repositories - Update provider-loader.ts to support multiple source types with comprehensive error handling - Add comprehensive test coverage for all new functionality - Include complete documentation with usage examples - Support GitHub URLs: https://github.com/user/repo, user/repo@branch - Support local paths: ./path, /absolute/path - Support NPM packages: package-name, @scope/package - Maintain backward compatibility with existing providers - Add fallback mechanisms and interface validation * feat: Fix provider-loader tests and URL parser consistency - Fixed provider-loader test failures (constructor validation, module imports) - Fixed provider-url-parser to return consistent base URLs for GitHub sources - Updated error handling to use TypeError consistently - All provider-loader and provider-url-parser tests now pass - Fixed prettier and eslint formatting issues * feat: Implement provider loader dynamic imports with GitHub URL support - Add URL detection and parsing utilities for GitHub URLs, local paths, and NPM packages - Implement git operations for cloning and updating repositories with local caching - Add automatic update checking mechanism for GitHub repositories - Update provider-loader.ts to support multiple source types with comprehensive error handling - Add comprehensive test coverage for all new functionality - Include complete documentation with usage examples - Support GitHub URLs: https://github.com/user/repo, user/repo@branch - Support local paths: ./path, /absolute/path - Support NPM packages: package-name, @scope/package - Maintain backward compatibility with existing providers - Add fallback mechanisms and interface validation * feat: Implement provider loader dynamic imports with GitHub URL support - Add URL detection and parsing utilities for GitHub URLs, local paths, and NPM packages - Implement git operations for cloning and updating repositories with local caching - Add automatic update checking mechanism for GitHub repositories - Update provider-loader.ts to support multiple source types with comprehensive error handling - Add comprehensive test coverage for all new functionality - Include complete documentation with usage examples - Support GitHub URLs: https://github.com/user/repo, user/repo@branch - Support local paths: ./path, /absolute/path - Support NPM packages: package-name, @scope/package - Maintain backward compatibility with existing providers - Add fallback mechanisms and interface validation * m * m
1 parent d6cc453 commit 464a9d1

File tree

16 files changed

+1914
-41
lines changed

16 files changed

+1914
-41
lines changed

.cursor/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"files.autoSave": "on",
3+
"files.autoSaveWhen": "on",
4+
"files.autoSaveDelay": 1000,
5+
6+
"editor.formatOnSave": false,
7+
"editor.formatOnPaste": false,
8+
"editor.formatOnType": false,
9+
10+
"editor.codeActionsOnSave": {},
11+
12+
"git.autorefresh": false,
13+
"git.confirmSync": false,
14+
"git.autofetch": false,
15+
16+
"editor.defaultFormatter": null
17+
}
18+

.github/workflows/cloud-runner-integrity.yml

Lines changed: 54 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,13 @@ env:
2828
USE_IL2CPP: false
2929

3030
jobs:
31-
localstack-and-k8s:
32-
name: Cloud Runner Tests (LocalStack + K8s)
31+
k8s:
32+
name: Cloud Runner Tests (K8s)
3333
runs-on: ubuntu-latest
3434
strategy:
3535
fail-fast: false
3636
matrix:
3737
include:
38-
# Local Docker runs (fast path without cluster)
39-
- test: 'cloud-runner-end2end-locking'
40-
provider: local-docker
41-
- test: 'cloud-runner-end2end-caching'
42-
provider: local-docker
43-
- test: 'cloud-runner-end2end-retaining'
44-
provider: local-docker
45-
- test: 'cloud-runner-caching'
46-
provider: local-docker
47-
- test: 'cloud-runner-environment'
48-
provider: local-docker
49-
- test: 'cloud-runner-image'
50-
provider: local-docker
51-
- test: 'cloud-runner-hooks'
52-
provider: local-docker
53-
- test: 'cloud-runner-local-persistence'
54-
provider: local-docker
55-
- test: 'cloud-runner-locking-core'
56-
provider: local-docker
57-
- test: 'cloud-runner-locking-get-locked'
58-
provider: local-docker
5938
# K8s runs (k3s)
6039
- test: 'cloud-runner-end2end-caching'
6140
provider: k8s
@@ -91,7 +70,6 @@ jobs:
9170
- name: Start LocalStack (S3)
9271
uses: localstack/[email protected]
9372
with:
94-
services: s3
9573
install-awslocal: true
9674
- name: Create S3 bucket for tests (host LocalStack)
9775
run: |
@@ -124,10 +102,61 @@ jobs:
124102
AWS_EC2_METADATA_DISABLED: 'true'
125103
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
126104
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
105+
localstack:
106+
name: Cloud Runner Tests (LocalStack)
107+
runs-on: ubuntu-latest
108+
services:
109+
localstack:
110+
image: localstack/localstack
111+
ports:
112+
- 4566:4566
113+
env:
114+
SERVICES: cloudformation,ecs,kinesis,cloudwatch,s3,logs
115+
strategy:
116+
fail-fast: false
117+
matrix:
118+
test:
119+
- 'cloud-runner-end2end-locking'
120+
- 'cloud-runner-end2end-caching'
121+
- 'cloud-runner-end2end-retaining'
122+
- 'cloud-runner-caching'
123+
- 'cloud-runner-environment'
124+
- 'cloud-runner-image'
125+
- 'cloud-runner-hooks'
126+
- 'cloud-runner-local-persistence'
127+
- 'cloud-runner-locking-core'
128+
- 'cloud-runner-locking-get-locked'
129+
steps:
130+
- uses: actions/checkout@v4
131+
with:
132+
lfs: false
133+
- uses: actions/setup-node@v4
134+
with:
135+
node-version: 20
136+
cache: 'yarn'
137+
- run: yarn install --frozen-lockfile
138+
- run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand
139+
timeout-minutes: 60
140+
env:
141+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
142+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
143+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
144+
PROJECT_PATH: test-project
145+
TARGET_PLATFORM: StandaloneWindows64
146+
cloudRunnerTests: true
147+
versioning: None
148+
KUBE_STORAGE_CLASS: local-path
149+
PROVIDER_STRATEGY: aws
150+
AWS_ACCESS_KEY_ID: test
151+
AWS_SECRET_ACCESS_KEY: test
152+
AWS_ENDPOINT: http://localhost:4566
153+
AWS_ENDPOINT_URL: http://localhost:4566
154+
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
155+
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
127156
aws:
128157
name: Cloud Runner Tests (AWS)
129158
runs-on: ubuntu-latest
130-
needs: [localstack-and-k8s]
159+
needs: [k8s, localstack]
131160
strategy:
132161
fail-fast: false
133162
matrix:

.github/workflows/integrity-check.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,3 @@ jobs:
3232
uses: ./.github/workflows/cloud-runner-integrity.yml
3333
secrets: inherit
3434

35-
cloud-runner-localstack:
36-
name: Cloud Runner Integrity (LocalStack)
37-
uses: ./.github/workflows/cloud-runner-integrity-localstack.yml
38-
secrets: inherit

0 commit comments

Comments
 (0)