Skip to content

Conversation

leoparente
Copy link
Contributor

@leoparente leoparente commented Jul 8, 2025

This pull request introduces a new CLI tool, diode-replay-dryrun, to simplify the ingestion of dry-run JSON files into Diode. It also updates the documentation and project configuration to support this new functionality.

CLI Tool Addition:

  • netboxlabs/diode/sdk/dryrun_replay.py: Added a new CLI helper, diode-replay-dryrun, to ingest dry-run JSON messages into Diode. It supports arguments for target server, application name/version, OAuth2 credentials, and input files.

Documentation Updates:

  • README.md: Updated usage instructions to include the new diode-replay-dryrun command for ingesting dry-run files, alongside the existing DiodeClient method. [1] [2]

Project Configuration Updates:

  • pyproject.toml: Registered the diode-replay-dryrun script as an entry point in the project configuration.

@leoparente leoparente requested review from rboucher-me and Copilot July 8, 2025 16:49
@leoparente leoparente self-assigned this Jul 8, 2025
@github-actions github-actions bot added dependencies Pull requests that update a dependency file markdown python labels Jul 8, 2025
Copy link

github-actions bot commented Jul 8, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/netboxlabs/diode/sdk
   client.py240797%102, 277, 337, 342, 346, 402, 430
TOTAL274797% 

Tests Skipped Failures Errors Time
97 0 💤 0 ❌ 0 🔥 1.265s ⏱️

Copilot

This comment was marked as outdated.

@leoparente leoparente requested a review from Copilot July 8, 2025 18:11
@leoparente leoparente changed the title feat: add diode-load-dyrun helper feat: add diode-replay-dyrun helper Jul 8, 2025
Copy link
Contributor

@Copilot 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

This PR introduces a new CLI helper for ingesting dry-run JSON messages into Diode, registers it as a script, and updates documentation accordingly.

  • Added netboxlabs/diode/sdk/dryrun_replay.py implementing the diode-replay-dryrun command
  • Registered the script in pyproject.toml
  • Updated README.md with usage examples for the new CLI

Reviewed Changes

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

File Description
pyproject.toml Registered diode-replay-dryrun in project.scripts
netboxlabs/diode/sdk/dryrun_replay.py Implemented the new CLI helper tool
README.md Added instructions for using the new CLI command
Comments suppressed due to low confidence (3)

pyproject.toml:49

  • [nitpick] The CLI command name 'diode-replay-dryrun' differs from the PR title/description ('diode-load-dryrun'). Standardize the name across code, docs, and metadata to avoid confusion.
diode-replay-dryrun = "netboxlabs.diode.sdk.dryrun_replay:main"

netboxlabs/diode/sdk/dryrun_replay.py:1

  • There are currently no tests for this new CLI helper. Consider adding unit tests for argument parsing, successful ingestions, and error handling to ensure proper coverage.
"""CLI helper to ingest dry-run JSON messages into Diode."""

README.md:108

  • [nitpick] The example here doesn't mention the -c/--client-id and -k/--client-secret flags or their environment variable defaults. Document these options to help users configure OAuth credentials.
Alternatively, the same file can be ingested using the `diode-replay-dryrun`

@jajeffries
Copy link
Contributor

As this isn't part of the sdk as such, I wonder whether moving it to netboxlabs/diode/sdk/bin might make that clearer? Not 100% sure on this, but it feels closer to the approach we'd take with the golang version too

@leoparente leoparente closed this Jul 9, 2025
@leoparente leoparente deleted the feat/OBS-1120-dry-run-ingest branch July 9, 2025 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file markdown python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants