-
Notifications
You must be signed in to change notification settings - Fork 13
Automated test resource cleanup #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jhamon
merged 5 commits into
main
from
cursor/SDK-58-automated-test-resource-cleanup-d78b
Jan 14, 2026
+513
−13
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1e8e25a
feat: add automated test resource cleanup workflow
cursoragent 334a2c9
Potential fix for code scanning alert no. 14: Workflow does not conta…
jhamon c6f4a09
Fix cleanup deleted counts for dry-run/skips
cursoragent 718d30d
Enable Byte Buddy experimental mode on Java 21
cursoragent 86c7104
Fix NPEs in IndexCleanupUtility list handling
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| name: Cleanup Test Resources | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| # Scheduled execution - daily at 2 AM UTC | ||
| schedule: | ||
| - cron: '0 2 * * *' | ||
|
|
||
| # Manual trigger with optional inputs | ||
| workflow_dispatch: | ||
| inputs: | ||
| age_threshold_days: | ||
| description: 'Minimum age in days for resources to be deleted' | ||
| required: false | ||
| default: '1' | ||
| type: number | ||
| dry_run: | ||
| description: 'Preview deletions without executing (dry-run mode)' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| jobs: | ||
| cleanup: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 8 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '8' | ||
| cache: 'gradle' | ||
|
|
||
| - name: Build project | ||
| run: ./gradlew build -x test | ||
|
|
||
| - name: Run cleanup utility | ||
| env: | ||
| PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | ||
| run: | | ||
| # Determine parameters based on trigger type | ||
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
| AGE_THRESHOLD=${{ inputs.age_threshold_days }} | ||
| DRY_RUN=${{ inputs.dry_run }} | ||
| else | ||
| # Scheduled run uses default values | ||
| AGE_THRESHOLD=1 | ||
| DRY_RUN=false | ||
| fi | ||
|
|
||
| # Build command with arguments | ||
| ARGS="--age-threshold-days $AGE_THRESHOLD" | ||
| if [ "$DRY_RUN" = "true" ]; then | ||
| ARGS="$ARGS --dry-run" | ||
| fi | ||
|
|
||
| echo "Running cleanup with: $ARGS" | ||
|
|
||
| # Run the cleanup utility | ||
| java -cp "build/libs/*:build/classes/java/main" \ | ||
| io.pinecone.helpers.IndexCleanupUtility $ARGS | ||
|
|
||
| - name: Summary | ||
| if: always() | ||
| run: | | ||
| if [ "${{ job.status }}" = "success" ]; then | ||
| echo "✅ Cleanup completed successfully" | ||
| else | ||
| echo "❌ Cleanup failed - check logs for details" | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.