Skip to content

Commit b962f39

Browse files
authored
Merge pull request #3 from versioner-io/safer_skip_and_proceed_options
Add fail_on_api_error parameter and remove redundant client-side poli…
2 parents 2df844c + f907a67 commit b962f39

15 files changed

Lines changed: 371 additions & 276 deletions

README.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ Check the **Actions** tab to see your deployment tracked!
8585
| `event_type` || `deployment` | Event type: `build` or `deployment` |
8686
| `status` || `success` | Event status (`success`, `failure`, `in_progress`) |
8787
| `metadata` || `{}` | Additional JSON metadata to attach to the event |
88-
| `fail_on_rejection` || `true` | Fail the workflow if Versioner rejects the deployment (e.g., conflicts, no-deploy windows) |
89-
| `skip_preflight_checks` || `false` | Skip preflight checks (use for emergency deployments only) |
88+
| `fail_on_api_error` || `true` | Fail the workflow if Versioner API has connectivity or authentication errors. Preflight check rejections (409, 423, 428) always fail regardless of this setting. |
9089

9190
\* Required unless provided via `VERSIONER_API_KEY` environment variable
9291

@@ -127,21 +126,20 @@ Preflight checks run automatically by default:
127126
128127
### Skip Checks (Emergency Only)
129128
130-
For emergency hotfixes, you can skip preflight checks:
129+
For emergency hotfixes, admins can temporarily disable or set rules to "Report Only" mode in the Versioner UI. This provides centralized control without requiring code changes:
131130
132-
```yaml
133-
- name: Emergency hotfix deployment
134-
uses: versioner-io/versioner-github-action@v1
135-
with:
136-
api_key: ${{ secrets.VERSIONER_API_KEY }}
137-
product_name: my-service
138-
version: ${{ github.sha }}
139-
environment: production
140-
status: started
141-
skip_preflight_checks: true # ⚠️ Use sparingly!
142-
```
131+
1. Log into Versioner UI
132+
2. Navigate to Deployment Rules
133+
3. Change rule status from "Enabled" to "Report Only" or "Disabled"
134+
4. Deploy normally - rules won't block
135+
5. After emergency, flip rules back to "Enabled"
143136
144-
**⚠️ Warning:** Skipping checks bypasses all deployment policies. Use only for genuine emergencies.
137+
**Benefits of server-side control:**
138+
- No code changes required
139+
- Instant effect across all deployments
140+
- Granular control (disable specific rules, not all)
141+
- Auditable (status changes tracked)
142+
- Easy to reverse
145143
146144
### Error Messages
147145
@@ -155,9 +153,6 @@ Rule: Production Freeze - Friday Afternoons
155153
Deployment blocked by no-deploy window
156154

157155
Retry after: 2025-11-21T18:00:00-08:00
158-
159-
To skip checks (emergency only), add to your workflow:
160-
skip-preflight-checks: true
161156
```
162157
163158
**Flow Violation (428):**
@@ -182,9 +177,6 @@ Version must soak in staging for at least 24 hours
182177
Retry after: 2025-11-22T10:00:00Z
183178
184179
Wait for soak time to complete, then retry.
185-
186-
To skip checks (emergency only), add to your workflow:
187-
skip-preflight-checks: true
188180
```
189181

190182
## 🔧 Usage Examples
@@ -312,9 +304,9 @@ jobs:
312304
status: ${{ steps.deploy.outcome }}
313305
```
314306
315-
### Enforce Deployment Policies
307+
### Best-Effort Observability
316308
317-
Fail the workflow if Versioner rejects the deployment (e.g., no-deploy windows, concurrent deployments):
309+
Allow deployments to proceed even if Versioner API is unavailable:
318310
319311
```yaml
320312
- name: Deploy to production
@@ -323,9 +315,11 @@ Fail the workflow if Versioner rejects the deployment (e.g., no-deploy windows,
323315
api_key: ${{ secrets.VERSIONER_API_KEY }}
324316
version: ${{ github.sha }}
325317
environment: production
326-
fail_on_rejection: true # Fail if Versioner blocks deployment
318+
fail_on_api_error: false # Don't block deployment if Versioner is down
327319
```
328320
321+
**Note:** Preflight check rejections (409, 423, 428) always fail the workflow. Policy enforcement is controlled server-side via rule status (enabled, report_only, disabled) in the Versioner UI.
322+
329323
### Multi-Environment Deployment
330324
331325
```yaml

action.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,10 @@ inputs:
3838
description: 'Additional JSON metadata to attach to the event'
3939
required: false
4040
default: '{}'
41-
fail_on_rejection:
42-
description: 'Fail the workflow if Versioner rejects the deployment (e.g., conflicts, no-deploy windows)'
41+
fail_on_api_error:
42+
description: 'Fail the workflow if Versioner API has connectivity or authentication errors (does not affect preflight check rejections, which always fail)'
4343
required: false
4444
default: 'true'
45-
skip_preflight_checks:
46-
description: 'Skip preflight checks (use for emergency deployments only)'
47-
required: false
48-
default: 'false'
4945

5046
outputs:
5147
deployment_id:

dist/api-client.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { DeploymentEventPayload, DeploymentEventResponse, BuildEventPayload, Bui
22
/**
33
* Send deployment event to Versioner API
44
*/
5-
export declare function sendDeploymentEvent(apiUrl: string, apiKey: string, payload: DeploymentEventPayload, failOnRejection?: boolean): Promise<DeploymentEventResponse>;
5+
export declare function sendDeploymentEvent(apiUrl: string, apiKey: string, payload: DeploymentEventPayload, failOnApiError?: boolean): Promise<DeploymentEventResponse>;
66
/**
77
* Send build event to Versioner API
88
*/
9-
export declare function sendBuildEvent(apiUrl: string, apiKey: string, payload: BuildEventPayload, failOnRejection?: boolean): Promise<BuildEventResponse>;
9+
export declare function sendBuildEvent(apiUrl: string, apiKey: string, payload: BuildEventPayload, failOnApiError?: boolean): Promise<BuildEventResponse>;

dist/api-client.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)