forked from Stellarkard/Stellar_Card
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_additional_issues.js
More file actions
71 lines (57 loc) · 2.54 KB
/
Copy pathcreate_additional_issues.js
File metadata and controls
71 lines (57 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const { execSync } = require('child_process');
const fs = require('fs');
const generalTopics = [
{ title: "Improve e2e testing pipeline stability", scope: "e2e" },
{ title: "Refactor tooling scripts to use modern Node features", scope: "tooling" },
{ title: "Setup automated dependabot security updates", scope: "security" },
{ title: "Implement comprehensive cross-browser testing", scope: "qa" },
{ title: "Add docker-compose for unified local development", scope: "devops" },
{ title: "Review and update project READMEs and contributor guides", scope: "docs" },
{ title: "Optimize Github Actions caching for faster builds", scope: "ci-cd" },
{ title: "Implement commitlint and Husky hooks", scope: "tooling" },
{ title: "Add automated accessibility (a11y) audits in CI", scope: "qa" },
{ title: "Consolidate ESLint and Prettier configurations", scope: "tooling" }
];
function generateIssue(id, topicIndex) {
let topic = generalTopics[topicIndex % generalTopics.length];
const title = `[general] ${topic.title} (Part ${Math.floor(topicIndex/10) + 1})`;
const body = `### Description
Implement and refine the following task: **${topic.title}**.
### Requirements and context
- Code must follow project guidelines and existing design patterns.
- Ensure all edge cases are considered.
- Refer to the \`issueTemplate.md\` for quality standards.
### Suggested execution
1. Fork the repo and create a branch \`feature/${topic.scope}-task-${id}\`
2. Implement the necessary code changes.
3. Write associated tests to prove your solution works.
4. Document any new functions or architecture changes.
### Guidelines
- Assignment required before starting.
- Complexity Level: Medium (150 points)
`;
return { title, body };
}
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function run() {
console.log("Starting to create 50 additional issues...");
for (let i = 1; i <= 50; i++) {
let topicIndex = i - 1;
const { title, body } = generateIssue(i, topicIndex);
fs.writeFileSync('temp_body.md', body);
console.log(`Creating: ${title}`);
try {
execSync(`gh issue create --title "${title}" --body-file temp_body.md`, { stdio: 'inherit' });
} catch (e) {
console.error(`Failed to create issue: ${title}`);
}
await delay(2000);
}
if (fs.existsSync('temp_body.md')) {
fs.unlinkSync('temp_body.md');
}
console.log("Done creating additional issues!");
}
run();