You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: utils/stackoverflow/README.md
+75Lines changed: 75 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -377,6 +377,81 @@ The script provides detailed feedback including:
377
377
3. Use `--force` only in automated scripts where confirmation isn't possible
378
378
4. Monitor the logs for any failures during bulk operations
379
379
380
+
## Discussion Deletion (delete_discussions.py)
381
+
A utility script for deleting specific GitHub Discussions based on Stack Overflow question IDs. This tool is particularly useful for cleaning up failed migrations or removing specific discussions that need to be re-migrated.
382
+
383
+
### Requirements
384
+
* Python 3.x
385
+
* Dependencies listed in requirements.txt
386
+
* GitHub App with appropriate permissions (Contents, Discussions, Metadata)
387
+
388
+
### Setup
389
+
1. Install the required dependencies:
390
+
```
391
+
pip install -r requirements.txt
392
+
```
393
+
2. Set up GitHub App authentication by setting these environment variables:
Create a text file with one question ID per line. Comments (lines starting with #) are ignored:
432
+
```
433
+
# Failed question IDs from populate_discussion.py run
434
+
# Lines starting with # are ignored
435
+
436
+
1354
437
+
1320
438
+
1321
439
+
1285
440
+
```
441
+
442
+
443
+
### Output
444
+
The script provides the following feedback:
445
+
- Number of question IDs loaded and found in SO data
446
+
- Per-discussion processing status with titles
447
+
- Progress updates during deletion
448
+
- Summary statistics (deleted, not found, errors)
449
+
- All operations logged to `delete_discussions.log`
450
+
451
+
### Safety Warnings
452
+
⚠️ **DESTRUCTIVE OPERATION**: This script permanently deletes GitHub discussions and all their comments. This action cannot be undone.
453
+
454
+
380
455
## URL Validation with Playwright (validate_urls_playwright.py)
381
456
A browser-based URL validation tool that checks if URLs return HTTP 301 redirects. This script is used for validating redirects to GitHub that require SSO authentication, which cannot be tested programmatically with standard HTTP libraries.
0 commit comments