{"record":{"id":"dc282eed3fab6ebc","repo":"theonedev/onedev","slug":"review-required-for-this-change-please-submit-pul","errorCode":null,"errorMessage":"Review required for this change. Please submit pull request instead","messagePattern":"Review required for this change\\. Please submit pull request instead","errorType":"exception","errorClass":"BlobEditException","httpStatus":null,"severity":"warning","filePath":"server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java","lineNumber":1633,"sourceCode":"\t\t}\n\t\t\n\t\tUser user = Preconditions.checkNotNull(SecurityUtils.getAuthUser());\n\t\tBlobIdent blobIdent = getBlobIdent();\n\t\t\n\t\tboolean signRequired = false;\n\t\tfor (var item: upload.getItems()) {\n\t\t\tString blobPath = FilenameUtils.sanitizeFileName(FileUpload.getFileName(item));\n\t\t\tif (parentPath != null)\n\t\t\t\tblobPath = parentPath + \"/\" + blobPath;\n\t\t\tvar blobType = FileExtension.getExtension(blobPath);\n\n\t\t\tvar disallowedFileTypes = getProject().getBranchProtection(blobIdent.revision, user).getDisallowedFileTypes();\n\t\t\tif (disallowedFileTypes.stream().anyMatch(type -> type.equalsIgnoreCase(blobType))) {\n\t\t\t\tthrow new BlobEditException(MessageFormat.format(_T(\"Not allowed file type: {0}\"), blobType));\n\t\t\t}\n\n\t\t\tif (getProject().isReviewRequiredForModification(user, blobIdent.revision, blobPath)) \n\t\t\t\tthrow new BlobEditException(_T(\"Review required for this change. Please submit pull request instead\"));\n\t\t\telse if (getProject().isBuildRequiredForModification(user, blobIdent.revision, blobPath)) \n\t\t\t\tthrow new BlobEditException(_T(\"Build required for this change. Please submit pull request instead\"));\n\t\t\telse if (getProject().isCommitSignatureRequiredButNoSigningKey(user, blobIdent.revision)) \n\t\t\t\tsignRequired = true;\n\t\t\t\n\t\t\tBlobContent blobContent = new BlobContent(item.get(), FileMode.REGULAR_FILE.getBits());\n\t\t\tnewBlobs.put(blobPath, blobContent);\n\t\t}\n\n\t\tBlobEdits blobEdits = new BlobEdits(Sets.newHashSet(), newBlobs);\n\t\tString refName = blobIdent.revision!=null? GitUtils.branch2ref(blobIdent.revision):\"refs/heads/main\";\n\n\t\tObjectId prevCommitId;\n\t\tif (blobIdent.revision != null)\n\t\t\tprevCommitId = getProject().getRevCommit(blobIdent.revision, true).copy();\n\t\telse\n\t\t\tprevCommitId = ObjectId.zeroId();\n","sourceCodeStart":1615,"sourceCodeEnd":1651,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java#L1615-L1651","documentation":"When saving a blob edit, ProjectBlobPage calls Project.isReviewRequiredForModification; if the branch protection requires review for modifications to that path, a BlobEditException instructs the user to submit a pull request instead of committing directly.","triggerScenarios":"Direct web-editor commit to a branch whose protection marks the changed file path as review-required (review requirement matching the blob path).","commonSituations":"Editing protected files (e.g. build specs, critical config) on main via the web UI; a path-based review rule was added after the user last edited the file.","solutions":["Create a branch, commit there, and open a pull request for review","Adjust the branch protection review-required rules if direct commits should be allowed","Commit as a user/role exempt from the review requirement, if your setup defines one"],"exampleFix":"// before: commit directly to main via web editor\n// after: edit on branch feature/x, push, then open a pull request against main","handlingStrategy":"validation","validationCode":"if (project.isReviewRequiredForModification(user, revision, path)) {\n    // route user to create-branch + PR flow instead of direct commit\n}","typeGuard":null,"tryCatchPattern":"try {\n    saveBlob();\n} catch (BlobEditException e) {\n    offerPullRequestWorkflow();\n}","preventionTips":["Default to branch+PR flow for edits on protected branches","Check review-required path rules before web-editing critical files","Keep branch protection rules documented for contributors"],"tags":["branch-protection","pull-request","review-required","blob-edit"],"backgroundTag":"permission-denied","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}