Skip to content

Fix: [DEV3-5002] Add cleanup step to remove settings.json for self-hosted runners#30

Merged
Pavel-tabnine merged 4 commits into
mainfrom
fix/cleanup-settings-json-self-hosted-runners
Apr 19, 2026
Merged

Fix: [DEV3-5002] Add cleanup step to remove settings.json for self-hosted runners#30
Pavel-tabnine merged 4 commits into
mainfrom
fix/cleanup-settings-json-self-hosted-runners

Conversation

@Pavel-tabnine
Copy link
Copy Markdown
Contributor

@Pavel-tabnine Pavel-tabnine commented Apr 13, 2026

Problem

Self-hosted / named GHES runners do not wipe the workspace between runs. This causes settings.json (which contains Tabnine auth credentials) to persist across consecutive PR review jobs, leaking state between runs.

Fix

Add an unconditional cleanup step (if: always()) at the end of the composite action that deletes ~/.tabnine/agent/settings.json after every run — on both success and failure.

Impact

  • ✅ Self-hosted / named GHES runners no longer retain settings.json between runs
  • ✅ No impact on ephemeral GitHub-hosted runners (file is deleted either way)
  • ✅ Runs unconditionally so cleanup happens even if the review step fails

Fixes DEV3-5002

Self-hosted / named GHES runners do not wipe the workspace between
runs, causing settings.json (which contains auth credentials) to
persist and leak state across consecutive PR review jobs.

Add an unconditional post-run step (if: always()) that deletes
~/.tabnine/agent/settings.json, ensuring no sensitive data is
retained between runs regardless of success or failure.

Fixes DEV3-5002
Self-hosted / named runners retain the workspace between runs,
causing settings.json to persist across jobs. Add opt-in cleanup
controlled by the TABNINE_CLEANUP env var (set to "true" to enable).

- GitHub Actions (GitHub/tabnine-review.yml): new post-step with if: always()
- Bitbucket Pipelines (Bitbucket/bitbucket-pipelines.yml): appended shell block
- GitLab CI (.gitlab-ci.yml): after_script block

The action.yml composite already received the cleanup in the previous
commit; this adds the same protection (as opt-in) to the standalone
workflow templates.

Relates to DEV3-5002
Add a 'cleanup' input (default: empty / off) and gate the cleanup
step on inputs.cleanup == 'true', consistent with the TABNINE_CLEANUP
env var approach used in the standalone CI templates.

Relates to DEV3-5002
Clarifies intent: cleanup is opt-in and defaults to false rather than
an empty/unset value, making it consistent and unambiguous across all
CI integrations.
@Pavel-tabnine Pavel-tabnine changed the title Fix: Add cleanup step to remove settings.json for self-hosted runners Fix: [DEV3-5002] Add cleanup step to remove settings.json for self-hosted runners Apr 13, 2026
Copy link
Copy Markdown

@amirbilu amirbilu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in my experience, cleanups are the workflow job

@Pavel-tabnine Pavel-tabnine merged commit 1f086a7 into main Apr 19, 2026
1 of 2 checks passed
@Pavel-tabnine Pavel-tabnine deleted the fix/cleanup-settings-json-self-hosted-runners branch April 21, 2026 07:45
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