-
Notifications
You must be signed in to change notification settings - Fork 1
updates, add some gmaes, features and analytics #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9a99f2d
9f7dc51
b0efa90
6062aea
69db6a1
9ed85d8
065c98e
96e7773
891757b
0240b86
20a96a0
b28a203
9f4ac21
d080a6a
d180cdb
00d2001
a6ffc38
e850532
bef271c
ae9f900
9a61a46
9b320e8
f9a37d8
8923d97
02eb344
8500ead
18870ae
16d955f
5598c40
33ba119
8049156
69902c8
f039873
c197568
7351b3d
0906bd2
af0e552
92a24e4
a52c02c
0135fdb
833dcd4
91d322e
7a6086a
d6f0cc0
de1b591
03dd6a9
79af9e6
62dd384
75ce7f8
d8708cf
85e39da
459afa7
0eb5234
bbd4cc9
6910fb0
0f7d822
cfd8f77
320286f
a4e3443
6503240
0941b2a
23ab04c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # yaml-language-server: $schema=https://storage.googleapis.com/coderabbit_public_assets/schema.v2.json | ||
| enable_free_tier: true | ||
| reviews: | ||
| review_status: true | ||
| poem: false | ||
| profile: chill | ||
| path_instructions: | ||
| - path: '**/*.*' | ||
| instructions: | | ||
| Do not correct spelling errors or grammar mistakes. | ||
| auto_review: | ||
| enabled: true | ||
| base_branches: | ||
| - main | ||
| - prod | ||
| tools: | ||
| languagetool: | ||
| enabled: false |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||
| name: 'Move Project Items to Production' | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| push: | ||||||||||||||
| branches: | ||||||||||||||
| - prod | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| move_to_production: | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| permissions: | ||||||||||||||
| contents: read | ||||||||||||||
| steps: | ||||||||||||||
| - uses: actions/checkout@v3 | ||||||||||||||
| - uses: actions/setup-python@v5 | ||||||||||||||
| with: | ||||||||||||||
| python-version: '3.13' | ||||||||||||||
| - uses: actions/create-github-app-token@v1 | ||||||||||||||
| id: app-token | ||||||||||||||
| with: | ||||||||||||||
| app-id: ${{ secrets.GH_APP_ID }} | ||||||||||||||
| private-key: ${{ secrets.GH_PRIVATE_KEY }} | ||||||||||||||
| - name: Install dependencies | ||||||||||||||
| run: | | ||||||||||||||
| python -m venv venv | ||||||||||||||
| venv/bin/pip install requests | ||||||||||||||
|
Comment on lines
+24
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider pinning dependency versions for reproducible builds. Installing packages without version constraints can lead to inconsistent builds if package versions change. - run: |
- python -m venv venv
- venv/bin/pip install requests
+ run: |
+ python -m venv venv
+ venv/bin/pip install requests==2.32.3📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| - name: Move items from Done to In Production | ||||||||||||||
| run: | | ||||||||||||||
| venv/bin/python ci/scripts/move_to_production.py \ | ||||||||||||||
| -t ${{ steps.app-token.outputs.token }} \ | ||||||||||||||
| -o EducationalTools \ | ||||||||||||||
| -p 4 | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| # CI/CD Automation Scripts | ||
|
|
||
| This directory contains automation scripts for managing GitHub issues and project boards. | ||
|
|
||
| ## Scripts Overview | ||
|
|
||
| ### 1. `issue.py` - Issue Management | ||
|
|
||
| Automatically processes GitHub issues, particularly game requests: | ||
|
|
||
| - Detects issues with `[Gmae Request]` prefix | ||
| - Searches for relevant links on GitHub Pages | ||
| - Posts automated comments with search results | ||
|
|
||
| ### 2. `move_to_production.py` - Project Board Automation | ||
|
|
||
| Moves project items from "Done" status to "In Production" status: | ||
|
|
||
| - Queries GitHub Projects v2 API using GraphQL | ||
| - Finds all items with status "Done" | ||
| - Updates them to "In Production" status | ||
| - Used for production deployment automation | ||
|
|
||
| ### 3. `test_production_move.py` - Testing Script | ||
|
|
||
| Manual testing script for the production move operation: | ||
|
|
||
| - Allows testing the move operation without triggering workflows | ||
| - Supports dry-run mode (future enhancement) | ||
| - Useful for debugging and validation | ||
|
|
||
| ## GitHub Workflows | ||
|
|
||
| ### Issue Management (`.github/workflows/issue.yml`) | ||
|
|
||
| Triggers on: | ||
|
|
||
| - Issue opened | ||
| - Issue edited | ||
|
|
||
| Actions: | ||
|
|
||
| - Runs `issue.py` script | ||
| - Posts automated comments for game requests | ||
|
|
||
| ### Production Deployment (`.github/workflows/production_deploy.yml`) | ||
|
|
||
| Triggers on: | ||
|
|
||
| - Push to `prod` branch | ||
|
|
||
| Actions: | ||
|
|
||
| - Runs `move_to_production.py` script | ||
| - Moves all "Done" items to "In Production" in project #4 | ||
|
|
||
| ## Setup Requirements | ||
|
|
||
| ### GitHub App Configuration | ||
|
|
||
| Both workflows use a GitHub App for authentication: | ||
|
|
||
| 1. **Secrets Required:** | ||
|
|
||
| - `GH_APP_ID` - Your GitHub App ID | ||
| - `GH_PRIVATE_KEY` - Your GitHub App private key | ||
|
|
||
| 2. **App Permissions:** | ||
| - Issues: Read & Write (for issue comments) | ||
| - Projects: Read & Write (for project board updates) | ||
| - Repository: Read (for workflow access) | ||
|
|
||
| ### Project Configuration | ||
|
|
||
| The production deployment script assumes: | ||
|
|
||
| - Organization: `EducationalTools` | ||
| - Project number: `4` | ||
| - Status field with options: "Done" and "In Production" | ||
|
|
||
| These can be customized by modifying the workflow or script parameters. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Automatic Usage | ||
|
|
||
| The workflows run automatically based on their triggers: | ||
|
|
||
| - Issue workflow: When issues are opened/edited | ||
| - Production workflow: When code is pushed to `prod` branch | ||
|
|
||
| ### Manual Testing | ||
|
|
||
| To test the production move operation manually: | ||
|
|
||
| ```bash | ||
| # Install dependencies | ||
| pip install requests | ||
|
|
||
| # Test with your GitHub token | ||
| python ci/scripts/test_production_move.py --token YOUR_GITHUB_TOKEN | ||
|
|
||
| # Test with different organization/project | ||
| python ci/scripts/test_production_move.py \ | ||
| --token YOUR_TOKEN \ | ||
| --org YourOrganization \ | ||
| --project 5 | ||
| ``` | ||
|
|
||
| ### Direct Script Usage | ||
|
|
||
| You can also run the scripts directly: | ||
|
|
||
| ```bash | ||
| # Process a specific issue | ||
| python ci/scripts/issue.py -n 123 -t YOUR_TOKEN | ||
|
|
||
| # Move project items to production | ||
| python ci/scripts/move_to_production.py -t YOUR_TOKEN -o EducationalTools -p 4 | ||
| ``` | ||
|
|
||
| ## Dependencies | ||
|
|
||
| - `requests` - HTTP client for GitHub API calls | ||
| - `googlesearch-python` - For searching game links (issue.py only) | ||
|
|
||
| ## Error Handling | ||
|
|
||
| The scripts include error handling for common scenarios: | ||
|
|
||
| - Invalid tokens or permissions | ||
| - Missing projects or fields | ||
| - Network issues | ||
| - GraphQL API errors | ||
|
|
||
| ## GraphQL Queries | ||
|
|
||
| The project automation uses GitHub's GraphQL API v4 for efficient data retrieval and mutations. Key operations: | ||
|
|
||
| 1. **Project Data Query** - Gets project ID and field information | ||
| 2. **Items Query** - Retrieves all project items with their status values | ||
| 3. **Update Mutation** - Changes item status from "Done" to "In Production" | ||
|
|
||
| ## Future Enhancements | ||
|
|
||
| Potential improvements: | ||
|
|
||
| - Dry-run mode for testing changes | ||
| - Support for custom field names | ||
| - Better error reporting and logging | ||
| - Slack/Discord notifications | ||
| - Rollback capabilities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to the latest checkout action version.
The
actions/checkout@v3action is outdated and may not run properly on current GitHub Actions runners.📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.7)
14-14: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🤖 Prompt for AI Agents