Skip to content

Commit f19c275

Browse files
authored
feat: enhance AWS Backup feature discovery with issue creation (#234)
- Add explicit Claude Code instructions for GitHub issue creation - Implement post-processing step to handle pending_creation features - Add detailed issue templates with auto-discovery metadata - Update workflow summary to show issue creation status - Ensure issues are created for discovered AWS Backup features Resolves the issue where features were discovered but no GitHub issues were created for tracking implementation.
1 parent 1211fea commit f19c275

File tree

1 file changed

+179
-20
lines changed

1 file changed

+179
-20
lines changed

.github/workflows/feature-discovery.yml

Lines changed: 179 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -236,30 +236,79 @@ jobs:
236236
- Look for Backup-related fixes that might affect the module
237237
238238
### Step 5: Issue Creation
239-
For each significant finding:
239+
**CRITICAL: You MUST create actual GitHub issues when dry_run is false.**
240240
241-
**If NOT in dry run mode (${{ inputs.dry_run }} == false):**
241+
**Current Configuration: dry_run = ${{ inputs.dry_run || 'false' }}**
242242
243-
Create GitHub issues using templates:
243+
**If NOT in dry run mode (${{ inputs.dry_run }} == 'false' or inputs.dry_run is empty):**
244244
245+
For EACH new feature discovered, you MUST execute these commands:
246+
247+
**For new AWS Backup resources (aws_backup_*):**
248+
```bash
249+
gh issue create --title "feat: Add support for [EXACT_RESOURCE_NAME]" \
250+
--body "## Feature Request
251+
252+
### AWS Resource
253+
**Resource:** \`[EXACT_RESOURCE_NAME]\`
254+
**Provider Version:** ${{ inputs.provider_version || 'latest' }}
255+
**Discovery Date:** $(date -u '+%Y-%m-%d')
256+
257+
### Description
258+
[RESOURCE_DESCRIPTION_FROM_DOCS]
259+
260+
### Arguments/Attributes
261+
[LIST_OF_ARGUMENTS]
262+
263+
### Implementation Priority
264+
[HIGH/MEDIUM/LOW based on security_impact]
265+
266+
### Security Impact
267+
[SECURITY_IMPLICATIONS]
268+
269+
### References
270+
- AWS Provider Documentation: [DOC_LINK]
271+
- Terraform Registry: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/[resource_name]
272+
273+
### Auto-Discovery Metadata
274+
- Discovered by: AWS Backup Feature Discovery Bot
275+
- Scan ID: $(date +%s)
276+
- Provider Doc ID: [PROVIDER_DOC_ID]" \
277+
--label "enhancement,aws-provider-update,auto-discovered,needs-implementation" \
278+
--assignee "lgallard"
279+
```
280+
281+
**For new arguments on existing resources:**
282+
```bash
283+
gh issue create --title "feat: Add [ARGUMENT_NAME] support to [RESOURCE_NAME]" \
284+
--body "## Enhancement Request
285+
286+
### Resource Enhancement
287+
**Resource:** \`[RESOURCE_NAME]\`
288+
**New Argument:** \`[ARGUMENT_NAME]\`
289+
**Provider Version:** ${{ inputs.provider_version || 'latest' }}
290+
291+
### Argument Details
292+
[ARGUMENT_DESCRIPTION]
293+
294+
### Implementation Impact
295+
[IMPACT_ON_EXISTING_MODULE]
296+
297+
### Auto-Discovery Metadata
298+
- Discovered by: AWS Backup Feature Discovery Bot
299+
- Priority: [PRIORITY_LEVEL]" \
300+
--label "enhancement,aws-provider-update,auto-discovered,argument-addition" \
301+
--assignee "lgallard"
302+
```
303+
304+
**VERIFICATION STEP: After creating each issue, capture the issue number and update the tracker:**
245305
```bash
246-
# For new features
247-
gh issue create --template .github/ISSUE_TEMPLATE/new-backup-feature.md \
248-
--title "feat: Add support for [feature_name]" \
249-
--label "enhancement,aws-provider-update,auto-discovered" \
250-
--assignee "@me"
251-
252-
# For deprecations
253-
gh issue create --template .github/ISSUE_TEMPLATE/backup-deprecation.md \
254-
--title "chore: Handle deprecation of [feature_name]" \
255-
--label "deprecation,breaking-change,auto-discovered" \
256-
--assignee "@me"
257-
258-
# For bug fixes
259-
gh issue create --template .github/ISSUE_TEMPLATE/backup-bug-fix.md \
260-
--title "fix: Address [bug_description]" \
261-
--label "bug,aws-provider-update,auto-discovered" \
262-
--assignee "@me"
306+
# Get the issue number from the previous command
307+
ISSUE_NUMBER=$(gh issue list --limit 1 --json number --jq '.[0].number')
308+
echo "Created issue #$ISSUE_NUMBER for [FEATURE_NAME]"
309+
310+
# You MUST update the feature tracker to mark the issue as created (not pending_creation)
311+
# This will be handled in the tracker update step
263312
```
264313
265314
### Step 6: Update Feature Tracker
@@ -289,6 +338,100 @@ jobs:
289338
## Expected Output
290339
Provide a detailed report of your analysis and actions taken.
291340
341+
- name: Post-process pending issue creation
342+
id: create-pending-issues
343+
if: steps.claude-discovery.conclusion == 'success' && inputs.dry_run != true
344+
run: |
345+
set -euo pipefail
346+
347+
echo "🔍 Checking for features with pending_creation status..."
348+
349+
TRACKER_FILE=".github/feature-tracker/backup-features.json"
350+
ISSUES_CREATED=0
351+
352+
if [ ! -f "$TRACKER_FILE" ]; then
353+
echo "Feature tracker file not found, skipping post-processing"
354+
exit 0
355+
fi
356+
357+
# Extract pending creation features using jq
358+
PENDING_FEATURES=$(jq -r '.issues_created[] | select(.status == "pending_creation") | @base64' "$TRACKER_FILE" 2>/dev/null || echo "")
359+
360+
if [ -z "$PENDING_FEATURES" ]; then
361+
echo "✅ No features with pending_creation status found"
362+
exit 0
363+
fi
364+
365+
echo "📝 Found features requiring issue creation:"
366+
367+
# Process each pending feature
368+
while IFS= read -r feature_data; do
369+
if [ -n "$feature_data" ]; then
370+
# Decode base64 and extract fields
371+
FEATURE_JSON=$(echo "$feature_data" | base64 --decode)
372+
RESOURCE=$(echo "$FEATURE_JSON" | jq -r '.resource')
373+
TITLE=$(echo "$FEATURE_JSON" | jq -r '.title')
374+
ISSUE_TYPE=$(echo "$FEATURE_JSON" | jq -r '.issue_type')
375+
376+
echo "Creating issue for: $RESOURCE"
377+
378+
# Create the issue based on type
379+
if [ "$ISSUE_TYPE" = "new-feature" ]; then
380+
ISSUE_URL=$(gh issue create \
381+
--title "$TITLE" \
382+
--body "## AWS Backup Feature Request
383+
384+
### Resource
385+
**AWS Resource:** \`$RESOURCE\`
386+
**Provider Version:** ${{ inputs.provider_version || 'latest' }}
387+
**Discovery Date:** $(date -u '+%Y-%m-%d')
388+
389+
### Auto-Discovery Details
390+
This feature was automatically discovered by the AWS Backup Feature Discovery workflow.
391+
392+
**Discovery Metadata:**
393+
- Scan Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
394+
- Workflow Run: ${{ github.run_id }}
395+
- Repository: ${{ github.repository }}
396+
397+
### Next Steps
398+
1. Review AWS provider documentation for this resource
399+
2. Analyze integration requirements with existing module
400+
3. Design implementation approach
401+
4. Add comprehensive tests
402+
5. Update documentation and examples
403+
404+
### Implementation Priority
405+
This feature requires evaluation for:
406+
- Security and compliance impact
407+
- Backward compatibility
408+
- Module architecture integration
409+
410+
---
411+
*Auto-generated by AWS Backup Feature Discovery Bot*" \
412+
--label "enhancement,aws-provider-update,auto-discovered,needs-triage" \
413+
--assignee "lgallard")
414+
415+
# Extract issue number from URL
416+
ISSUE_NUMBER=$(echo "$ISSUE_URL" | grep -o '[0-9]*$')
417+
echo "✅ Created issue #$ISSUE_NUMBER for $RESOURCE"
418+
ISSUES_CREATED=$((ISSUES_CREATED + 1))
419+
420+
# Update the tracker file to mark as created (using temporary approach)
421+
jq --arg resource "$RESOURCE" --arg issue_num "$ISSUE_NUMBER" --arg issue_url "$ISSUE_URL" '
422+
(.issues_created[] | select(.resource == $resource)) |= (
423+
.status = "created" |
424+
.issue_number = ($issue_num | tonumber) |
425+
.issue_url = $issue_url |
426+
.actual_creation_date = now | strftime("%Y-%m-%dT%H:%M:%SZ")
427+
)' "$TRACKER_FILE" > "${TRACKER_FILE}.tmp" && mv "${TRACKER_FILE}.tmp" "$TRACKER_FILE"
428+
fi
429+
fi
430+
done <<< "$PENDING_FEATURES"
431+
432+
echo "🎯 Post-processing complete: Created $ISSUES_CREATED issues"
433+
echo "issues_created=$ISSUES_CREATED" >> $GITHUB_OUTPUT
434+
292435
- name: Commit feature tracker updates
293436
if: steps.claude-discovery.conclusion == 'success'
294437
run: |
@@ -371,6 +514,22 @@ jobs:
371514
else
372515
echo "- ❌ **Feature Discovery**: Failed" >> $GITHUB_STEP_SUMMARY
373516
fi
517+
518+
# Issue Creation Status
519+
if [ "${{ inputs.dry_run }}" = "true" ]; then
520+
echo "- 🧪 **Issue Creation**: Skipped (dry run mode)" >> $GITHUB_STEP_SUMMARY
521+
elif [ "${{ steps.create-pending-issues.conclusion }}" = "success" ]; then
522+
ISSUES_COUNT="${{ steps.create-pending-issues.outputs.issues_created || '0' }}"
523+
if [ "$ISSUES_COUNT" -gt 0 ]; then
524+
echo "- ✅ **Issue Creation**: Created $ISSUES_COUNT new issues" >> $GITHUB_STEP_SUMMARY
525+
else
526+
echo "- ✅ **Issue Creation**: No new issues needed" >> $GITHUB_STEP_SUMMARY
527+
fi
528+
elif [ "${{ steps.create-pending-issues.conclusion }}" = "skipped" ]; then
529+
echo "- ⏭️ **Issue Creation**: Skipped (no feature discovery or dry run)" >> $GITHUB_STEP_SUMMARY
530+
else
531+
echo "- ❌ **Issue Creation**: Failed or incomplete" >> $GITHUB_STEP_SUMMARY
532+
fi
374533
echo "" >> $GITHUB_STEP_SUMMARY
375534
376535
# Available Commands

0 commit comments

Comments
 (0)