Skip to content

Commit c074665

Browse files
Copilotmnkiefer
andcommitted
Update test workflow to use actual TrialOps testing instead of doc validation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
1 parent c3d45ba commit c074665

1 file changed

Lines changed: 132 additions & 64 deletions

File tree

pkg/cli/workflows/test-projectops-pat-requirements.md

Lines changed: 132 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
---
2-
description: Test ProjectOps PAT requirements documentation for user-owned and org-owned Projects v2
2+
description: Test ProjectOps PAT requirements with actual trial repository testing
33
on:
44
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"
518
schedule: weekly on monday
619
permissions:
720
contents: read
@@ -10,7 +23,7 @@ permissions:
1023
pull-requests: read
1124
name: Test ProjectOps PAT Requirements
1225
engine: copilot
13-
timeout-minutes: 30
26+
timeout-minutes: 45
1427
tools:
1528
bash:
1629
- "*"
@@ -21,96 +34,151 @@ safe-outputs:
2134
create-issue:
2235
max: 1
2336
expires: 7d
24-
labels: [documentation, projectops, testing]
37+
labels: [documentation, projectops, testing, trialops]
2538
---
2639

27-
# Test ProjectOps PAT Requirements Documentation
40+
# Test ProjectOps PAT Requirements with TrialOps
2841

29-
This workflow validates the PAT setup documentation for GitHub Projects v2 by creating temporary trial repositories, testing different PAT configurations, and verifying the documented requirements are accurate.
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
3047

31-
## Test Objectives
48+
## Prerequisites
3249

33-
1. **Verify User-owned Projects PAT Requirements**
34-
- Classic PAT with `project` scope works
35-
- Fine-grained PAT does NOT work (as documented)
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
3653

37-
2. **Verify Organization-owned Projects PAT Requirements**
38-
- Classic PAT with `project` + `read:org` works
39-
- Fine-grained PAT with explicit org access + Projects: Read+Write works
40-
- Fine-grained PAT without explicit org access fails (as documented)
54+
## Test Execution
4155

42-
3. **Validate Documentation Accuracy**
43-
- Confirm all setup instructions are correct
44-
- Verify scope requirements match actual API behavior
45-
- Test both public and private repository scenarios
56+
Use `gh aw trial` to test ProjectOps workflows with different PAT configurations in isolated trial repositories:
4657

47-
## Test Execution Plan
58+
### Test 1: User-owned Projects with Classic PAT
4859

49-
**IMPORTANT**: This is a validation test. Do NOT create actual trial repositories or test real PATs. Instead:
60+
Test if a classic PAT with `project` scope can successfully manage user-owned Projects v2.
5061

51-
1. **Review Documentation**: Read the current ProjectOps PAT documentation at:
52-
- `docs/src/content/docs/reference/tokens.md` (GH_AW_PROJECT_GITHUB_TOKEN section)
53-
- `docs/src/content/docs/examples/issue-pr-events/projectops.md` (Token Requirements section)
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
5470

55-
2. **Verify Documented Scopes Match GitHub API Requirements**:
56-
- Check GitHub's official Projects v2 API documentation
57-
- Confirm the documented scopes align with actual API permissions
58-
- Verify the distinction between user and org Projects is accurate
71+
**Expected Result**: Operations should succeed if using classic PAT with `project` scope
5972

60-
3. **Check for Consistency**:
61-
- Ensure all three documentation files have consistent information
62-
- Verify links between documents are correct
63-
- Check that examples match the documented requirements
73+
### Test 2: Organization-owned Projects with Classic PAT
6474

65-
4. **Identify Gaps or Errors**:
66-
- Are there any missing scenarios or edge cases?
67-
- Are the instructions clear enough to follow?
68-
- Are there any contradictions between documents?
75+
Test if a classic PAT with `project` + `read:org` can manage org-owned Projects v2.
6976

70-
## Test Results
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
7184

72-
Create an issue with your findings:
85+
**Expected Result**: Operations should succeed with proper org permissions
7386

74-
**Title**: "ProjectOps PAT Documentation Validation - [PASS/FAIL] - $(date +%Y-%m-%d)"
87+
### Test 3: Organization-owned Projects with Fine-grained PAT
7588

76-
**Body** (use markdown format):
89+
Test if a fine-grained PAT with explicit org access + Projects: Read+Write can manage org-owned Projects.
7790

78-
### Documentation Review
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
7995

80-
- **Consistency Check**: [PASS/FAIL]
81-
- Note: [Explanation if any inconsistencies found]
96+
**Expected Result**: Should work if org access was explicitly granted
8297

83-
- **Scope Accuracy**: [PASS/FAIL]
84-
- User-owned Projects requirements: [Verified/Issues found]
85-
- Org-owned Projects requirements: [Verified/Issues found]
98+
### Test 4: Document Fine-grained PAT Limitation for User Projects
8699

87-
- **Clarity and Completeness**: [PASS/FAIL]
88-
- Missing information: [List if any]
89-
- Unclear instructions: [List if any]
100+
Test and document that fine-grained PATs do NOT work with user-owned Projects.
90101

91-
### Recommendations
102+
**Note**: This test documents the limitation but may not be executable if we don't have a fine-grained PAT configured for comparison.
92103

93-
[List any improvements or clarifications needed]
104+
## Implementation
94105

95-
### GitHub API Documentation Cross-Reference
106+
Execute the following tests using bash commands:
96107

97-
[Link to relevant GitHub API docs that confirm the requirements]
108+
**Step 1**: Create a minimal test workflow that attempts ProjectOps operations
98109

99-
---
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 }}
100137

101-
**Test Metadata**:
102-
- Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
103-
- Repository: ${{ github.repository }}
104-
- Test date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
138+
### Test Configuration
105139

106-
**Labels**: The issue will automatically have `documentation`, `projectops`, and `testing` labels applied.
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+
---
107176

108-
## Notes
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
109182

110-
This test validates documentation accuracy without requiring actual PAT testing, which would require:
111-
- Creating GitHub Apps or PATs with various permission combinations
112-
- Setting up test organizations and user accounts
113-
- Creating and destroying trial repositories
114-
- Managing API rate limits and quota
183+
For manual testing, see the [TrialOps Guide](/gh-aw/guides/trialops/) and [ProjectOps Documentation](/gh-aw/examples/issue-pr-events/projectops/).
115184

116-
For actual integration testing with real PATs, use the `gh aw trial` command with appropriate test repositories as described in the TrialOps guide.

0 commit comments

Comments
 (0)