Skip to content

Commit 817c0e6

Browse files
committed
Add project automation: GitHub Actions workflow to sync tasks from CSV to GitHub Issues
1 parent 5f20a52 commit 817c0e6

File tree

6 files changed

+462
-1
lines changed

6 files changed

+462
-1
lines changed

.github/project-config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"projectUrl": "https://github.com/compiling-org/nft-blockchain-interactive/projects/7",
3+
"projectId": "7",
4+
"organization": "compiling-org",
5+
"repo": "nft-blockchain-interactive",
6+
"autoAddToProject": true,
7+
"defaultLabels": ["automated-task"],
8+
"statusMapping": {
9+
"To Do": "Todo",
10+
"In Progress": "In Progress",
11+
"Done": "Done"
12+
}
13+
}

.github/scripts/sync-tasks.js

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const { execSync } = require('child_process');
4+
5+
// Check if we're running in a GitHub Actions environment
6+
const isGitHubActions = !!process.env.GITHUB_ACTIONS;
7+
8+
// Load project configuration
9+
let config = {
10+
"projectUrl": "https://github.com/compiling-org/nft-blockchain-interactive/projects/7",
11+
"projectId": "7",
12+
"organization": "compiling-org",
13+
"repo": "nft-blockchain-interactive",
14+
"autoAddToProject": true,
15+
"defaultLabels": ["automated-task"],
16+
"statusMapping": {
17+
"To Do": "Todo",
18+
"In Progress": "In Progress",
19+
"Done": "Done"
20+
}
21+
};
22+
23+
// Try to load from file if it exists
24+
try {
25+
const configPath = path.join(process.env.GITHUB_WORKSPACE || '.', '.github', 'project-config.json');
26+
if (fs.existsSync(configPath)) {
27+
config = {...config, ...JSON.parse(fs.readFileSync(configPath, 'utf8'))};
28+
}
29+
} catch (error) {
30+
console.log("Using default configuration");
31+
}
32+
33+
// Function to run shell commands
34+
function runCommand(command) {
35+
// If not in GitHub Actions, just log the command
36+
if (!isGitHubActions) {
37+
console.log(`[DRY RUN] Would run: ${command}`);
38+
return null;
39+
}
40+
41+
try {
42+
const output = execSync(command, { encoding: 'utf8' });
43+
return output.trim();
44+
} catch (error) {
45+
console.error(`Error running command: ${command}`);
46+
console.error(error.message);
47+
return null;
48+
}
49+
}
50+
51+
// Read the CSV file
52+
const csvFilePath = path.join(process.env.GITHUB_WORKSPACE || '.', 'PROJECT_TASKS.csv');
53+
const csvData = fs.readFileSync(csvFilePath, 'utf8');
54+
55+
// Parse CSV data (simple implementation)
56+
const lines = csvData.trim().split('\n');
57+
const headers = lines[0].split(',');
58+
59+
console.log(`Found ${lines.length - 1} tasks to process`);
60+
61+
let createdIssues = 0;
62+
let existingIssues = 0;
63+
64+
// Process each task
65+
for (let i = 1; i < lines.length; i++) {
66+
const values = lines[i].split(',');
67+
68+
// Skip if not enough values
69+
if (values.length < 5) continue;
70+
71+
const task = {
72+
title: values[0].trim().replace(/"/g, '\\"'),
73+
category: values[1].trim(),
74+
phase: values[2].trim(),
75+
status: values[3].trim(),
76+
module: values[4].trim()
77+
};
78+
79+
// Skip empty tasks
80+
if (!task.title || task.title === '') continue;
81+
82+
// Check if issue already exists (only in GitHub Actions)
83+
let issueExists = false;
84+
if (isGitHubActions) {
85+
const searchCommand = `gh issue list --search "${task.title}" --state all --limit 1`;
86+
const searchResult = runCommand(searchCommand);
87+
88+
if (searchResult && searchResult.includes(task.title)) {
89+
console.log(`Issue already exists: ${task.title}`);
90+
existingIssues++;
91+
issueExists = true;
92+
}
93+
}
94+
95+
// Skip if issue exists
96+
if (issueExists) continue;
97+
98+
// Create labels
99+
const labels = [...config.defaultLabels];
100+
if (task.category) labels.push(`category:${task.category}`);
101+
if (task.phase && task.phase !== '') labels.push(`phase:${task.phase}`);
102+
if (task.module && task.module !== '') labels.push(`module:${task.module}`);
103+
if (task.status && task.status !== '') labels.push(`status:${task.status}`);
104+
105+
// Create the issue
106+
const labelString = labels.join(',');
107+
108+
console.log(`Creating issue: ${task.title}`);
109+
110+
// Create the issue using GitHub CLI (only in GitHub Actions)
111+
if (isGitHubActions) {
112+
let createCommand = `gh issue create --title "${task.title}" --body "Task automatically generated from PROJECT_TASKS.csv\\n\\nCategory: ${task.category}\\nPhase: ${task.phase}\\nModule: ${task.module}\\nStatus: ${task.status}"`;
113+
114+
if (labelString) {
115+
createCommand += ` --label "${labelString}"`;
116+
}
117+
118+
const result = runCommand(createCommand);
119+
if (result) {
120+
console.log(`Created issue: ${result}`);
121+
createdIssues++;
122+
123+
// Extract issue number from the URL
124+
const issueNumber = result.split('/').pop();
125+
126+
// Add to project board if configured
127+
if (config.autoAddToProject && config.projectId) {
128+
try {
129+
// First, we need to get the project ID using the GitHub API
130+
// For now, we'll use a placeholder command
131+
console.log(`Would add issue #${issueNumber} to project #${config.projectId}`);
132+
133+
// When you have the proper project ID, you can uncomment this:
134+
// const projectCommand = `gh issue edit ${issueNumber} --add-project "${config.organization}/${config.projectId}"`;
135+
// runCommand(projectCommand);
136+
} catch (error) {
137+
console.error(`Failed to add issue to project: ${error.message}`);
138+
}
139+
}
140+
}
141+
} else {
142+
console.log(`[DRY RUN] Would create issue with labels: ${labelString}`);
143+
createdIssues++;
144+
}
145+
}
146+
147+
console.log(`Successfully processed ${createdIssues} tasks`);
148+
if (isGitHubActions) {
149+
console.log(`${existingIssues} issues already existed`);
150+
}
151+
console.log(`Total tasks processed: ${lines.length - 1}`);
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Sync Project Tasks
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- 'PROJECT_TASKS.csv'
8+
- 'PROJECT_TASKS.md'
9+
pull_request:
10+
branches: [ main, master ]
11+
paths:
12+
- 'PROJECT_TASKS.csv'
13+
- 'PROJECT_TASKS.md'
14+
workflow_dispatch:
15+
16+
jobs:
17+
sync-tasks:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: '16'
27+
28+
- name: Install GitHub CLI
29+
run: |
30+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
31+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
32+
sudo apt update
33+
sudo apt install gh
34+
35+
- name: Configure GitHub CLI
36+
run: |
37+
gh config set prompt disabled
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Create issues from tasks
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
GITHUB_REPOSITORY: ${{ github.repository }}
45+
run: |
46+
echo "Running task sync for repository: $GITHUB_REPOSITORY"
47+
node .github/scripts/sync-tasks.js
48+
49+
- name: Commit and push any changes
50+
run: |
51+
git config --global user.name 'github-actions[bot]'
52+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
53+
git add .
54+
git commit -m "Sync project tasks" || echo "No changes to commit"
55+
git push
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

PROJECT_TASKS.csv

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Task,Category,Phase,Status,Module
2+
Complete WASM compilation pipeline for fractal shaders,Core WASM Engine,Phase 1,To Do,
3+
WebGL/WebGPU rendering integration,Core WASM Engine,Phase 1,To Do,
4+
Basic parameter controls and modulation,Core WASM Engine,Phase 1,To Do,
5+
Performance optimization for 60fps rendering,Core WASM Engine,Phase 1,To Do,
6+
Modular tool architecture (shaders, audio, XR),Browser Tool Framework,Phase 1,To Do,
7+
Real-time collaboration primitives,Browser Tool Framework,Phase 1,To Do,
8+
Basic patch saving/loading system,Browser Tool Framework,Phase 1,To Do,
9+
Cross-browser compatibility testing,Browser Tool Framework,Phase 1,To Do,
10+
Basic collaboration contracts,NEAR Integration,Phase 1,To Do,near-wasm
11+
Tool ownership NFTs,NEAR Integration,Phase 1,To Do,near-wasm
12+
Testnet deployment and user testing,NEAR Integration,Phase 1,To Do,near-wasm
13+
Enhanced marketplace UI with tool previews,Marketplace Foundation,Phase 1,To Do,
14+
Basic tool purchasing and licensing,Marketplace Foundation,Phase 1,To Do,
15+
Creator dashboard for tool management,Marketplace Foundation,Phase 1,To Do,
16+
Integration testing with existing NFT contracts,Marketplace Foundation,Phase 1,To Do,
17+
Real-time state synchronization,Advanced Collaboration System,Phase 2,To Do,
18+
Multi-user live editing sessions,Advanced Collaboration System,Phase 2,To Do,
19+
Voice/video integration,Advanced Collaboration System,Phase 2,To Do,
20+
Session recording and playback,Advanced Collaboration System,Phase 2,To Do,
21+
Version control for creative patches,Patch Ecosystem,Phase 2,To Do,
22+
Forking and merging of tool variations,Patch Ecosystem,Phase 2,To Do,
23+
Community patch marketplace,Patch Ecosystem,Phase 2,To Do,
24+
Automated compatibility checking,Patch Ecosystem,Phase 2,To Do,
25+
Advanced search and filtering,Enhanced Marketplace,Phase 2,To Do,
26+
Tool usage analytics,Enhanced Marketplace,Phase 2,To Do,
27+
Creator revenue tracking,Enhanced Marketplace,Phase 2,To Do,
28+
Subscription and licensing models,Enhanced Marketplace,Phase 2,To Do,
29+
Solana program for high-throughput collaboration,Cross-Chain Integration,Phase 3,To Do,solana-client
30+
Ethereum integration for DeFi features,Cross-Chain Integration,Phase 3,To Do,
31+
Polkadot parachain for global scalability,Cross-Chain Integration,Phase 3,To Do,
32+
Cross-chain asset bridging,Cross-Chain Integration,Phase 3,To Do,
33+
AI-assisted tool creation,Advanced Features,Phase 3,To Do,
34+
XR/AR creative spaces,Advanced Features,Phase 3,To Do,
35+
Live performance streaming,Advanced Features,Phase 3,To Do,
36+
Educational content integration,Advanced Features,Phase 3,To Do,
37+
DAO implementation for platform governance,Governance & Sustainability,Phase 3,To Do,
38+
Creator incentive programs,Governance & Sustainability,Phase 3,To Do,
39+
Community fund establishment,Governance & Sustainability,Phase 3,To Do,
40+
Long-term roadmap planning,Governance & Sustainability,Phase 3,To Do,
41+
API for third-party integrations,Enterprise Integration,Phase 4,To Do,
42+
White-label solutions,Enterprise Integration,Phase 4,To Do,
43+
Educational institution partnerships,Enterprise Integration,Phase 4,To Do,
44+
Corporate creative tool solutions,Enterprise Integration,Phase 4,To Do,
45+
Multi-language support,Global Expansion,Phase 4,To Do,
46+
Regional community building,Global Expansion,Phase 4,To Do,
47+
Localized marketplace features,Global Expansion,Phase 4,To Do,
48+
Global creator onboarding,Global Expansion,Phase 4,To Do,
49+
Add more creative data types,rust-client Module,,To Do,rust-client
50+
Implement additional blockchain integration features,rust-client Module,,To Do,rust-client
51+
Add Filecoin integration,ipfs-integration Module,,To Do,ipfs-integration
52+
Implement distributed storage redundancy,ipfs-integration Module,,To Do,ipfs-integration
53+
Complete collaboration contracts,near-wasm Module,,To Do,near-wasm
54+
Add more interaction types,near-wasm Module,,To Do,near-wasm
55+
Implement advanced governance features,near-wasm Module,,To Do,near-wasm
56+
Create directory structure,solana-client Module,,To Do,solana-client
57+
Implement Anchor programs for Solana metadata validation,solana-client Module,,To Do,solana-client
58+
Add high-throughput collaboration features,solana-client Module,,To Do,solana-client
59+
Integrate with existing creative data pipeline,solana-client Module,,To Do,solana-client
60+
Implement bridge contracts between NEAR and Solana,Cross-Chain Integration,,To Do,
61+
Create unified API for multi-chain operations,Cross-Chain Integration,,To Do,
62+
Develop cross-chain identity system,Cross-Chain Integration,,To Do,
63+
Build atomic swap functionality for creative assets,Cross-Chain Integration,,To Do,
64+
Connect with existing NFT marketplaces (Mintbase, OpenSea),Marketplace Integration,,To Do,
65+
Implement royalty distribution system,Marketplace Integration,,To Do,
66+
Add reputation scoring for creators,Marketplace Integration,,To Do,
67+
Create community curation mechanisms,Marketplace Integration,,To Do,
68+
Optimize WASM shader engine for mobile devices,Performance Optimization,,To Do,
69+
Implement caching strategies for creative assets,Performance Optimization,,To Do,
70+
Add compression for network transfers,Performance Optimization,,To Do,
71+
Profile and optimize memory usage,Performance Optimization,,To Do,
72+
Conduct smart contract security audit,Security Enhancements,,To Do,
73+
Implement access control for collaborative sessions,Security Enhancements,,To Do,
74+
Add input validation for all user-provided data,Security Enhancements,,To Do,
75+
Create disaster recovery procedures,Security Enhancements,,To Do,
76+
Complete API documentation for all modules,Documentation and Testing,,To Do,
77+
Add comprehensive unit tests,Documentation and Testing,,To Do,
78+
Create integration test suite,Documentation and Testing,,To Do,
79+
Develop user tutorials and examples,Documentation and Testing,,To Do,

0 commit comments

Comments
 (0)