Skip to content

Commit 33fb956

Browse files
committed
[FEATURE] set up tests to validate imports work for all app
1 parent 752939a commit 33fb956

File tree

9 files changed

+1165
-9
lines changed

9 files changed

+1165
-9
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Create Package Validation Issue Action
2+
3+
This GitHub Action creates or updates issues when package validation failures are detected in the Pipedream repository.
4+
5+
## Features
6+
7+
-**Smart Issue Management**: Creates new issues or updates existing ones for the same day
8+
- 📊 **Rich Reporting**: Includes detailed summaries, failure categories, and quick action commands
9+
- 🔄 **Fallback Support**: Works with both JSON and text validation reports
10+
- 🏷️ **Auto-labeling**: Automatically applies appropriate labels for organization
11+
- 📈 **Failure Analysis**: Groups failures by category for easier debugging
12+
13+
## Inputs
14+
15+
| Input | Description | Required | Default |
16+
|-------|-------------|----------|---------|
17+
| `github-token` | GitHub token for API access || - |
18+
| `validation-report-json` | Path to JSON validation report || `validation-report.json` |
19+
| `validation-report-txt` | Path to text validation report || `validation-report.txt` |
20+
| `workflow-run-number` | GitHub workflow run number || - |
21+
| `workflow-run-id` | GitHub workflow run ID || - |
22+
| `server-url` | GitHub server URL || - |
23+
| `repository` | Repository name (owner/repo) || - |
24+
25+
## Outputs
26+
27+
| Output | Description | Example |
28+
|--------|-------------|---------|
29+
| `issue-created` | Whether a new issue was created | `true`/`false` |
30+
| `issue-updated` | Whether an existing issue was updated | `true`/`false` |
31+
| `issue-url` | URL of the created/updated issue | `https://github.com/...` |
32+
| `failed-count` | Number of failed packages | `42` |
33+
34+
## Usage
35+
36+
```yaml
37+
- name: Create Issue on Failures
38+
uses: ./.github/actions/create-package-validation-issue
39+
with:
40+
github-token: ${{ secrets.GITHUB_TOKEN }}
41+
validation-report-json: 'validation-report.json'
42+
workflow-run-number: ${{ github.run_number }}
43+
workflow-run-id: ${{ github.run_id }}
44+
server-url: ${{ github.server_url }}
45+
repository: ${{ github.repository }}
46+
```
47+
48+
## Issue Format
49+
50+
The action creates issues with:
51+
52+
### 📦 Title Format
53+
```
54+
📦 Package Validation Report - [Date] - [X] failures
55+
```
56+
57+
### 📋 Content Sections
58+
1. **Summary**: Overview statistics of validation results
59+
2. **Links**: Direct links to workflow run and artifacts
60+
3. **Failed Packages**: List of top failing packages with error types
61+
4. **Failure Categories**: Grouped failures by validation type
62+
5. **Next Steps**: Action items for developers
63+
6. **Quick Commands**: Copy-paste commands for local testing
64+
65+
### 🏷️ Auto-applied Labels
66+
- `package-validation`: Identifies validation-related issues
67+
- `automated`: Marks as automatically created
68+
- `bug`: Indicates packages needing fixes
69+
70+
## Behavior
71+
72+
### New Issues
73+
- Creates a new issue if no open validation issue exists for the current date
74+
- Applies appropriate labels automatically
75+
76+
### Existing Issues
77+
- Updates existing issues with new validation results as comments
78+
- Avoids creating duplicate issues for the same day
79+
- Maintains issue history through comments
80+
81+
### No Failures
82+
- Skips issue creation when no validation failures are detected
83+
- Sets output flags appropriately for workflow logic
84+
85+
## Error Handling
86+
87+
- **JSON Parse Errors**: Falls back to text report parsing
88+
- **Missing Files**: Gracefully handles missing report files
89+
- **API Failures**: Provides detailed error messages for debugging
90+
- **Network Issues**: Fails gracefully with actionable error messages
91+
92+
## Development
93+
94+
### Local Testing
95+
```bash
96+
# Install dependencies
97+
cd .github/actions/create-package-validation-issue
98+
npm install
99+
100+
# Test with sample data
101+
node src/index.js
102+
```
103+
104+
### Dependencies
105+
- `@actions/core`: GitHub Actions toolkit for inputs/outputs
106+
- `@actions/github`: GitHub API client and context
107+
108+
## Integration
109+
110+
This action is designed to work with:
111+
- `scripts/generate-package-report.js`: Validation report generator
112+
- `.github/workflows/daily-package-validation.yaml`: Daily validation workflow
113+
- Pipedream component validation pipeline
114+
115+
## Example Issue Output
116+
117+
```markdown
118+
# 📦 Daily Package Validation Report - Mon Jan 15 2024
119+
120+
📊 **Summary:**
121+
- Total Components: 2932
122+
- ✅ Validated: 2847
123+
- ❌ Failed: 85
124+
- ⏭️ Skipped: 1250
125+
- 📈 Publishable: 2932
126+
- 📉 Failure Rate: 2.90%
127+
128+
## 🔗 Links
129+
- **Workflow Run**: [#123](https://github.com/org/repo/actions/runs/456)
130+
- **Download Reports**: Check the workflow artifacts for detailed reports
131+
132+
## ❌ Failed Packages
133+
- **@pipedream/netlify** (netlify): import, dependencies
134+
- **@pipedream/google-slides** (google_slides): mainFile
135+
- ... and 83 more packages
136+
137+
## Next Steps
138+
1. Review the failed packages listed above
139+
2. Check the full validation report artifact
140+
3. Fix import/dependency issues in failing packages
141+
...
142+
```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Create Package Validation Issue'
2+
description: 'Creates or updates GitHub issues when package validation failures are detected'
3+
inputs:
4+
github-token:
5+
description: 'GitHub token for creating issues'
6+
required: true
7+
validation-report-json:
8+
description: 'Path to the JSON validation report file'
9+
required: true
10+
default: 'validation-report.json'
11+
validation-report-txt:
12+
description: 'Path to the text validation report file'
13+
required: false
14+
default: 'validation-report.txt'
15+
workflow-run-number:
16+
description: 'GitHub workflow run number'
17+
required: true
18+
workflow-run-id:
19+
description: 'GitHub workflow run ID'
20+
required: true
21+
server-url:
22+
description: 'GitHub server URL'
23+
required: true
24+
repository:
25+
description: 'Repository name in owner/repo format'
26+
required: true
27+
28+
runs:
29+
using: 'node20'
30+
main: 'src/index.js'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "create-package-validation-issue",
3+
"version": "1.0.0",
4+
"description": "GitHub Action to create or update issues for package validation failures",
5+
"main": "src/index.js",
6+
"scripts": {
7+
"test": "echo \"No tests yet\" && exit 0"
8+
},
9+
"dependencies": {
10+
"@actions/core": "^1.10.1",
11+
"@actions/github": "^6.0.0"
12+
},
13+
"keywords": [
14+
"github-action",
15+
"pipedream",
16+
"package-validation",
17+
"issues"
18+
],
19+
"author": "Pipedream",
20+
"license": "MIT"
21+
}

0 commit comments

Comments
 (0)