Skip to content
Open
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
64 changes: 53 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,67 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
unit-tests:
name: Run unit tests with mock API
runs-on: ubuntu-latest
services:
mock-api:
image: ghcr.io/quantcdn/quant-mock-api:4.0.0
ports:
- 4010:4010
options: >-
--health-cmd "nc -z 127.0.0.1 4010"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Run unit tests
run: npm test

- name: Sync environment data
gha-action-test:
name: Test GitHub Action with mock API
runs-on: ubuntu-latest
services:
mock-api:
image: ghcr.io/quantcdn/quant-mock-api:4.0.0
ports:
- 4010:4010
options: >-
--health-cmd "nc -z 127.0.0.1 4010"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Test action with mock API
uses: ./
id: sync-environment
with:
api_key: ${{ secrets.QUANT_API_KEY }}
environment_name: ${{ inputs.environment_name || 'staging' }}
source: ${{ inputs.source || 'production' }}
app_name: 'actions'
organization: ${{ secrets.QUANT_ORGANIZATION }}
type: ${{ inputs.type || 'filesystem' }}
base_url: ${{ secrets.QUANT_BASE_URL }}

api_key: test-api-key
environment_name: test-target
source: test-source
app_name: test-app
organization: test-org
type: database
base_url: http://localhost:4010
# Mock API cannot handle the wait function.
# wait: true
# max_retries: 3
# wait_interval: 2
- name: Debug Outputs
run: |
echo "Sync Success: ${{ steps.sync-environment.outputs.success }}"
echo "Sync Success: ${{ steps.sync-environment.outputs.success }}"
echo "Sync ID: ${{ steps.sync-environment.outputs.sync_id }}"
23 changes: 23 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Changelog

## [2.0.0] - 2025-10-19

### Added
- Automatic API version normalisation (v2/v3 URLs automatically converted to new API format)
- Wait functionality with configurable retry intervals and maximum retries
- Comprehensive error handling and logging

### Changed
- Uses @quantcdn/quant-client v4.0.0 for improved API compatibility
- No longer requires explicit v3 API endpoints - automatically handles legacy URL formats

### Technical Details
- Migrated from legacy v2/v3 API endpoints to unified API structure
- Backward compatible with existing workflows using v2/v3 base URLs
- Enhanced error reporting with detailed API error messages

## [1.0.0] - 2025-05-29

### Added
- Initial release of Quant Cloud Environment Sync Action
- Support for syncing database and filesystem data between environments
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Sync data between existing environments in Quant Cloud. This action requires bot
## Usage

```yaml
- uses: quantcdn/quant-cloud-environment-action@v1
- uses: quantcdn/quant-cloud-environment-action@v2
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: your-org-id
Expand All @@ -16,7 +16,7 @@ Sync data between existing environments in Quant Cloud. This action requires bot
wait: true # Wait for sync to complete
wait_interval: 10 # Check every 10 seconds
max_retries: 30 # Timeout after 30 retries (5 minutes)
base_url: https://dashboard.quantcdn.io/api/v3 # Optional
base_url: https://dashboard.quantcdn.io # Optional
```

## Inputs
Expand All @@ -30,7 +30,7 @@ Sync data between existing environments in Quant Cloud. This action requires bot
* `wait`: Whether to wait for the sync to complete (optional, default: 'false')
* `wait_interval`: Interval in seconds between status checks (optional, default: '10')
* `max_retries`: Maximum number of retries before timing out (optional, default: '30')
* `base_url`: Quant Cloud API URL (optional, default: 'https://dashboard.quantcdn.io/api/v3')
* `base_url`: Quant Cloud API URL (optional, default: 'https://dashboard.quantcdn.io')

## Outputs

Expand Down
Loading