Skip to content

Expose recent Reqs2X flags, add delta test generation, wire up the nele provider - #344

Open
ThisCakeIsALie wants to merge 5 commits into
mainfrom
reqs2x-cli-flag-support
Open

Expose recent Reqs2X flags, add delta test generation, wire up the nele provider#344
ThisCakeIsALie wants to merge 5 commits into
mainfrom
reqs2x-cli-flag-support

Conversation

@ThisCakeIsALie

@ThisCakeIsALie ThisCakeIsALie commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Catches the extension up with flags and events the Reqs2X CLI has gained.

SettingsbatchSize, fastMode, deduplicateTests, allowPartialTests, maxTestExamples, testExampleSources. --allow-partial was hardcoded on with no way to disable it. noTestExamples is deprecated in favour of maxTestExamples: 0 rather than removed, so existing configs keep working (note VS Code hides deprecated settings unless they have a value).

Delta generation — second command, Generate Tests from Requirements (Untested or Changed Only), for --only-delta. A command rather than a setting because it is per-run intent. Its menu entry is gated on a context key so it stays hidden when the installed Reqs2X predates the flag. A delta run with nothing to do writes no .tst, so the target is removed up front and its absence tolerated afterwards — otherwise the previous run's script gets re-imported.

nele provider — was supported by the CLI but not selectable.

Event handlingProgressTracker dropped info and notice. info already fires on the --only-untraced path we use, so inferring traceability on a fully-traced RGW finished with no visible output. notice carries the subscription nudge.

--no-reorder removed — no released CLI has ever accepted it, so turning the reorder setting off made code2reqs and reqs2tests exit non-zero.

Version skewpanreqSupportsOnlyUntraced was a bespoke single-flag cache; now reqs2xSupportsFlag / reqs2xSupportedFlags over one cached --help per binary. Recent flags are probed and dropped when absent; because settings cannot be gated on a context key the way a command can, generation warns when a setting the user actually chose was dropped.

Also drops the per-event log line from the availability refresh, which the CCAST_.CFG watcher was emitting several times a second while clicast was active.

ThisCakeIsALie and others added 4 commits July 28, 2026 11:28
Three independent gaps against the current Reqs2X CLI:

- The `nele` provider was supported by the CLI but not selectable in the
  extension. Adds the enum entry and the four settings feeding
  VCAST_REQS2X_NELE_{API_KEY,BASE_URL,MODEL_NAME} plus the optional
  reasoning model name.

- ProgressTracker only handled `progress` and `problem` events, silently
  dropping `info` and `notice`. `info` already fires on the
  --only-untraced path the extension uses, so inferring traceability on a
  fully-traced RGW completed with no user-visible output at all. `notice`
  carries the Vector Subscription nudge; phase 1 renders as information and
  later phases as a warning, matching the CLI.

- The `reqs2x.reorder` setting passed --no-reorder to code2reqs and
  reqs2tests, but no released CLI has ever accepted that flag, so turning
  the setting off made both tools exit non-zero with an argparse error.
  Setting and both call sites removed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds settings for --batch-size, --fast, --deduplicate, --allow-partial,
--max-test-examples and --test-examples-sources, and a second command for
--only-delta. --allow-partial was previously hardcoded on with no way to
disable it.

Reqs2X ships with VectorCAST and is versioned independently of the
extension, so every flag newer than the currently shipped build has to be
guarded. panreqSupportsOnlyUntraced was a bespoke single-flag cache;
replaced with reqs2xSupportsFlag/reqs2xSupportedFlags, which cache one
--help per binary so any number of flags cost a single subprocess.

Probing only works for flags that appear in --help. argparse.SUPPRESS
hides --json-events and --no-test-examples, which the shipped build does
accept, so those stay unconditional -- verified by invoking the shipped
binary directly. Confirmed rejected there and therefore guarded: --fast,
--max-test-examples, --test-examples-sources, --only-delta.

--only-delta is a command rather than a setting because it expresses
per-run intent, and its menu entry is gated on a context key so it stays
hidden when the installed Reqs2X predates the flag. Two consequences of
delta runs are handled: the target .tst is removed up front and its
absence tolerated afterwards, since a run with nothing to do returns
before writing anything and would otherwise leave the previous run's
script to be re-imported; and the completion message notes that tests
written earlier for changed requirements are kept and may need pruning.

noTestExamples is deprecated in favour of maxTestExamples: 0 rather than
removed, so settings already in the wild keep working; while explicitly
enabled it still wins.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The CCAST_.CFG watcher fires several times a second while clicast is
active, and each event logged a line to the requirements output channel,
drowning out everything else. The reason string existed only for that
line, so it goes too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Enabling fast mode against a Reqs2X that predates --fast dropped the flag
and generated normally, leaving the setting reading as on with no
indication. Settings cannot be gated on a context key the way the delta
command is, so the only honest option is to say so at generation time.

Warns per generation, listing the settings rather than the flags, and only
for values the user actually chose: an untouched default loses nothing when
the flag is missing, because the CLI default matches it. maxTestExamples: 0
is likewise never reported, since it maps to --no-test-examples, which is
old enough to always be present.

reqs2xSupportedFlags no longer logs the missing flags itself. It knew what
was absent but not what was wanted, so it named all three on every run of
a shipped build while saying nothing useful about intent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ThisCakeIsALie
ThisCakeIsALie requested a review from Den1552 July 29, 2026 13:20
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.70%. Comparing base (f70e1a5) to head (b776c2f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #344   +/-   ##
=======================================
  Coverage   96.70%   96.70%           
=======================================
  Files           9        9           
  Lines        1729     1729           
  Branches      194      194           
=======================================
  Hits         1672     1672           
  Misses         57       57           
Flag Coverage Δ
Unit 96.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@Den1552 Den1552 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only had format the ts files with prettier but otherwise LGTM. Tests also pass.

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