Skip to content

feat: move-diff-logic-within-the-plugin#5

Merged
CodeYogiCo merged 2 commits into
masterfrom
move-diff-logic-within-the-plugin
Jun 19, 2026
Merged

feat: move-diff-logic-within-the-plugin#5
CodeYogiCo merged 2 commits into
masterfrom
move-diff-logic-within-the-plugin

Conversation

@CodeYogiCo

Copy link
Copy Markdown
Owner

Drop the Vela start.sh entrypoint and run the plugin binary directly (ENTRYPOINT ["/plugin"]). The diff is now produced in-plugin (PARAMETER_DIFF_SOURCE=github) or piped on stdin, so the Vela git-diff wrapper is no longer needed.

  • Remove scripts/start.sh; Dockerfile now uses ENTRYPOINT ["/plugin"].
  • Drop the redundant --entrypoint /plugin override in the GitHub Actions workflow.
  • Run the coverage job on fork PRs (removed the same-repo guard); tolerate the read-only-token comment 403 on forks via continue-on-error.

🤖 Generated with Claude Code

Vishal Vaibhav and others added 2 commits June 19, 2026 11:46
Committer: codeyogico<iveeshal@hotmail.com>
Drop the Vela start.sh entrypoint and run the plugin binary directly
(ENTRYPOINT ["/plugin"]); the diff is now produced in-plugin
(PARAMETER_DIFF_SOURCE=github) or piped on stdin. Also run the coverage
job on fork PRs, tolerating the read-only-token comment 403 via
continue-on-error.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🛡️ Patch Coverage Report

Scope: changed lines only — the code this PR adds or edits, not whole files or the repo. It answers one thing — did your tests run the code you just touched?

Diff coverage: 94% 🟢 — 78 of 83 changed instructions covered

Metric Value
🟢 Covered instructions 78 (94%) changed code your tests executed
🔴 Missed instructions 5 (6%) changed code your tests never ran
📈 Tracked changed lines 83 (17%) lines the coverage tool could measure
⚪ Untracked changed lines 392 (83%) comments, blanks, declarations

Lines = the source lines you changed. Instructions = the executable units the coverage tool counts inside those lines — one line can hold several (e.g. JaCoCo bytecode), so the two counts differ.

Coverage by file

File Diff coverage Covered / Missed
internal/plugin/runner.go 🟢 90% 18 / 2
internal/test/mocks/property_getter.go 🟢 94% 16 / 1
internal/plugin/githubdiff/diff.go 🟢 94% 33 / 2
internal/plugin/sourcelines/unifieddiff/changed_source_loader.go 🟢 100% 11 / 0

7 changed file(s) with no measurable lines (config, docs, generated, or test-only) omitted.

🔍 Uncovered lines (5)
--- internal/plugin/githubdiff/diff.go:70
		return nil, errors.Wrap(readErr, "Failed reading diff response from github")
--- internal/plugin/githubdiff/diff.go:71
	}
--- internal/plugin/runner.go:120
			return errors.Wrap(fetchErr, "Failed fetching diff from github")
--- internal/plugin/runner.go:121
		}
--- internal/test/mocks/property_getter.go:31
			continue

🤖 Generated by pull-request-code-coverage — coverage for changed lines only.

@CodeYogiCo CodeYogiCo merged commit 51b16d9 into master Jun 19, 2026
2 checks passed
@CodeYogiCo CodeYogiCo deleted the move-diff-logic-within-the-plugin branch June 19, 2026 06:47
CodeYogiCo pushed a commit that referenced this pull request Jun 24, 2026
PR #5 removed scripts/start.sh which used to run `git fetch` + `git diff`
and pipe the result into the plugin. Callers that relied on that behaviour
(e.g. Vela pipelines that never set PARAMETER_DIFF_SOURCE) now get empty
stdin and see "0 of 0 changed instructions covered".

Add PARAMETER_DIFF_SOURCE=git that runs the same git commands internally,
using PARAMETER_BASE_BRANCH (or VELA_PULL_REQUEST_TARGET for backward
compatibility) as the base ref.

Auto-detect: when PARAMETER_DIFF_SOURCE is absent but VELA_PULL_REQUEST_TARGET
is set the runner silently defaults to "git", so existing Vela pipelines
recover without any configuration change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CodeYogiCo added a commit that referenced this pull request Jun 24, 2026
* fix: restore git-diff mode to fix v1.0.1 regression on Vela

PR #5 removed scripts/start.sh which used to run `git fetch` + `git diff`
and pipe the result into the plugin. Callers that relied on that behaviour
(e.g. Vela pipelines that never set PARAMETER_DIFF_SOURCE) now get empty
stdin and see "0 of 0 changed instructions covered".

Add PARAMETER_DIFF_SOURCE=git that runs the same git commands internally,
using PARAMETER_BASE_BRANCH (or VELA_PULL_REQUEST_TARGET for backward
compatibility) as the base ref.

Auto-detect: when PARAMETER_DIFF_SOURCE is absent but VELA_PULL_REQUEST_TARGET
is set the runner silently defaults to "git", so existing Vela pipelines
recover without any configuration change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: use require.Error and bogus branch in autodetect test

Two bugs in TestDefaultRunner_Run_DiffSourceAutodetect_VelaTarget:
- Used assert.Error instead of require.Error: when err is nil the next
  line calls err.Error() and panics with a nil pointer dereference.
- Used "main" as the Vela target branch: in CI the repo has origin/main
  so git fetch succeeds, err stays nil, and the test fails.

Fix both: switch to require.Error (stops the test on nil) and use a
branch name that cannot exist on any remote so git fetch always fails.

Also fix gofmt whitespace in runner.go.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: suppress gosec G204 on controlled git subprocesses

golangci-lint flags exec.Command calls with variable args as G204.
The args are built from our own logic (not raw user input), so suppress
the warning with nolint comments — same pattern used elsewhere in the repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant