Skip to content

Add complete type hints to all public methods and functions #69

Add complete type hints to all public methods and functions

Add complete type hints to all public methods and functions #69

name: πŸ€– Copilot Feature Factory
on:
issues:
types: [labeled]
permissions:
contents: write
pull-requests: write
issues: write
jobs:
# ------------------------------------------------------------------
# NOTIFY AND CREATE TRACKING ISSUE
# ------------------------------------------------------------------
create-implementation-task:
if: github.event.label.name == 'copilot-build'
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout Repository
uses: actions/checkout@v4
- name: πŸ’¬ Guide User to Copilot Edits
uses: actions/github-script@v7
with:
script: |
const issueNumber = ${{ github.event.issue.number }};
const issueTitle = `${{ github.event.issue.title }}`;
const issueBody = `${{ github.event.issue.body }}`;
// Create a formatted prompt for Copilot Edits
const copilotPrompt = `Implement the feature from Issue #${issueNumber}:
**Title**: ${issueTitle}
**Requirements**:
${issueBody}
**Technical Guidelines**:
- Follow existing code patterns in the repository
- Add appropriate error handling and validation
- Include docstrings and type hints (Python)
- Ensure code follows PEP 8 style guidelines
- Add tests if applicable
- Update documentation as needed
**Project Context**:
- This is a Python-based Practice Questions Platform
- Uses pandas for data processing
- Generates SQL practice questions
- Follow the existing project structure in infra/ and src/ directories`;
// Comment with instructions
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: `## πŸ€– Copilot Feature Factory Activated!
This issue has been marked for Copilot-assisted implementation. Here's how to proceed:
### Option 1: Use GitHub Copilot Edits (Recommended)
1. **Open this repository** in VS Code or your preferred editor
2. **Start Copilot Edits** (Ctrl+Shift+I or Cmd+Shift+I)
3. **Copy and paste** the following prompt:
\`\`\`
${copilotPrompt}
\`\`\`
4. **Review the changes** Copilot suggests
5. **Commit and push** when satisfied
6. **Create a Pull Request** referencing this issue
### Option 2: Use GitHub Copilot Chat
1. Open the repository in your editor
2. Use **@workspace** in Copilot Chat
3. Ask: "Implement the feature described in Issue #${issueNumber}"
4. Review and apply suggested changes
### Option 3: Manual Implementation with Copilot Assistance
1. Create a new branch: \`git checkout -b feature/issue-${issueNumber}\`
2. Use Copilot inline suggestions as you code
3. Commit your changes
4. Push and create a PR
---
**πŸ“‹ Ready-to-Use Copilot Prompt:**
<details>
<summary>Click to expand full prompt</summary>
\`\`\`
${copilotPrompt}
\`\`\`
</details>
---
πŸ’‘ **Tip**: The more specific your issue description, the better Copilot's suggestions will be!
Remove the \`copilot-build\` label once you start working on this to avoid duplicate notifications.`
});
- name: 🏷️ Add Status Label
uses: actions/github-script@v7
with:
script: |
// Add a "copilot-ready" label
try {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.issue.number }},
labels: ['copilot-ready']
});
} catch (error) {
// Label might not exist, create it
console.log('Label might not exist, continuing...');
}