-
Notifications
You must be signed in to change notification settings - Fork 184
fix(ci): stop leaking vaults and add cleanup safety net #910
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
Changes from 1 commit
7d06067
9637c69
ba240e4
692db3f
616cf33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| name: cleanup-ci-vaults | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| include_persona: | ||
| description: "Also delete persona-owned vaults" | ||
| required: false | ||
| default: "false" | ||
| type: choice | ||
| options: | ||
| - "false" | ||
| - "true" | ||
| dry_run: | ||
| description: "List vaults without deleting" | ||
| required: false | ||
| default: "false" | ||
| type: choice | ||
| options: | ||
| - "false" | ||
| - "true" | ||
|
|
||
| jobs: | ||
| cleanup: | ||
| runs-on: blacksmith-4vcpu-ubuntu-2404 | ||
| timeout-minutes: 30 | ||
| env: | ||
| NOTTE_API_KEY: ${{ secrets.NOTTE_API_KEY }} | ||
| # Match docs execution tests (default API host used by notte-sdk). | ||
| DISABLE_TELEMETRY: "true" | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version-file: ".python-version" | ||
|
|
||
| - name: Install notte-sdk | ||
| run: uv pip install --system notte-sdk | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: New cleanup workflow installs notte-sdk from PyPI unpinned in a job that exposes the NOTTE_API_KEY secret
Pin notte-sdk to an exact version with --require-hashes, or install from the checked-out repo workspace. AI prompt |
||
|
|
||
| - name: Cleanup leaked vaults | ||
| run: | | ||
| ARGS=() | ||
| if [ "${{ inputs.dry_run }}" = "true" ]; then | ||
| ARGS+=(--dry-run) | ||
| fi | ||
| if [ "${{ inputs.include_persona }}" = "true" ]; then | ||
| ARGS+=(--include-persona) | ||
| fi | ||
| python scripts/cleanup_ci_vaults.py "${ARGS[@]}" | ||
|
Comment on lines
+35
to
+70
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| # @sniptest filename=concept_vault.py | ||
| # @sniptest show=5-9 | ||
| # @sniptest show=4-7 | ||
| from notte_sdk import NotteClient | ||
|
|
||
| client = NotteClient() | ||
| with client.Session() as session: | ||
| vault = client.Vault() | ||
| with client.Session() as session, client.Vault() as vault: | ||
| vault.add_credentials(url="https://github.com", email="...", password="...") | ||
| agent = client.Agent(session=session, vault=vault) | ||
| agent.run(task="Login to GitHub") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Complete the aged-orphan cleanup backstop.
The workflow has no scheduled trigger. The cleanup function only selects exact
defaultnames. Stalepytest-*andtest-*vaults therefore remain active until a user manually intervenes. This can return the account to the active-vault limit and cause CI vault creation to fail with HTTP 429..github/workflows/cleanup-ci-vaults.yml#L3-L5: add a scheduled invocation for--orphan-defaults --min-age-hours 2.scripts/ci_vault_scope.py#L177-L177: include the intended legacy ephemeral-name patternsdefault,pytest-*, andtest-*before applying the age check.📍 Affects 2 files
.github/workflows/cleanup-ci-vaults.yml#L3-L5(this comment)scripts/ci_vault_scope.py#L177-L177🤖 Prompt for AI Agents