Skip to content

Conversation

@krlmlr
Copy link
Contributor

@krlmlr krlmlr commented Jan 25, 2026

May trigger revdepcheck failures.

Copilot AI review requested due to automatic review settings January 25, 2026 18:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Tightens argument validation for parameters that are expected to identify a single vertex, ensuring exactly one vertex is provided (instead of allowing 0 or >1 and relying on downstream behavior).

Changes:

  • Update the Stimulus VERTEX / VERTEX_ROOT type conversions to require length(...) == 1 and adjust corresponding error text.
  • Regenerate/update auto-generated R interface code to apply the stricter checks across affected _impl wrappers.
  • Minor YAML literal formatting change for CLOSURE (||-), reflected in generated output formatting.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tools/stimulus/types-RR.yaml Updates vertex argument conversion templates to enforce exactly-one-vertex semantics and align error messages.
R/aaa-auto.R Applies regenerated argument checks and updated error messages across many internal _impl functions.

Comment on lines +11788 to 11792
if (length(source) != 1) {
cli::cli_abort(
"{.arg source} must specify at least one vertex",
"{.arg source} must specify exactly one vertex",
call = rlang::caller_env()
)
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

Same as above: updating to “must specify exactly one vertex” will require updating snapshot tests for st_min_cuts()/all_st_mincuts_impl (see tests/testthat/_snaps/flow.md) so CI doesn’t fail on stale snapshots.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines 198 to 203
%I% <- as_igraph_vs(%I1%, %I%)
if (length(%I%) == 0) {
if (length(%I%) != 1) {
cli::cli_abort(
"{.arg %I%} must specify at least one vertex",
"{.arg %I%} must specify exactly one vertex",
call = rlang::caller_env()
)
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

This change tightens the VERTEX conversion to error when more than one vertex is supplied. There are tests for several affected user-facing wrappers (e.g., are_adjacent(), random_walk(), st_cuts()), but none appear to assert the new “multiple vertices” error path. Adding a small test to cover the >1-length case would help prevent regressions in this stricter input validation.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +11748 to 11752
if (length(source) != 1) {
cli::cli_abort(
"{.arg source} must specify at least one vertex",
"{.arg source} must specify exactly one vertex",
call = rlang::caller_env()
)
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

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

The error message for invalid source/target changed from “must specify at least one vertex” to “must specify exactly one vertex”. This will break existing snapshot expectations (e.g., tests/testthat/_snaps/flow.md for st_cuts()), so the corresponding snapshots/tests should be updated to match the new wording/behavior.

Copilot generated this review using guidance from repository custom instructions.
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