Création PR · 0.1.0
La documentation et les métadonnées de cette page proviennent du paquet de cette version.
Télécharger cette versionDocumentation du bloc
GitHub Pull Request Block
<!-- block-metadata:start -->
Verified BloxSmith versions: 1.0.9 (bundled-block tests; see test evidence).
<!-- block-metadata:end -->
Role
github_pull_request creates or finds a GitHub Pull Request from workflow development data without using gh, a Codex GitHub connector, or an LLM prompt.
Files
block.py: input normalization, GitHub REST calls, PR lookup/creation, token masking, runtime outputs, and UI rendering.model.json: input/output ports, default GitHub settings, and runtime capabilities.inspector_panel.html: block-owned inspector UI for repository, token, base branch, templates, draft, and dry-run settings.block_modal.html: wide modal layout for full block editing.node_card.html: compact canvas card content.assets/css/block_modal.css: block-owned modal and card layout.assets/js/block_modal.js: modal-owned mount hook used by the framework to keep the modal stable during polling.tests/F5.26_github_pull_request_block.py: block-local functional, centralized, and zeromq_active tests.
Ports
- Inputs:
issue(id: 1): JSON object or text containing issue information. Supported fields includenumber,issue_number,title,body, andhtml_url.branche(id: 2): JSON object or text containing the head branch. Supported fields includebranch_name,branche,branch, andhead_branch.rapport_dev(id: 3): JSON object or text from a commit/push step. Useful fields includecommit_sha,commit_message,remote_branch,pushed,summary,tests_run, andtests_status.
- Outputs:
rapport_pr(id: 1): structured JSON report withstage,ok,status, issue, branch, PR, blockers, warnings, and next-step fields.summary(id: 2): short text summary.
Configuration
api_base_url: GitHub-compatible API root. Default:https://api.github.com.token: GitHub token. If empty at runtime,GITHUB_TOKENis used. The token is never emitted in logs, metadata, or outputs.repo: repository inowner/repoformat.base_branch: target branch. Default:main.draft: creates the PR as draft when true. Default: true.dry_run: when true, no GitHub write call is made and the block emits the planned request. Default: true.timeout_sec: HTTP timeout. Default: 30.title_template: optional Python-format template for the PR title. Available variables includeissue_number,issue_title,branch_name,commit_sha,commit_message,tests_status, andsummary.body_template: optional Python-format template for the PR body using the same variables.
Runtime Behavior
execute_runtime() reads issue, branche, and rapport_dev, normalizes them, derives issue_number, branch_name, base_branch, commit_sha, and repo, then executes the PR workflow:
- Validate
repo,branch_name, andbase_branch. - In non-dry-run mode, require a GitHub token.
- In dry-run mode, skip GitHub API calls and emit the planned creation request.
- In write mode, verify that the remote branch exists with
GET /repos/{owner}/{repo}/branches/{branch_name}. - Search for an existing open PR with
GET /repos/{owner}/{repo}/pulls?state=open&head={owner}:{branch_name}&base={base_branch}. - If an existing PR is found, emit
status: "existing". - If no PR exists, create one with
POST /repos/{owner}/{repo}/pulls. - Emit a structured report even when the block is blocked or GitHub returns an error.
The same implementation runs in One Shot Simulation (centralized) and Active Runtime (zeromq_active) through the generic block executor.
Output Shape
{
"stage": "creation_pr",
"ok": true,
"status": "created",
"issue_number": 3,
"repo": "HackInvent/bloxsmith",
"branch_name": "frontend-ui/issue-3-clear-brush-icon",
"base_branch": "main",
"pr_number": 123,
"pr_url": "https://github.com/HackInvent/bloxsmith/pull/123",
"pr_title": "...",
"created": true,
"existing": false,
"draft": true,
"commit_sha": "...",
"actions_run": [],
"blocked": false,
"blockers": [],
"warnings": [],
"summary": "...",
"next_step": ""
}
Examples
Issue input:
{"number": 3, "title": "Brush icon is unclear", "html_url": "https://github.com/HackInvent/bloxsmith/issues/3"}
Branch input:
{"branch_name": "frontend-ui/issue-3-clear-brush-icon"}
Development report input:
{
"commit_sha": "abc123",
"commit_message": "fix(frontend-ui): clarify brush icon",
"remote_branch": "frontend-ui/issue-3-clear-brush-icon",
"pushed": true,
"summary": "Brush label and icon adjusted.",
"tests_run": ["node --check frontend/app.js"],
"tests_status": "passed"
}
UI Behavior
The inspector and modal expose repository, token, branch, template, draft, dry-run, and timeout settings. Sensitive token values are not echoed back in HTML. Editable fields stay local until the user clicks Apply; empty sensitive fields keep the existing token. The modal declares data-block-runtime-refresh="autonomous", so runtime polling does not replace the open surface or reset user focus before Apply.
Maintenance Notes
GitHub Pull Request behavior belongs in this block. Do not add PR-specific branches to the orchestrator or active runtime worker; use the generic block executor contract instead.
Compatibility policy
compatibility.json records HackInvent's verified BloxSmith versions and test evidence. Only the versions listed above have been verified, using the block-owned suites in a bundled-block test installation. This is not a certification of managed-package installation, every browser/OS, or live provider availability. Other framework versions are unverified, not necessarily incompatible.
The block-version badge follows model.json, not a published Git tag. unversioned means that no block release version is declared; no number is inferred from the framework version. The framework still uses model.json for its runtime/install contract; the tester-owned JSON does not replace it. Official integration tests run in the private bloxmith-blocs workspace. Test helpers and the proprietary framework are not bundled in this public block repository.