Skip to content

feat: add data-pathways delete and health check commands#192

Merged
jbiskur merged 2 commits intomainfrom
feat/data-pathways-delete-and-health
Mar 18, 2026
Merged

feat: add data-pathways delete and health check commands#192
jbiskur merged 2 commits intomainfrom
feat/data-pathways-delete-and-health

Conversation

@jbiskur
Copy link
Contributor

@jbiskur jbiskur commented Mar 18, 2026

Summary

  • Add DataPathwayDeleteCommandDELETE /api/v1/pathways/:id for pathway deletion
  • Add DataPathwayHealthCheckCommandGET /api/v1/health for health checks
  • Add DataPathwayHealthSchema contract type

Test plan

  • deno check src/mod.ts passes
  • deno test — all 20 tests pass
  • CI green, then merge and let release-please handle the release

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Data pathway health check: view health status, component checks, and uptime metrics.
    • Data pathway deletion: remove pathways with clear error handling for missing or not-found pathways.
  • Chores

    • Package version bumped to 1.71.0.

Add two missing SDK commands for data-pathways control plane:
- DataPathwayDeleteCommand (DELETE /api/v1/pathways/:id)
- DataPathwayHealthCheckCommand (GET /api/v1/health)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd0802d3-4dbe-427c-ac33-e91702bcf771

📥 Commits

Reviewing files that changed from the base of the PR and between 2f10cbc and a7858eb.

📒 Files selected for processing (1)
  • src/commands/data-pathways/health.check.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/commands/data-pathways/health.check.ts

📝 Walkthrough

Walkthrough

Adds two Data Pathways commands (health check and pathway delete), a new DataPathwayHealth schema/type, barrel exports for the commands, and a package version bump in deno.json.

Changes

Cohort / File(s) Summary
Version Update
deno.json
Package version bumped from 1.70.0 to 1.71.0.
Data Pathways Commands
src/commands/data-pathways/health.check.ts, src/commands/data-pathways/pathway.delete.ts
New commands: DataPathwayHealthCheckCommand (GET /api/v1/health, no retries, bearer auth) and DataPathwayDeleteCommand (DELETE /api/v1/pathways/{id}, no retries, bearer auth, maps 404 → NotFoundException).
Barrel Exports
src/commands/data-pathways/index.ts
Added re-exports for health.check.ts and pathway.delete.ts.
Contract Schemas
src/contracts/data-pathways.ts
Added DataPathwayHealthSchema and exported DataPathwayHealth type (status, checks, uptime).

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Command as DataPathwayHealthCheckCommand
  participant API as Data-Pathways API
  participant Parser as Response Parser

  Client->>Command: execute()
  Command->>API: GET https://data-pathways.api.flowcore.io/api/v1/health
  API-->>Command: 200 {status, checks, uptime}
  Command->>Parser: parseResponseHelper(DataPathwayHealthSchema, raw)
  Parser-->>Command: DataPathwayHealth
  Command-->>Client: return DataPathwayHealth
Loading
sequenceDiagram
  participant Client
  participant Command as DataPathwayDeleteCommand
  participant API as Data-Pathways API
  participant Parser as Response Parser
  participant ErrorMapper as Error Mapper

  Client->>Command: execute({ id })
  Command->>API: DELETE https://data-pathways.api.flowcore.io/api/v1/pathways/{id}
  alt 200/2xx
    API-->>Command: 200 {mutation response}
    Command->>Parser: parseResponseHelper(DataPathwayMutationResponseSchema, raw)
    Parser-->>Command: DataPathwayMutationResponse
    Command-->>Client: return response
  else 404
    API-->>Command: 404 {...}
    Command->>ErrorMapper: map to NotFoundException("DataPathway", id)
    ErrorMapper-->>Command: throw NotFoundException
    Command-->>Client: throw NotFoundException
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • suuunly

Poem

🐰 A hop, a ping — the health check sings,
Delete hops out with tidy wings,
Schemas snug and exports bright,
Two commands bound for morning light,
This rabbit cheers the code tonight! 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add data-pathways delete and health check commands' directly and concisely describes the main changes: addition of two new commands (delete and health check) for data-pathways functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/data-pathways-delete-and-health
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/commands/data-pathways/pathway.delete.ts (1)

