Skip to content

Remove unreachable API operations and dead helpers - #696

Open
jvanbuel wants to merge 1 commit into
mainfrom
claude/remove-dead-api-operations
Open

Remove unreachable API operations and dead helpers#696
jvanbuel wants to merge 1 commit into
mainfrom
claude/remove-dead-api-operations

Conversation

@jvanbuel

@jvanbuel jvanbuel commented Jul 25, 2026

Copy link
Copy Markdown
Owner

What

Deletes 183 lines of code that nothing calls.

list_all_dagruns / list_all_taskinstances

Both were wired end-to-end and reachable from nothing:

Layer list_all_dagruns list_all_taskinstances
Trait decl traits/dagrun.rs traits/taskinstance.rs
FlowrsClient impl client/impls/dagrun_ops.rs client/impls/taskinstance_ops.rs
V1 HTTP v1/dagrun.rs v1/taskinstance.rs
V2 HTTP v2/dagrun.rs v2/taskinstance.rs

Each fetch_all_task_instances contained a complete offset/limit pagination loop. They look finished because every layer exists — which is exactly why they survived.

Also removed

  • AirflowClient::get_version (trait decl + impl)
  • KeyResult::from_consumed
  • ConfigPaths::xdg_config_dir

Note on the allow attributes

Three of these carried #[allow(unused, reason = "trait method kept for API completeness")]. That annotation is the reason the compiler never flagged them — the code was explicitly marked as dead and kept anyway. If any of these endpoints are wanted later, they are a git revert away and the Airflow API hasn't changed.

Verification

cargo test --workspace --lib --bins (94 passing), cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo fmt --all --check all clean. Clippy passing with -D warnings after removal also confirms no imports or helpers were orphaned.

🤖 Generated with Claude Code

https://claude.ai/code/session_0127jzUgqqy8JVX5RydfQxh8


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added DAG-specific retrieval of recent DAG runs for improved filtering and relevance.
    • Added task-instance retrieval scoped to a selected DAG run, with reliable pagination.
  • Breaking Changes

    • Removed “list all” DAG-run and task-instance operations; callers must now provide the relevant DAG or DAG-run identifiers.
    • Removed the public Airflow version accessor and legacy configuration-path accessor.
  • Improvements

    • Airflow client capabilities now include task and DAG statistics operations.
    • Configuration continues to support legacy locations through automatic fallback.

list_all_dagruns and list_all_taskinstances were declared on the
operation traits, implemented on FlowrsClient, and backed by V1/V2 HTTP
methods (including a full pagination loop in each taskinstance client),
but nothing ever called them. All three carried
#[allow(unused, reason = "trait method kept for API completeness")].

Also removes AirflowClient::get_version (same allow attribute),
KeyResult::from_consumed and ConfigPaths::xdg_config_dir, none of which
had callers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0127jzUgqqy8JVX5RydfQxh8
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 54235c72-532b-4205-b566-0f610ea07015

📥 Commits

Reviewing files that changed from the base of the PR and between c16ad73 and 86c4485.

📒 Files selected for processing (12)
  • crates/flowrs-airflow/src/client/v1/dagrun.rs
  • crates/flowrs-airflow/src/client/v1/taskinstance.rs
  • crates/flowrs-airflow/src/client/v2/dagrun.rs
  • crates/flowrs-airflow/src/client/v2/taskinstance.rs
  • crates/flowrs-config/src/paths.rs
  • src/airflow/client/impls/dagrun_ops.rs
  • src/airflow/client/impls/taskinstance_ops.rs
  • src/airflow/client/mod.rs
  • src/airflow/traits/dagrun.rs
  • src/airflow/traits/mod.rs
  • src/airflow/traits/taskinstance.rs
  • src/app/model.rs
💤 Files with no reviewable changes (12)
  • src/airflow/traits/dagrun.rs
  • src/app/model.rs
  • src/airflow/traits/taskinstance.rs
  • src/airflow/client/mod.rs
  • src/airflow/client/impls/taskinstance_ops.rs
  • crates/flowrs-airflow/src/client/v1/dagrun.rs
  • crates/flowrs-config/src/paths.rs
  • crates/flowrs-airflow/src/client/v1/taskinstance.rs
  • src/airflow/client/impls/dagrun_ops.rs
  • src/airflow/traits/mod.rs
  • crates/flowrs-airflow/src/client/v2/dagrun.rs
  • crates/flowrs-airflow/src/client/v2/taskinstance.rs

📝 Walkthrough

Walkthrough

Airflow DAG-run and task-instance listing APIs now require DAG-scoped identifiers across V1, V2, and FlowrsClient layers. Related trait methods and version accessors are removed, while configuration and model APIs receive separate cleanup changes.

Changes

Airflow scoped listing APIs

Layer / File(s) Summary
Airflow operation contracts
src/airflow/traits/*, src/airflow/client/mod.rs
Operation traits remove cross-DAG listing methods, AirflowClient gains operation super-traits, and get_version is removed.
DAG-scoped run fetching
crates/flowrs-airflow/src/client/v1/dagrun.rs, crates/flowrs-airflow/src/client/v2/dagrun.rs, src/airflow/client/impls/dagrun_ops.rs
V1 and V2 request DAG runs by dag_id, using version-specific endpoints and response conversions.
DAG-run-scoped task instances
crates/flowrs-airflow/src/client/v1/taskinstance.rs, crates/flowrs-airflow/src/client/v2/taskinstance.rs, src/airflow/client/impls/taskinstance_ops.rs
Task-instance fetching now requires dag_id and dag_run_id, with updated pagination and logging.
Configuration path API
crates/flowrs-config/src/paths.rs
A private legacy config path helper replaces the public xdg_config_dir accessor.
KeyResult API cleanup
src/app/model.rs
The public KeyResult::from_consumed constructor is removed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • jvanbuel/flowrs#424: Introduces related trait-based DAG-run and task-instance listing API refactoring.
  • jvanbuel/flowrs#677: Updates Clippy attributes in the changed V1 task-instance pagination implementation.
  • jvanbuel/flowrs#694: Refactors the same Airflow client listing methods touched by this change.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the PR’s main change: removing unreachable API operations and dead helper methods.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/remove-dead-api-operations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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