|
| 1 | +--- |
| 2 | +description: Test ProjectOps PAT requirements with actual trial repository testing |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + test_user_projects: |
| 7 | + description: "Test user-owned Projects (requires classic PAT in GH_AW_PROJECT_GITHUB_TOKEN)" |
| 8 | + type: boolean |
| 9 | + default: "true" |
| 10 | + test_org_projects: |
| 11 | + description: "Test org-owned Projects (requires PAT with org access)" |
| 12 | + type: boolean |
| 13 | + default: "true" |
| 14 | + cleanup_trial_repos: |
| 15 | + description: "Delete trial repositories after testing" |
| 16 | + type: boolean |
| 17 | + default: "true" |
| 18 | + schedule: weekly on monday |
| 19 | +permissions: |
| 20 | + contents: read |
| 21 | + actions: read |
| 22 | + issues: read |
| 23 | + pull-requests: read |
| 24 | +name: Test ProjectOps PAT Requirements |
| 25 | +engine: copilot |
| 26 | +timeout-minutes: 45 |
| 27 | +tools: |
| 28 | + bash: |
| 29 | + - "*" |
| 30 | + github: |
| 31 | + mode: remote |
| 32 | + toolsets: [default] |
| 33 | +safe-outputs: |
| 34 | + create-issue: |
| 35 | + max: 1 |
| 36 | + expires: 7d |
| 37 | + labels: [documentation, projectops, testing, trialops] |
| 38 | +--- |
| 39 | + |
| 40 | +# Test ProjectOps PAT Requirements with TrialOps |
| 41 | + |
| 42 | +This workflow performs actual integration testing of ProjectOps PAT requirements by: |
| 43 | +1. Creating trial repositories |
| 44 | +2. Testing different PAT configurations with actual GitHub Projects v2 API calls |
| 45 | +3. Verifying documented requirements match real behavior |
| 46 | +4. Cleaning up trial repositories after testing |
| 47 | + |
| 48 | +## Prerequisites |
| 49 | + |
| 50 | +This test requires PATs to be configured: |
| 51 | +- `GH_AW_PROJECT_GITHUB_TOKEN`: PAT for testing (should have appropriate project scopes) |
| 52 | +- The workflow will test if the configured PAT works as documented |
| 53 | + |
| 54 | +## Test Execution |
| 55 | + |
| 56 | +Use `gh aw trial` to test ProjectOps workflows with different PAT configurations in isolated trial repositories: |
| 57 | + |
| 58 | +### Test 1: User-owned Projects with Classic PAT |
| 59 | + |
| 60 | +Test if a classic PAT with `project` scope can successfully manage user-owned Projects v2. |
| 61 | + |
| 62 | +**Steps**: |
| 63 | +1. Create a trial repository: `gh-aw-trial-projectops-user` |
| 64 | +2. Create a test workflow that uses `update-project` to: |
| 65 | + - Add an issue to a user-owned Project |
| 66 | + - Update project fields |
| 67 | + - Verify the operations succeed |
| 68 | +3. Run the workflow with the configured PAT |
| 69 | +4. Check if operations succeed as documented |
| 70 | + |
| 71 | +**Expected Result**: Operations should succeed if using classic PAT with `project` scope |
| 72 | + |
| 73 | +### Test 2: Organization-owned Projects with Classic PAT |
| 74 | + |
| 75 | +Test if a classic PAT with `project` + `read:org` can manage org-owned Projects v2. |
| 76 | + |
| 77 | +**Steps**: |
| 78 | +1. Create a trial repository in an organization context |
| 79 | +2. Create a test workflow that uses `update-project` to: |
| 80 | + - Add an issue to an org-owned Project |
| 81 | + - Update project fields |
| 82 | + - Verify the operations succeed |
| 83 | +3. Run with classic PAT having `project` + `read:org` scopes |
| 84 | + |
| 85 | +**Expected Result**: Operations should succeed with proper org permissions |
| 86 | + |
| 87 | +### Test 3: Organization-owned Projects with Fine-grained PAT |
| 88 | + |
| 89 | +Test if a fine-grained PAT with explicit org access + Projects: Read+Write can manage org-owned Projects. |
| 90 | + |
| 91 | +**Steps**: |
| 92 | +1. Use the same trial repository |
| 93 | +2. Test with fine-grained PAT (if configured separately) |
| 94 | +3. Verify org-owned project operations work |
| 95 | + |
| 96 | +**Expected Result**: Should work if org access was explicitly granted |
| 97 | + |
| 98 | +### Test 4: Document Fine-grained PAT Limitation for User Projects |
| 99 | + |
| 100 | +Test and document that fine-grained PATs do NOT work with user-owned Projects. |
| 101 | + |
| 102 | +**Note**: This test documents the limitation but may not be executable if we don't have a fine-grained PAT configured for comparison. |
| 103 | + |
| 104 | +## Implementation |
| 105 | + |
| 106 | +Execute the following tests using bash commands: |
| 107 | + |
| 108 | +**Step 1**: Create a minimal test workflow that attempts ProjectOps operations |
| 109 | + |
| 110 | +**Step 2**: Use `gh aw trial` command to run the workflow in an isolated trial repository |
| 111 | + |
| 112 | +**Step 3**: Analyze the results to determine if the configured PAT works as documented |
| 113 | + |
| 114 | +**Step 4**: Report findings in an issue |
| 115 | + |
| 116 | +The AI agent will: |
| 117 | +1. Generate a test workflow dynamically |
| 118 | +2. Execute it using the gh-aw trial command with appropriate flags |
| 119 | +3. Parse the results to determine PAT permission compatibility |
| 120 | +4. Create a summary issue with findings |
| 121 | + |
| 122 | +This provides real integration testing of the documented PAT requirements using actual GitHub Projects v2 API operations. |
| 123 | + |
| 124 | +## Test Results Report |
| 125 | + |
| 126 | +Create an issue summarizing the test results: |
| 127 | + |
| 128 | +**Title**: "ProjectOps PAT TrialOps Test Results - $(date +%Y-%m-%d)" |
| 129 | + |
| 130 | +**Body**: |
| 131 | + |
| 132 | +### Test Summary |
| 133 | + |
| 134 | +**Test Date**: $(date -u +"%Y-%m-%d %H:%M:%S UTC") |
| 135 | +**Trial Repository**: [Link to trial repo if not deleted] |
| 136 | +**Workflow Run**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 137 | + |
| 138 | +### Test Configuration |
| 139 | + |
| 140 | +- User-owned Projects Test: Configured via workflow dispatch input |
| 141 | +- Org-owned Projects Test: Configured via workflow dispatch input |
| 142 | +- Cleanup Trial Repos: Configured via workflow dispatch input |
| 143 | + |
| 144 | +### Results |
| 145 | + |
| 146 | +#### User-owned Projects |
| 147 | +- **Classic PAT with project scope**: [PASS/FAIL/NOT_TESTED] |
| 148 | + - Details: [Error messages or success confirmation] |
| 149 | + |
| 150 | +- **Fine-grained PAT**: [EXPECTED_TO_FAIL/NOT_TESTED] |
| 151 | + - Details: [Confirmation of documented limitation] |
| 152 | + |
| 153 | +#### Organization-owned Projects |
| 154 | +- **Classic PAT with project + read:org**: [PASS/FAIL/NOT_TESTED] |
| 155 | + - Details: [Error messages or success confirmation] |
| 156 | + |
| 157 | +- **Fine-grained PAT with org access**: [PASS/FAIL/NOT_TESTED] |
| 158 | + - Details: [Error messages or success confirmation] |
| 159 | + |
| 160 | +### Documentation Validation |
| 161 | + |
| 162 | +- **Documentation Accuracy**: [CONFIRMED/ISSUES_FOUND] |
| 163 | +- **Issues Found**: [List any discrepancies between docs and actual behavior] |
| 164 | + |
| 165 | +### Recommendations |
| 166 | + |
| 167 | +[Any updates needed to documentation based on test results] |
| 168 | + |
| 169 | +### Trial Artifacts |
| 170 | + |
| 171 | +- Trial repository: [URL or "Deleted after test"] |
| 172 | +- Trial results JSON: [Path to local results file] |
| 173 | +- GitHub Actions logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +**Note**: These tests use actual GitHub Projects v2 API calls with configured PATs. Results may vary based on: |
| 178 | +- PAT type and scopes configured |
| 179 | +- Organization settings and policies |
| 180 | +- Project ownership (user vs org) |
| 181 | +- GitHub API rate limits |
| 182 | + |
| 183 | +For manual testing, see the [TrialOps Guide](/gh-aw/guides/trialops/) and [ProjectOps Documentation](/gh-aw/examples/issue-pr-events/projectops/). |
| 184 | + |
0 commit comments