Skip to content

Commit 871f589

Browse files
Merge pull request #206 from rocky-linux/develop
Release: Merge develop to main
2 parents 3bd5202 + e81726c commit 871f589

37 files changed

+3053
-601
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: fullstack-ts-engineer
3+
description: Use this agent when you need expert assistance with TypeScript/JavaScript development tasks including writing new code, reviewing existing code, implementing best practices, or solving full-stack engineering challenges. This agent excels at both frontend and backend development, can search for current best practices, and provides thorough code reviews. Examples:\n\n<example>\nContext: User needs help implementing a React component with TypeScript.\nuser: "I need to create a reusable Button component with proper TypeScript types"\nassistant: "I'll use the fullstack-ts-engineer agent to help create a well-typed, reusable Button component following React best practices."\n<commentary>\nSince this involves TypeScript/React development, the fullstack-ts-engineer agent is perfect for providing expert guidance on component architecture and type definitions.\n</commentary>\n</example>\n\n<example>\nContext: User has written an Express.js API endpoint and wants it reviewed.\nuser: "I just finished writing an authentication endpoint, can you check if it follows security best practices?"\nassistant: "Let me use the fullstack-ts-engineer agent to review your authentication endpoint for security best practices and code quality."\n<commentary>\nThe user needs a code review focusing on security best practices for a backend endpoint, which is within the fullstack-ts-engineer's expertise.\n</commentary>\n</example>\n\n<example>\nContext: User needs guidance on modern JavaScript patterns.\nuser: "What's the best way to handle async operations in a Node.js application?"\nassistant: "I'll consult the fullstack-ts-engineer agent to provide expert guidance on modern async patterns in Node.js."\n<commentary>\nThis requires deep knowledge of JavaScript async patterns and best practices, making it ideal for the fullstack-ts-engineer agent.\n</commentary>\n</example>
4+
color: green
5+
---
6+
7+
You are an expert TypeScript/JavaScript full-stack engineer with deep knowledge of the React.js library, Next.js framework, and modern development practices. You have extensive experience with TypeScript's type system, JavaScript ES6+ features (including the latest features, knowing what is available in most browsers), and the entire web development ecosystem.
8+
9+
Your core competencies include:
10+
11+
- Writing clean, maintainable, and performant TypeScript/JavaScript code
12+
- Implementing design patterns and architectural best practices
13+
- Conducting thorough code reviews with constructive feedback
14+
- Staying current with evolving best practices through research when needed
15+
- Understanding both browser and Node.js environments deeply
16+
- Database design and integration (SQL and NoSQL)
17+
- API design (REST, GraphQL)
18+
- Testing strategies (unit, integration, e2e)
19+
- Performance optimization techniques
20+
- Security best practices
21+
22+
When assisting with code:
23+
24+
1. **Write with clarity**: Produce code that is self-documenting with meaningful variable names and appropriate comments for complex logic
25+
2. **Prioritize type safety**: Leverage TypeScript's type system fully, avoiding 'any' types and ensuring proper type coverage
26+
3. **Follow established patterns**: Adhere to project conventions when evident, or recommend industry-standard patterns when starting fresh
27+
4. **Consider edge cases**: Anticipate potential issues and handle errors gracefully
28+
5. **Optimize thoughtfully**: Balance performance with readability, optimizing only where it provides meaningful benefit
29+
30+
When reviewing code:
31+
32+
1. **Identify critical issues first**: Security vulnerabilities, logic errors, or performance bottlenecks
33+
2. **Suggest improvements constructively**: Explain why changes would be beneficial with concrete examples
34+
3. **Acknowledge good practices**: Highlight what's done well to reinforce positive patterns
35+
4. **Consider context**: Understand the broader system and requirements before suggesting major refactors
36+
5. **Provide actionable feedback**: Include code snippets or specific implementation suggestions
37+
38+
When researching best practices:
39+
40+
1. **Search for current information**: When uncertain or when practices may have evolved, search online for the latest recommendations
41+
2. **Evaluate sources critically**: Prioritize official documentation, reputable blogs, and well-maintained repositories
42+
3. **Consider trade-offs**: Present multiple approaches when applicable, explaining pros and cons
43+
4. **Adapt to project needs**: Tailor general best practices to the specific context and constraints
44+
45+
Your approach should be:
46+
47+
- **Pragmatic**: Focus on solutions that work in real-world scenarios
48+
- **Educational**: Explain your reasoning to help others learn
49+
- **Collaborative**: Engage in technical discussions as a peer, not a lecturer
50+
- **Detail-oriented**: Catch subtle issues while maintaining sight of the bigger picture
51+
- **Proactive**: Anticipate follow-up questions and address potential concerns
52+
53+
When you need clarification, ask specific questions about requirements, constraints, or preferences. Always strive to provide value whether writing new code, reviewing existing implementations, or sharing architectural guidance.

