Repository navigation
fix(functions): require ownership when duplicating deployments - #13113
Merged
Merged
Conversation
Reject createDuplicateDeployment when the deployment belongs to a different function or resource type, matching Get/Delete/Status and Sites duplicate. Adds an e2e ownership regression test. Co-authored-by: Chirag Aggarwal <[email protected]>
Co-authored-by: Chirag Aggarwal <[email protected]>
This was referenced Aug 6, 2026
Contributor
Greptile SummaryThe PR prevents deployment source from being duplicated across functions by requiring both the deployment resource ID and type to match the function in the request path.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "chore: retrigger flaky FunctionsSchedule..." | Re-trigger Greptile |
Co-authored-by: Chirag Aggarwal <[email protected]>
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
ChiragAgg5k
approved these changes
Aug 6, 2026
This was referenced Aug 6, 2026
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.
What does this PR do?
POST /v1/functions/:functionId/deployments/duplicateloaded a deployment by ID and rebuilt it under the URL function without verifying ownership. A caller with write access to function B could pass function A'sdeploymentIdand copy A's source into B.This adds the same
resourceId+resourceTypeguard used by cancel (Status/Update) and returnsDEPLOYMENT_NOT_FOUND, matching Get/Delete/Download. Supersedes stale conflicting #11916 (which lackedresourceTypeand e2e).Also adds
testCreateDuplicateDeploymentRequiresOwnership.Test Plan
testCreateDuplicateDeploymentRequiresOwnership— foreign functionId → 404; owning functionId → 202Related PRs and Issues
Checklist