Skip to content

[codex] add quota-triggered Deno 2 app GC#19

Merged
0x4007 merged 1 commit into
codex/deno-2-programmaticfrom
codex/deno2-quota-gc
Apr 29, 2026
Merged

[codex] add quota-triggered Deno 2 app GC#19
0x4007 merged 1 commit into
codex/deno-2-programmaticfrom
codex/deno2-quota-gc

Conversation

@0x4007

@0x4007 0x4007 commented Apr 29, 2026

Copy link
Copy Markdown
Member

Summary

  • add quota-triggered Deno 2 app garbage collection to the reusable deploy workflow
  • retry app creation once after deleting the oldest generated-looking preview/branch app
  • document the default protections and optional candidate/protected app inputs

Behavior

  • GC only runs after deno deploy create fails with Deno's app quota error code.
  • It keys only on the observed REST code APP_LIMIT_EXCEEDED, not the human message text.
  • It never deletes the current target, production app, preview app, or explicitly protected slugs.
  • It deletes at most one generated-looking app per failed create attempt, then retries creation once.

Validation

  • ACTIONLINT_PATHS=. ./scripts/lint-actions.sh
  • git diff --check
  • live Deno Deploy REST quota probe: HTTP 400, APP_LIMIT_EXCEEDED
  • exact-code smoke test against APP_LIMIT_EXCEEDED
  • non-destructive live app-list smoke test identified only ai-ubq-fi-codex-fix-responses-de as a current GC candidate

@0x4007 0x4007 force-pushed the codex/deno2-quota-gc branch from cdb031f to 1c742bd Compare April 29, 2026 06:45
@0x4007

0x4007 commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c742bd00a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return generatedAfterUosApp.test(slug) || /^pr-\d+-/.test(slug) || /-pr-\d+(?:-|$)/.test(slug);
}

const client = new Client();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Provide org to quota GC Client initialization

run_deno2_quota_gc creates the SDK client with new Client() but never passes the organization slug, even though the @deno/sandbox BaseClientOptions docs state org is required when using a personal access token. In repos that use PAT-based DENO_DEPLOY_TOKEN (the same workflows already pass --org to deno deploy commands), this GC path will fail before it can list/delete candidates, so quota-triggered retries do not work when app creation hits the limit.

Useful? React with 👍 / 👎.

@0x4007 0x4007 force-pushed the codex/deno2-quota-gc branch from 1c742bd to 015dcfd Compare April 29, 2026 08:02
@0x4007

0x4007 commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 015dcfd093

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# shellcheck disable=SC2016
GC_TARGET_APP="$project" \
GC_PROJECT="${PROJECT:-}" \
GC_PREVIEW_PROJECT="${PREVIEW_PROJECT:-}" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Protect the resolved preview slug during quota GC

Pass the computed preview project slug here instead of ${PREVIEW_PROJECT}. When callers omit preview_project (the common/default case), PREVIEW_PROJECT is empty and the workflow derives the preview slug earlier in Determine target project; because this value is not forwarded into GC_PREVIEW_PROJECT, the active preview app is not added to protectedApps. If deno2_quota_gc_candidate_prefixes is configured broadly (for example to match p-... branch/preview naming), the GC path can delete the current preview app even though it is intended to be protected.

Useful? React with 👍 / 👎.

@0x4007 0x4007 force-pushed the codex/deno2-quota-gc branch 2 times, most recently from 169e9ab to 7eee9d2 Compare April 29, 2026 08:18
@0x4007

0x4007 commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@0x4007 0x4007 force-pushed the codex/deno2-quota-gc branch from 7eee9d2 to ae8b8e7 Compare April 29, 2026 08:31
@0x4007

0x4007 commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@0x4007

0x4007 commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@codex review

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@0x4007 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 3 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 38bcd589-b159-45b4-8721-7cc63b6c9731

📥 Commits

Reviewing files that changed from the base of the PR and between ae8b8e7 and 7e5940b.

📒 Files selected for processing (2)
  • .github/workflows/deno-deploy-reusable.yml
  • README.md
📝 Walkthrough

Walkthrough

The pull request introduces Deno 2 quota garbage-collection functionality to the deployment workflow. Three new configurable inputs are added: deno2_quota_gc, deno2_quota_gc_protected_apps, and deno2_quota_gc_candidate_prefixes. When app creation fails due to quota limits, the workflow automatically triggers a GC routine that deletes the oldest app among candidates, while excluding protected apps (production, target, preview, and user-specified). After deletion, app creation is retried once. The README documentation is updated to describe this behavior and configuration options.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding quota-triggered garbage collection for Deno 2 apps to the workflow.
Description check ✅ Passed The description is well-related to the changeset, covering the summary, behavior, and validation of the quota-triggered GC feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/deno2-quota-gc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 52 minutes and 3 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai Bot previously requested changes Apr 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e75bfb10-f73a-4ed2-81e4-7ebaf3223e86

📥 Commits

Reviewing files that changed from the base of the PR and between bc1b229 and ae8b8e7.

📒 Files selected for processing (2)
  • .github/workflows/deno-deploy-reusable.yml
  • README.md

Comment thread .github/workflows/deno-deploy-reusable.yml
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@0x4007 0x4007 force-pushed the codex/deno2-quota-gc branch from ae8b8e7 to 7e5940b Compare April 29, 2026 08:50
@0x4007

0x4007 commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@0x4007

0x4007 commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

@codex review

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@0x4007 0x4007 dismissed coderabbitai[bot]’s stale review April 29, 2026 08:58

Dismissed after addressing CodeRabbit feedback on the latest PR head. The quota matcher now requires APP_LIMIT_EXCEEDED as a standalone token, the CodeRabbit thread is resolved, Codex reported no major issues, and CI is green.

@0x4007 0x4007 marked this pull request as ready for review April 29, 2026 09:01
@0x4007 0x4007 merged commit a55767a into codex/deno-2-programmatic Apr 29, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e5940b4f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

echo "Attempting Deno 2 quota GC before retrying app creation."
# shellcheck disable=SC2016
GC_TARGET_APP="$project" \
GC_PROJECT="${PROJECT:-}" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Protect resolved production slug during quota GC

Use the resolved production slug here instead of the raw PROJECT input. When callers omit project (the default path), PROJECT is empty, and in preview mode GC_TARGET_APP/GC_PREVIEW_PROJECT both point to the preview app, so the production app never enters protectedApps (protectedApps is built from target, project, previewProject, and custom entries). With a broad deno2_quota_gc_candidate_prefixes value, the GC filter can then select and delete the production app, contradicting the documented guarantee that production is always protected.

Useful? React with 👍 / 👎.

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.

1 participant