.claude/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"permissions": {
3+
"allow": ["Bash(git add:*)"],
4+
"deny": []
5+
}
6+
}

.devcontainer/devcontainer.json

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# GitHub Actions Workflows
2+
3+
This directory contains GitHub Actions workflows for the Rocky Linux website.
4+
5+
## Workflows
6+
7+
### check-download-urls.yml
8+
9+
This workflow automatically checks all URLs in the `data/downloads.json` file to ensure they are accessible.
10+
11+
#### When it runs:
12+
13+
- **On push/PR**: When `data/downloads.json` is modified
14+
- **Daily**: At 2 AM UTC (scheduled check)
15+
- **Manual**: Can be triggered manually from the Actions tab
16+
17+
#### What it does:
18+
19+
1. Extracts all URLs from the nested JSON structure
20+
2. Checks each URL using HTTP HEAD requests
21+
3. Reports any URLs that return errors or non-success status codes
22+
4. Creates issues or PR comments when failures are detected
23+
24+
#### Local testing:
25+
26+
You can test the URL checker locally using the standalone script:
27+
28+
```bash
29+
# Run the URL checker
30+
node scripts/check-download-urls.js
31+
32+
# Or make it executable and run directly
33+
chmod +x scripts/check-download-urls.js
34+
./scripts/check-download-urls.js
35+
```
36+
37+
#### Features:
38+
39+
- **Batch processing**: Checks URLs in batches to avoid overwhelming servers
40+
- **Progress indicator**: Shows real-time progress when run locally
41+
- **Detailed reporting**: Shows the JSON path and error details for each failed URL
42+
- **GitHub integration**: Automatically comments on PRs and creates issues for scheduled runs
43+
- **Smart notifications**:
44+
- Updates existing PR comments instead of creating duplicates
45+
- Updates existing issues instead of creating new ones daily
46+
- Automatically closes issues when all URLs are fixed
47+
- **Prevents spam**: Only one issue and one PR comment per problem
48+
49+
#### Expected behavior:
50+
51+
- URLs returning 2xx or 3xx status codes are considered successful
52+
- 4xx or 5xx status codes are reported as failures
53+
- Network errors and timeouts are also reported
54+
- All URLs, including Docker Hub, are checked using HTTP HEAD requests. Some services (like Docker Hub) may not support HEAD requests, which can result in false negatives.
55+
56+
### Other Workflows
57+
58+
- **playwright.yml**: Runs Playwright end-to-end tests
59+
- **validate_markdown_filenames.yml**: Ensures markdown files follow naming conventions
60+
- **Validate.yml**: General validation workflow
61+
62+
## Adding New Workflows
63+
64+
When adding new workflows:
65+
66+
1. Place the workflow file in this directory
67+
2. Use descriptive names ending with `.yml`
68+
3. Document the workflow purpose and triggers
69+
4. Consider adding manual trigger option (`workflow_dispatch`)
70+
5. Add appropriate error handling and notifications
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
name: Check Download URLs
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths:
7+
- 'data/downloads.json'
8+
pull_request:
9+
branches: [ main, develop ]
10+
paths:
11+
- 'data/downloads.json'
12+
schedule:
13+
# Run daily at 2 AM UTC to catch broken links
14+
- cron: '0 2 * * *'
15+
workflow_dispatch:
16+
# Allow manual triggering
17+
18+
jobs:
19+
check-urls:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
31+
- name: Extract and check URLs
32+
id: url-check
33+
run: node scripts/check-download-urls.js
34+
env:
35+
GITHUB_ACTIONS: true
36+
continue-on-error: true
37+
38+
- name: Comment PR on failure
39+
if: steps.url-check.outcome == 'failure' && github.event_name == 'pull_request'
40+
uses: actions/github-script@v7
41+
with:
42+
script: |
43+
const fs = require('fs');
44+
if (fs.existsSync('url-check-summary.md')) {
45+
const summary = fs.readFileSync('url-check-summary.md', 'utf8');
46+
47+
// Check for existing comments from this workflow
48+
const comments = await github.rest.issues.listComments({
49+
issue_number: context.issue.number,
50+
owner: context.repo.owner,
51+
repo: context.repo.repo
52+
});
53+
54+
const botComment = comments.data.find(comment =>
55+
comment.user.type === 'Bot' &&
56+
comment.body.includes('🚨 URL Check Failed')
57+
);
58+
59+
if (botComment) {
60+
// Update existing comment
61+
await github.rest.issues.updateComment({
62+
comment_id: botComment.id,
63+
owner: context.repo.owner,
64+
repo: context.repo.repo,
65+
body: summary + '\n\n*Updated: ' + new Date().toISOString() + '*'
66+
});
67+
} else {
68+
// Create new comment
69+
await github.rest.issues.createComment({
70+
issue_number: context.issue.number,
71+
owner: context.repo.owner,
72+
repo: context.repo.repo,
73+
body: summary
74+
});
75+
}
76+
}
77+
78+
- name: Create or update issue on scheduled run failure
79+
if: steps.url-check.outcome == 'failure' && github.event_name == 'schedule'
80+
uses: actions/github-script@v7
81+
with:
82+
script: |
83+
const fs = require('fs');
84+
let body = '## 🚨 Daily URL Check Failed\n\n';
85+
86+
if (fs.existsSync('url-check-summary.md')) {
87+
body += fs.readFileSync('url-check-summary.md', 'utf8');
88+
} else {
89+
body += 'The URL checker found broken links in downloads.json. Please check the workflow logs for details.';
90+
}
91+
92+
body += '\n\n[View latest workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})';
93+
94+
// Check for existing open issues
95+
const issues = await github.rest.issues.listForRepo({
96+
owner: context.repo.owner,
97+
repo: context.repo.repo,
98+
state: 'open',
99+
labels: 'downloads,url-check-failed'
100+
});
101+
102+
const existingIssue = issues.data.find(issue =>
103+
issue.title === 'Broken download URLs detected'
104+
);
105+
106+
if (existingIssue) {
107+
// Add comment to existing issue
108+
await github.rest.issues.createComment({
109+
issue_number: existingIssue.number,
110+
owner: context.repo.owner,
111+
repo: context.repo.repo,
112+
body: body + '\n\n*Check performed at: ' + new Date().toISOString() + '*'
113+
});
114+
console.log(`Updated existing issue #${existingIssue.number}`);
115+
} else {
116+
// Create new issue
117+
await github.rest.issues.create({
118+
owner: context.repo.owner,
119+
repo: context.repo.repo,
120+
title: 'Broken download URLs detected',
121+
body: body + '\n\n*First detected: ' + new Date().toISOString() + '*\n\nThis issue will be automatically updated with new checks until resolved.',
122+
labels: ['bug', 'downloads', 'url-check-failed']
123+
});
124+
console.log('Created new issue for broken URLs');
125+
}
126+
127+
- name: Close issue if URLs are fixed
128+
if: steps.url-check.outcome == 'success' && github.event_name == 'schedule'
129+
uses: actions/github-script@v7
130+
with:
131+
script: |
132+
// Check for existing open issues
133+
const issues = await github.rest.issues.listForRepo({
134+
owner: context.repo.owner,
135+
repo: context.repo.repo,
136+
state: 'open',
137+
labels: ['downloads', 'url-check-failed']
138+
});
139+
140+
const existingIssue = issues.data.find(issue =>
141+
issue.title === 'Broken download URLs detected'
142+
);
143+
144+
if (existingIssue) {
145+
// Close the issue
146+
await github.rest.issues.update({
147+
issue_number: existingIssue.number,
148+
owner: context.repo.owner,
149+
repo: context.repo.repo,
150+
state: 'closed'
151+
});
152+
153+
// Add closing comment
154+
await github.rest.issues.createComment({
155+
issue_number: existingIssue.number,
156+
owner: context.repo.owner,
157+
repo: context.repo.repo,
158+
body: '✅ All URLs are now accessible! Closing this issue.\n\n*Verified at: ' + new Date().toISOString() + '*'
159+
});
160+
161+
console.log(`Closed issue #${existingIssue.number} - all URLs are fixed`);
162+
}
163+
164+
- name: Set workflow status
165+
if: always()
166+
run: |
167+
if [ "${{ steps.url-check.outcome }}" == "failure" ]; then
168+
echo "URL check failed - marking workflow as failed"
169+
exit 1
170+
else
171+
echo "URL check passed"
172+
exit 0
173+
fi

0 commit comments

Comments
 (0)