Skip to content

BUILD-10242: Add automatic post-action cleanup for WARP - #18

Merged
jayadeep-km-sonarsource merged 1 commit into
masterfrom
feat/jd/BUILD-10242-post-action
Jan 28, 2026
Merged

jayadeep-km-sonarsource merged 1 commit into
masterfrom
feat/jd/BUILD-10242-post-action

Conversation

@jayadeep-km-sonarsource

@jayadeep-km-sonarsource jayadeep-km-sonarsource commented Jan 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds automatic cleanup of WARP connections after GitHub Actions jobs complete, preventing runners from remaining connected and avoiding resource leaks.

Changes

  • Helper action: Creates with-post-step helper action using Node.js post-job lifecycle hooks
  • Cleanup script: Disconnects WARP and deletes registration automatically after job completion
  • Tests: Adds ShellSpec tests for cleanup functionality
  • 2-second delay: Ensures logs are flushed before network changes

Note

The helper action currently references the feature branch directly. I tried to use various options to use the local action directly, none of them seems to work with the post step. I have tried the approach that ci-github-actions took to refer get-build-number action in config-maven action using Set local action paths step, but it fails in the post action step.
The helper action is unlikely to change as much. So i will just refer to v2 branch directly before merge.

Test Plan

Tested on https://github.com/SonarSource/sonar-dummy/actions/runs/21437660464/job/61747687446

@jayadeep-km-sonarsource
jayadeep-km-sonarsource requested a review from a team January 28, 2026 07:56
@jayadeep-km-sonarsource
jayadeep-km-sonarsource marked this pull request as draft January 28, 2026 07:56
@jayadeep-km-sonarsource
jayadeep-km-sonarsource changed the base branch from master to feat/jd/BUILD-10242-refactor-prequisites January 28, 2026 07:57
@jayadeep-km-sonarsource
jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-10242-post-action branch 3 times, most recently from 06fa2c4 to e17d34e Compare January 28, 2026 08:28
@jayadeep-km-sonarsource
jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-10242-refactor-prequisites branch 3 times, most recently from ea41b46 to 26e4ce2 Compare January 28, 2026 11:03
Base automatically changed from feat/jd/BUILD-10242-refactor-prequisites to master January 28, 2026 11:07
@jayadeep-km-sonarsource
jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-10242-post-action branch 6 times, most recently from 3e1840a to 1f07115 Compare January 28, 2026 14:46
@jayadeep-km-sonarsource
jayadeep-km-sonarsource marked this pull request as ready for review January 28, 2026 14:46
Comment thread spec/cleanup-warp_spec.sh Outdated
Comment thread action.yml Outdated
Comment thread action.yml
Comment thread action.yml Outdated
Comment thread action.yml
Adds automatic cleanup of WARP connections after GitHub Actions jobs complete,
preventing runners from remaining connected and avoiding resource leaks.

Implementation:
- Create with-post-step helper action using Node.js post-job lifecycle hooks
- Add cleanup-warp.sh script to disconnect and delete WARP registration
- Update action.yml to use helper action with automatic cleanup via branch reference
- Add ShellSpec tests for cleanup script
- Include 2-second delay before disconnect to ensure log flushing

The helper action references feat/jd/BUILD-10242-post-action branch directly.
After merge, this should be updated to reference the stable version branch.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jayadeep-km-sonarsource
jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-10242-post-action branch from 1f07115 to e75f496 Compare January 28, 2026 18:21
@jayadeep-km-sonarsource
jayadeep-km-sonarsource merged commit 547af99 into master Jan 28, 2026
2 checks passed
@jayadeep-km-sonarsource
jayadeep-km-sonarsource deleted the feat/jd/BUILD-10242-post-action branch January 28, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants