Skip to content

Commit db8ed39

Browse files
Merge branch 'master' into confluence-cursor-link
2 parents dfb6323 + 24202ef commit db8ed39

File tree

286 files changed

+11305
-1640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+11305
-1640
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
*.log
3+
.DS_Store
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
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+
**Note**: All outputs are properly set for both regular and composite actions, supporting `core.setOutput()` and `$GITHUB_OUTPUT` file methods.
35+
36+
## Usage
37+
38+
```yaml
39+
- name: Create Issue on Failures
40+
if: steps.check_failures.outputs.failed_count != '0'
41+
uses: ./.github/actions/create-package-validation-issue
42+
with:
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
validation-report-json: 'validation-report.json'
45+
validation-report-txt: 'validation-report.txt' # optional
46+
workflow-run-number: ${{ github.run_number }}
47+
workflow-run-id: ${{ github.run_id }}
48+
server-url: ${{ github.server_url }}
49+
repository: ${{ github.repository }}
50+
```
51+
52+
## Issue Format
53+
54+
The action creates issues with:
55+
56+
### 📦 Title Format
57+
```
58+
📦 Package Validation Report - [Date] - [X] failures
59+
```
60+
61+
### 📋 Content Sections
62+
1. **Summary**: Overview statistics of validation results
63+
2. **Links**: Direct links to workflow run and artifacts
64+
3. **Failed Packages**: List of top failing packages with error types
65+
4. **Failure Categories**: Grouped failures by validation type
66+
5. **Next Steps**: Action items for developers
67+
6. **Quick Commands**: Copy-paste commands for local testing
68+
69+
### 🏷️ Auto-applied Labels
70+
- `package-validation`: Identifies validation-related issues
71+
- `automated`: Marks as automatically created
72+
- `bug`: Indicates packages needing fixes
73+
74+
## Behavior
75+
76+
### New Issues
77+
- Creates a new issue if no open validation issue exists for the current date
78+
- Applies appropriate labels automatically
79+
80+
### Existing Issues
81+
- Updates existing issues with new validation results as comments
82+
- Avoids creating duplicate issues for the same day
83+
- Maintains issue history through comments
84+
85+
### No Failures
86+
- Skips issue creation when no validation failures are detected
87+
- Sets output flags appropriately for workflow logic
88+
89+
## Error Handling
90+
91+
- **JSON Parse Errors**: Falls back to text report parsing
92+
- **Missing Files**: Gracefully handles missing report files
93+
- **API Failures**: Provides detailed error messages for debugging
94+
- **Network Issues**: Fails gracefully with actionable error messages
95+
96+
## Development
97+
98+
### Local Testing
99+
```bash
100+
# Install dependencies
101+
cd .github/actions/create-package-validation-issue
102+
npm install
103+
104+
# Test with sample data
105+
node test/test-action.js
106+
```
107+
108+
### Dependencies
109+
- `@actions/core`: GitHub Actions toolkit for inputs/outputs
110+
- `@actions/github`: GitHub API client and context
111+
112+
### Technical Notes
113+
- **Composite Action**: Uses `composite` action type to handle dependency installation automatically
114+
- **Auto-Install**: Dependencies are installed during action execution for reliability
115+
- **Path Resolution**: File paths are resolved relative to the GitHub workspace
116+
- **Fallback Support**: Gracefully handles missing files and parse errors
117+
118+
## Integration
119+
120+
This action is designed to work with:
121+
- `scripts/generate-package-report.js`: Validation report generator
122+
- `.github/workflows/scheduled-package-validation.yaml`: Scheduled validation workflow
123+
- Pipedream component validation pipeline
124+
125+
## Example Issue Output
126+
127+
```markdown
128+
# 📦 Scheduled Package Validation Report - Mon Jan 15 2024
129+
130+
📊 **Summary:**
131+
- Total Components: 2932
132+
- ✅ Validated: 2847
133+
- ❌ Failed: 85
134+
- ⏭️ Skipped: 1250
135+
- 📈 Publishable: 2932
136+
- 📉 Failure Rate: 2.90%
137+
138+
## 🔗 Links
139+
- **Workflow Run**: [#123](https://github.com/org/repo/actions/runs/456)
140+
- **Download Reports**: Check the workflow artifacts for detailed reports
141+
142+
## ❌ Failed Packages
143+
- **@pipedream/netlify** (netlify): import, dependencies
144+
- **@pipedream/google-slides** (google_slides): mainFile
145+
- ... and 83 more packages
146+
147+
## Next Steps
148+
1. Review the failed packages listed above
149+
2. Check the full validation report artifact
150+
3. Fix import/dependency issues in failing packages
151+
...
152+
```
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
outputs:
29+
issue-created:
30+
description: 'Whether a new issue was created'
31+
value: ${{ steps.run_issue_creation.outputs.issue-created }}
32+
issue-updated:
33+
description: 'Whether an existing issue was updated'
34+
value: ${{ steps.run_issue_creation.outputs.issue-updated }}
35+
issue-url:
36+
description: 'URL of the created/updated issue'
37+
value: ${{ steps.run_issue_creation.outputs.issue-url }}
38+
failed-count:
39+
description: 'Number of failed packages'
40+
value: ${{ steps.run_issue_creation.outputs.failed-count }}
41+
42+
runs:
43+
using: 'composite'
44+
steps:
45+
- name: Setup Node.js for action
46+
uses: actions/[email protected]
47+
with:
48+
node-version: '20'
49+
50+
- name: Install action dependencies
51+
shell: bash
52+
run: |
53+
cd ${{ github.action_path }}
54+
npm install
55+
56+
- name: Run issue creation
57+
id: run_issue_creation
58+
shell: bash
59+
run: |
60+
cd ${{ github.action_path }}
61+
node src/index.js
62+
env:
63+
INPUT_GITHUB_TOKEN: ${{ inputs.github-token }}
64+
INPUT_VALIDATION_REPORT_JSON: ${{ inputs.validation-report-json }}
65+
INPUT_VALIDATION_REPORT_TXT: ${{ inputs.validation-report-txt }}
66+
INPUT_WORKFLOW_RUN_NUMBER: ${{ inputs.workflow-run-number }}
67+
INPUT_WORKFLOW_RUN_ID: ${{ inputs.workflow-run-id }}
68+
INPUT_SERVER_URL: ${{ inputs.server-url }}
69+
INPUT_REPOSITORY: ${{ inputs.repository }}
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)