Repository navigation
fix(hosting): deploy 条目数与 preview 共享 128 上限 - #148
Merged
Merged
Conversation
hosting.deploy accepted an unbounded entry list and traversed, authorized and materialized every source before the capacity check, while preview was already capped at 128. Share the bound so a deployment never exceeds what could have been previewed, keeping the published v1 wire schema unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
摘要
Issue #80 的一个网页托管切片(不关闭 #80)。
hosting.preview已由 fix(security): repair rollback pins, lifecycle cleanup and bounded processing #142 限制为最多 128 个条目,但hosting.deploy仍接受任意长度的entries:它会对每个条目做path_name校验、源资源读权限检查和 revision 读取,然后才进行容量检查,最后为每个条目创建一个公开文件资源。MAX_HOSTING_ENTRIES=128,由 preview 和 deploy 共用。deploy 在当前授权与 generation 校验之后、遍历任何源资源之前拒绝超限请求,错误码为too_many_hosting_entries。这样 deploy 的规模不会超过先前能被 preview 展示的规模。maxItems),与 fix(security): repair rollback pins, lifecycle cleanup and bounded processing #142 对 preview 的处理方式一致。测试
tests/test_hosting_same_origin.py新增test_deploy_entry_bound_matches_preview_before_any_materialization:too_many_hosting_entries拒绝;拒绝过程中没有碰内容存储(read_bytes/put_bytes被打桩为失败),resources/revisions/settings行数不变,站点的 revision 仍为空。在真实 PostgreSQL 上运行:
pytest tests/test_hosting_same_origin.py:5 passedpytest tests/test_security_patch_regressions.py tests/test_extensions.py -k "preview or hosting":3 passed不在本 PR 范围
#80 其余项(Transfer、Git/LFS 真实客户端、跨实例预算、断电/备份一致性、真实浏览器渲染验收等)仍未完成。已知的相邻缺口:条目的 path 最长可达 2048 字符,因此 128 个长路径生成的 manifest 可能超过
serve_hosted读取时 64KiB 的上限。本 PR 没有处理这一点,留作后续切片。