28-31: Consider: Empty body on DELETE when no reason is provided.

When reason is not provided, getBody() returns {}. The base class will send this with Content-Type: application/json. While this works with most APIs, some strict REST implementations may reject DELETE requests with bodies.

If the API accepts bodyless DELETE, you could return undefined when the payload is empty:

💡 Optional refinement
 protected override getBody(): Record<string, unknown> | undefined {
   const { id: _id, ...payload } = this.input
-  return payload
+  return Object.keys(payload).length > 0 ? payload : undefined
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/commands/data-pathways/pathway.delete.ts` around lines 28 - 31, The
getBody() implementation in the PathwayDelete command extracts id into _id and
returns payload which yields an empty object when no reason is provided; change
getBody() (in the pathway.delete command) to return undefined when payload is
empty so the base request does not send an empty JSON body—detect payload
emptiness (after stripping _id) and return payload if non-empty otherwise return
undefined.
src/commands/data-pathways/health.check.ts (1)

7-9: Consider: Bearer-only authentication for health checks.

Health endpoints are often unauthenticated to support external monitoring tools (load balancers, Kubernetes probes). The current bearer-only restriction limits usage to authenticated internal calls.

If this is intentional for internal monitoring, this is fine. Otherwise, consider allowing unauthenticated access or API key auth.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/commands/data-pathways/health.check.ts` around lines 7 - 9,
DataPathwayHealthCheckCommand currently restricts auth via protected override
allowedModes: ("apiKey" | "bearer")[] = ["bearer"], which forces bearer-only
access; to allow external monitoring either add "apiKey" to allowedModes (set to
["bearer","apiKey"]) or make the endpoint unauthenticated by setting
allowedModes to an empty array ([]) or a mode that represents anonymous access;
update DataPathwayHealthCheckCommand's allowedModes and any related auth checks
or tests (and keep protected override retryOnFailure as-is) so health probes can
use the intended auth model.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/commands/data-pathways/health.check.ts`:
- Around line 23-25: Remove the unnecessary getBody() override that returns an
empty object; the GET handler should rely on the base Command.getBody() behavior
(which returns undefined) so no JSON body or Content-Type is sent. Locate and
delete the getBody() method override in the health check command (the method
named getBody in the class handling the health check, e.g., HealthCheckCommand)
so the request will not include an empty body.

---

Nitpick comments:
In `@src/commands/data-pathways/health.check.ts`:
- Around line 7-9: DataPathwayHealthCheckCommand currently restricts auth via
protected override allowedModes: ("apiKey" | "bearer")[] = ["bearer"], which
forces bearer-only access; to allow external monitoring either add "apiKey" to
allowedModes (set to ["bearer","apiKey"]) or make the endpoint unauthenticated
by setting allowedModes to an empty array ([]) or a mode that represents
anonymous access; update DataPathwayHealthCheckCommand's allowedModes and any
related auth checks or tests (and keep protected override retryOnFailure as-is)
so health probes can use the intended auth model.

In `@src/commands/data-pathways/pathway.delete.ts`:
- Around line 28-31: The getBody() implementation in the PathwayDelete command
extracts id into _id and returns payload which yields an empty object when no
reason is provided; change getBody() (in the pathway.delete command) to return
undefined when payload is empty so the base request does not send an empty JSON
body—detect payload emptiness (after stripping _id) and return payload if
non-empty otherwise return undefined.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8914e781-9ddc-435e-b893-80309443e0ac

📥 Commits

Reviewing files that changed from the base of the PR and between 1e881d2 and 2f10cbc.

📒 Files selected for processing (5)
  • deno.json
  • src/commands/data-pathways/health.check.ts
  • src/commands/data-pathways/index.ts
  • src/commands/data-pathways/pathway.delete.ts
  • src/contracts/data-pathways.ts

GET requests should not send a body — use base class default (undefined).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jbiskur jbiskur merged commit 380a9bb into main Mar 18, 2026
2 checks passed
@jbiskur jbiskur deleted the feat/data-pathways-delete-and-health branch March 18, 2026 16:45
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