ci(contribution): switch trigger to pull_request_target so check fires on every PR - #89
Merged
Merged
Conversation
The original `pull_request` trigger meant the workflow only ran when the PR's head branch contained the workflow file. PRs opened before the contribution-checklist landed (#78, #83, #87, ...) therefore didn't get the check — total stayed at 5 instead of 6. `pull_request_target` runs the workflow from the base branch's copy of this file, so the check fires regardless of when the PR head was branched. Safe here because the job only reads `github.event.pull_request.body` from the event payload — it never checks out or executes PR-controlled code, so the standard pull_request_target security caveat (untrusted code with secret access) doesn't apply.
This was referenced May 18, 2026
hunnyboy1217
added a commit
to hunnyboy1217/genie-claw
that referenced
this pull request
May 19, 2026
…iePod#21) Re-submission against current `main` per review feedback on the prior revision. Drops the `.github/workflows/ci.yml` rewrite that conflicted with the CI evolution landed across PRs GeniePod#37 / GeniePod#62 / GeniePod#89 / GeniePod#91, drops the macOS matrix axis (Jetson is the deployment target), and drops the coverage job (worth its own PR). Keeps the high-value content: - `voice_loop::process_transcript` — extracted from `voice_cycle` so the post-record orchestration (intent gate, speaker identity, memory recall, quick-tool fast path, LLM streaming + TTS, tool dispatch, conversation persistence, latency banner, memory extract) can be driven with mocks. `ProcessTranscriptInputs` carries `wav_path: Option<&str>` and `tts_engine_override: Option<&TtsEngine>` so tests pass `None` / `Some(&silent_tts)` without leaking test-only ceremony into production. `voice_cycle` is now a thin wrapper around the audio-bound prelude + delegation. - `TtsEngine::snapshot()` — config-only copy so a borrowed `&TtsEngine` can be wrapped in `Arc<TtsEngine>` for `streaming::stream_and_speak`, which is `Arc`-typed since PR GeniePod#61. - `MockLlmBackend` (`LlmClient::mock(replies)`), `SttEngine::mock(transcripts)` + `MockTranscript`, `TtsEngine::silent()` — the test doubles the integration test needs. All three drop into the existing public surface. - `crates/genie-core/tests/voice_loop_integration.rs` — ten `#[tokio::test]` cases. The canonical case `process_transcript_drives_full_voice_cycle_with_mocks` calls `process_transcript` with mock LLM (tool-call reply then summary reply), silent TTS, real `Memory`, real `ConversationStore`, and a `ToolDispatcher` wired to a tool-audit JSONL, then asserts on the three AC-B observables. - `crates/genie-core/src/memory/mod.rs` — every test gets its own `${tmpdir}/geniepod-mem-${label}-${pid}-${id}-${nanos}/` parent dir so `Memory::open`'s `canonical_dir = path.parent().join("memory")` derivation no longer collides under parallel execution. Fixes the `promotion_redacts_person_memory_in_namespace_note` flake. - `crates/genie-core/src/tools/parser.rs` — the `try_tool_call_executes_single_key_system_info_shape` test is now `#[cfg(target_os = "linux")]` because the assertion shape (`Memory available:`) only renders on Linux where `tegrastats::mem_available_mb()` can read `/proc/meminfo`.
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.
Summary
Switches the
Contribution / PR body checklistworkflow trigger frompull_requesttopull_request_targetso the check fires on every PR — including PRs whose head branch was created before the workflow itself existed.Fixes the user-reported "ci only check 5" symptom on PRs #78 / #83 / #87.
Changes
.github/workflows/contribution.yml—on: pull_request:→on: pull_request_target:. Same event types (opened,edited,synchronize,reopened). Samebranches: [main]filter. Added an inline rationale comment that calls out the security caveat and why it doesn't apply here.CHANGELOG.md— one-line addendum to the existing Unreleased entry explaining the trigger choice.Real Behavior Proof
What I ran
Diagnosis path:
Root cause:
on: pull_request:resolves the workflow file from the PR's head ref. Those three PRs were opened before #88 landed, so their head refs don't contain.github/workflows/contribution.ymland the workflow never schedules.pull_request_targetreads the workflow file from the base ref instead. Once this lands onmain, the check will appear on every existing PR the next time the PR is touched (push to head, edit body, reopen) — and on every new PR immediately. No rebase required on contributor branches.What I observed
.github/workflows/contribution.ymldiff is exactly one keyword change in theon:block plus a longer explanatory comment. The job body is unchanged — it still readsgithub.event.pull_request.bodyand never checks out the PR, so the well-knownpull_request_targetsecurity caveat (untrusted code running with secret access) does not apply.This PR itself will be the verification:
Contribution / PR body checklistjob runs and passes, the trigger is wired correctly.git commit --allow-empty(or just editing the PR body) will cause the new check to appear on those PRs too.Test plan
Contribution / PR body checklist: SUCCESS.Notes for reviewers
pull_request_targetsecurity caveat: this trigger runs in the context of the base branch, which means GitHub Actions grants it write access to secrets andGITHUB_TOKEN. The standard footgun is "workflow checks out PR code and runs it, exposing secrets to the contributor." This workflow does neither —actions/checkoutis not used, no PR-controlled script is executed. The only PR-controlled data read is${{ github.event.pull_request.body }}(used in a bashgrep/awkpipeline, not eval'd as code) and${{ github.event.pull_request.title }}(matched against a fixed glob allowlist). Both are safe to consume.permissions:block stayscontents: read+pull-requests: read(no write), so even thoughpull_request_targetcould grant more, we don't ask for it.