Skip to content

fix: regression workflow flag ordering, source path, and input validation#59

Merged
gontzess merged 1 commit intomainfrom
gontzess/fix-regression-flag-order
Mar 3, 2026
Merged

fix: regression workflow flag ordering, source path, and input validation#59
gontzess merged 1 commit intomainfrom
gontzess/fix-regression-flag-order

Conversation

@gontzess
Copy link
Copy Markdown
Contributor

@gontzess gontzess commented Mar 3, 2026

Summary

  • Fix flag ordering: move flags before the positional arg so Go's flag.Parse sees them
  • Fix --source path: checkout connector to path: ${{ inputs.connector }} (e.g., baton-mysql) instead of generic connector, so the tool derives the correct config name from the directory basename
  • Add input validation: reject connector names that don't match ^baton-[a-zA-Z0-9_-]+$

Context

The verify step was invoked as verify mysql --binary ./bin/baton-mysql .... Go's flag.Parse stops at the first non-flag argument, so all flags after mysql were silently ignored. The tool fell back to binary_path from the config file (~/repo/baton-mysql/dist/...), a local dev path that doesn't exist in CI.

The --source path was ../connector (the checkout directory name), causing filepath.Base to derive config name connector instead of mysql.

Verified

Tested on baton-mysql PR #24 — regression job passes with full coverage:

Axiom Coverage: 100.0% (10/10 target predicates)
Branch Coverage: 87.4% (334/382 unique branches)
Fact Coverage: 100.0% (43/43 expected facts)
Screenshot 2026-03-03 at 16 00 06

Test plan

  • Test PR on baton-mysql with branch ref — regression passes with code coverage
  • After merge, update v4 tag

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 3, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .github/workflows/regression.yaml is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch gontzess/fix-regression-flag-order

Comment @coderabbitai help to get the list of available commands and usage tips.

@gontzess gontzess force-pushed the gontzess/fix-regression-flag-order branch from 6fa7b93 to 2256394 Compare March 3, 2026 20:40
@gontzess gontzess requested a review from robert-chiniquy March 3, 2026 20:45
@gontzess gontzess force-pushed the gontzess/fix-regression-flag-order branch 3 times, most recently from 8ce7559 to 4b39af0 Compare March 3, 2026 20:58
@gontzess gontzess changed the title fix: pass flags before positional arg in regression verify step fix: regression workflow flag ordering, source path, and input validation Mar 3, 2026
Three fixes to the regression verify step:

1. Move flags before the positional arg so Go's flag.Parse sees them.
   Was: `verify mysql --binary ...` (flags silently ignored)
   Now: `verify --binary ... mysql`

2. Checkout connector to a path matching its name (e.g., baton-mysql)
   instead of generic `connector`. The --source flag derives the
   connector config name from the directory basename.

3. Re-add --source with the correct path so code coverage analysis
   works in CI.

Also validates the connector input is alphanumeric (with hyphens and
underscores) to prevent path traversal or injection via the checkout
path and shell arguments.
@gontzess gontzess force-pushed the gontzess/fix-regression-flag-order branch from 4b39af0 to 80e7cf6 Compare March 3, 2026 21:06
@gontzess gontzess merged commit b9652b2 into main Mar 3, 2026
2 checks passed
@gontzess gontzess deleted the gontzess/fix-regression-flag-order branch March 3, 2026 21:07
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.

2 participants