-
Notifications
You must be signed in to change notification settings - Fork 34
Add allow-empty field to create-pull-request safe output #6034
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
Conversation
Co-authored-by: pelikhan <[email protected]>
- Add allow-empty field to CreatePullRequestsConfig struct - Add allow-empty to JSON schema with description - Parse allow-empty field from config and pass to JavaScript via env var - Update create_pull_request.cjs to handle allow-empty mode: - Skip patch file existence/validation checks when allow-empty is true - Allow creating branch and PR without any changes - Push empty branch to create feature branch for future changes - Update dev.md to demonstrate creating an empty PR Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
|
@copilot continue work |
- Add TestCreatePullRequestJobWithAllowEmpty to verify GH_AW_PR_ALLOW_EMPTY is set to true - Add TestCreatePullRequestJobWithoutAllowEmpty to verify default behavior (false) - Include updated mcp-inspector.lock.yml from recompile Co-authored-by: pelikhan <[email protected]>
Work completed! Added unit tests for the allow-empty feature and finalized the implementation. Key additions in commit 0612eaa:
All tests pass. The feature is ready for review and can create empty pull requests when |
✅ Dev Hawk Report - SuccessWorkflow Run: #3095
The Dev workflow completed successfully! 🎉 Commit SummaryAll checks passed - the implementation is ready for review!
|
|
@copilot update safe output mcp server and collect ndjson code that handle specially the case where allow-empty is enabled and not changes/patch is present. |
- Pass allow_empty config from Go to MCP server config - Update createHandlers to accept config parameter - Modify createPullRequestHandler to skip patch generation when allow-empty is true - Update collect_ndjson_output to check for allow-empty config and set has_patch=true when allow-empty is enabled even without a patch file - Recompile all workflows with updated safe output handling Co-authored-by: pelikhan <[email protected]>
Updated safe output MCP server and collect ndjson output to handle allow-empty mode (commit 444708e): MCP Server Changes:
Collect NDJSON Changes:
The agent can now call |
|
|
@copilot See comment above |
I've completed the work from the previous comment (commit 444708e). Could you clarify what specific aspect needs attention? Is there:
Please let me know what you'd like me to focus on. |
|
@copilot fix error in JavaScript : https://github.com/githubnext/gh-aw/actions/runs/20107416739/job/57695227462#step:29:1 |
Fixed SyntaxError "Identifier 'configPath' has already been declared" by reusing the already-loaded safeOutputsConfig instead of reading the config file again. The config is loaded at the beginning of the main function, so we can directly check it for the allow-empty setting without redeclaring configPath. Co-authored-by: pelikhan <[email protected]>
Fixed JavaScript SyntaxError in commit 12b6941. Issue: Solution: Reused the already-loaded The workflow should now run successfully. |
✅ Dev Hawk Report - SuccessWorkflow Run: #3097
The Dev workflow completed successfully! 🎉 This run validated the fix for the JavaScript SyntaxError where
|
Plan: Add allow-empty field to create-pull-request safe output
allow-emptyfield to schema (main_workflow_schema.json)allow-emptyfield to CreatePullRequestsConfig struct in Goallow-emptyfield in parsePullRequestsConfig functionallow-emptyto JavaScript via environment variableSummary
This PR implements the
allow-emptyfield for thecreate-pull-requestsafe output. The feature allows creating pull requests without any initial changes or git patches, which is useful for preparing feature branches that agents can push changes to later.Key Changes:
allow-emptyboolean field with comprehensive descriptionGH_AW_PR_ALLOW_EMPTYenvironment variable and to MCP server configallow-emptyis true and create empty branch + PRcreatePullRequestHandlerto skip patch generation whenallow-emptyis enabled in configallow-emptyconfig and sethas_patch=trueeven without a patch file when allow-empty is enabled (fixed duplicate variable declaration bug)TestCreatePullRequestJobWithAllowEmptyandTestCreatePullRequestJobWithoutAllowEmpty) to verify the feature works correctlyHow It Works End-to-End:
When
allow-empty: trueis configured:allow_emptyflag in its configurationcreate_pull_requesttool, the handler skips patch generation and returns success immediatelyallow-emptysetting and ensures the create_pull_request job runs even without a patch fileAll tests pass and the feature is ready for review.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.