Skip to content

Conversation

leoparente
Copy link
Contributor

This pull request introduces a new CLI tool, diode-replay-dryrun, to replay dry-run files generated by the DryRunClient and send them to a Diode service. It also updates the project dependencies in go.mod. Below are the most important changes:

Addition of the diode-replay-dryrun CLI Tool

  • Documentation Update: Added a new section in README.md explaining the purpose of the diode-replay-dryrun tool, installation instructions, and usage examples. The tool supports ingesting multiple JSON files and provides flexibility in specifying OAuth2 credentials via flags or environment variables.
  • Implementation: Created a new main.go file for the CLI tool, which includes:
    • Parsing command-line flags for input files, target, app details, and OAuth2 credentials.
    • Loading and ingesting dry-run entities from JSON files using the diode SDK.
    • Handling errors and logging the results of ingestion.

Dependency Updates

  • go.mod Changes: Updated the golang.org/x/net dependency to be a direct requirement instead of indirect. This ensures compatibility with the new CLI tool.

@leoparente leoparente self-assigned this Jul 9, 2025
@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies go markdown labels Jul 9, 2025
@leoparente leoparente requested a review from Copilot July 9, 2025 12:42
Copilot

This comment was marked as outdated.

Copy link

github-actions bot commented Jul 9, 2025

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 0.01s github.com/netboxlabs/diode-sdk-go/cmd/diode-replay-dryrun 0.0% 0 0 0
🟢 PASS 1.32s github.com/netboxlabs/diode-sdk-go/diode 20.4% 218 0 0

Total coverage: 76.7%

@leoparente leoparente requested a review from Copilot July 9, 2025 13:34
Copilot

This comment was marked as outdated.

@leoparente leoparente requested a review from Copilot July 10, 2025 13:12
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

Introduces a new CLI tool for replaying dry-run JSON files to a Diode service and updates project dependencies.

  • Adds diode-replay-dryrun CLI in cmd/diode-replay-dryrun/main.go with flags for files, target, app info, and OAuth2 credentials.
  • Updates go.mod to make golang.org/x/net a direct dependency.
  • Documents installation and usage of the new CLI in README.md.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
go.mod Promote golang.org/x/net to a direct requirement
cmd/diode-replay-dryrun/main.go Implement the CLI tool for ingesting dry-run JSON files
README.md Add documentation and usage examples for the new CLI helper
Comments suppressed due to low confidence (3)

cmd/diode-replay-dryrun/main.go:27

  • [nitpick] The variable name version is ambiguous; consider renaming it to appVersion for consistency with the flag name and to improve clarity.
	version := flag.String("app-version", "", "Application version used when ingesting the dry-run messages")

cmd/diode-replay-dryrun/main.go:22

  • Consider adding unit or integration tests for the CLI tool to verify flag parsing and ingestion behavior.
func main() {

README.md:179

  • [nitpick] The example target path (/diode) differs from the flag description example (/diodet); update one for consistency.
  --target grpc://localhost:8080/diode \

@leoparente leoparente marked this pull request as ready for review July 11, 2025 13:10
leoparente and others added 2 commits July 14, 2025 10:39
Co-authored-by: Michal Fiedorowicz <[email protected]>
@leoparente leoparente requested a review from mfiedorowicz July 14, 2025 14:07
@leoparente leoparente merged commit 8f37eee into develop Jul 14, 2025
6 checks passed
@leoparente leoparente deleted the feat/OBS-1222-diode-replay branch July 14, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies documentation Improvements or additions to documentation go markdown

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants