Commit 67fad29
[CI] Add new github commands for quarantining/disabling tests (dotnet#13558)
* [CI] Add new github commands for quarantining/disabling tests
This PR introduces GitHub issue/PR comment commands for managing test attributes:
## New Commands
### Quarantine Tests (flaky tests)
- `/quarantine-test <test-name> <issue-url>` - Add [QuarantinedTest] attribute
- `/unquarantine-test <test-name>` - Remove [QuarantinedTest] attribute
### Disable Tests (ActiveIssue)
- `/disable-test <test-name> <issue-url>` - Add [ActiveIssue] attribute
- `/enable-test <test-name>` - Remove [ActiveIssue] attribute
## Usage
Commands can be used on:
- **Issues**: Creates a new PR with the changes
- **Pull Requests**: Pushes changes directly to the PR branch
- **With --target-pr**: Pushes to a specified PR regardless of where command is posted
## Examples
```
/quarantine-test Namespace.Class.TestMethod dotnet#1234
/disable-test Namespace.Class.FlakyTest dotnet#5678
/unquarantine-test Namespace.Class.TestMethod
/enable-test Namespace.Class.TestMethod
```
## Implementation Details
- Uses QuarantineTools from tools/QuarantineTools for source modifications
- Supports both quarantine mode ([QuarantinedTest]) and activeissue mode ([ActiveIssue])
- Validates user has write access before executing
- Posts progress comments and links to resulting PR
* Update README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update apply-test-attributes.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update .github/workflows/apply-test-attributes.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix shell injection vulnerabilities and null check in workflow
- Replace execSync with spawnSync for git commands to prevent shell injection
- Add runGit() helper that passes args as array (no shell interpretation)
- Add null check for pr.head.repo when detecting fork PRs
- Addresses Copilot review feedback on PR dotnet#13558
* Pin actions/github-script to SHA for security best practices
* Replace execSync with spawnSync for git config commands
For consistency with the rest of the script and to follow safer practices,
use the runGit helper (which uses spawnSync) for git config commands instead
of execSync. This avoids shell injection vulnerabilities as a defense-in-depth
measure, even though the current hardcoded strings were safe.
* Use os.tmpdir() fallback for cross-platform temp directory compatibility
* Update ci.yml
* add zizmor ignore
* Use runId instead of timestamp for branch name uniqueness
* Add to copilot instructions
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 7d68940 commit 67fad29
File tree
4 files changed
+866
-3
lines changed- .github
- workflows
4 files changed
+866
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
169 | 236 | | |
170 | 237 | | |
171 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
0 commit comments