Skip to content

fix(idp): remove stale idp.rs after module split to idp/#571

Merged
platinummonkey merged 2 commits into
mainfrom
feat/idp-migrate-schema
Jun 8, 2026
Merged

fix(idp): remove stale idp.rs after module split to idp/#571
platinummonkey merged 2 commits into
mainfrom
feat/idp-migrate-schema

Conversation

@platinummonkey

Copy link
Copy Markdown
Collaborator

Summary

Fixes all 5 CI failures in #567 caused by an ambiguous module definition.

Root Cause

PR #567 converted src/commands/idp.rs into a directory module (idp/mod.rs + idp/migrate.rs) but left the original src/commands/idp.rs in place. Rust rejected the compile with:

failed to resolve mod `idp`: file for module found at both
  src/commands/idp.rs
  src/commands/idp/mod.rs

This caused cargo fmt to exit with code 1 immediately, failing every CI job.

Changes

  • src/commands/idp.rs — deleted (stale flat file, superseded by idp/mod.rs)
  • src/commands/idp/migrate.rscargo fmt cleanup (long lines)

This branch also contains the full feature from #567 — it can supersede that PR or be cherry-picked once the upstream branch is fixed.


🤖 Generated with Claude Code

andre-rodrigues-dd and others added 2 commits June 5, 2026 18:57
… to v3

Adds `pup idp migrate-schema [path]` which migrates Datadog service catalog
YAML files (v1, v2, v2.1, v2.2) to v3 format using a Rust-native migration
engine with JSON schema validation against the official DataDog/schema schemas.

Features:
- Detects schema version (v1/v2/v2.1/v2.2/v3) and migrates to v3
- Migrates all field mappings: contacts, links, repos, docs, integrations,
  lifecycle, tags, extensions, and unknown fields (moved to extensions)
- Generates companion 'kind: system' entities from 'application:' fields,
  deduplicating across multi-doc files
- Validates migrated output against v3 JSON schemas fetched from GitHub
  (in-memory $ref resolution, no blocking HTTP)
- Interactive output prompt: write in-place, custom path, or stdout
- Auto-discovers *.datadog.yaml files when no path given; accepts a file
  or directory as argument
- Multi-file mode: confirms once, migrates in parallel (batches of 16 to
  avoid fd exhaustion), prints consolidated summary with counts and timing
- Gracefully skips empty files, comment-only files, and broken symlinks
- Handles indented YAML (e.g. 4-space indent after ---) correctly
- ANSI-coloured output following codebase conventions (no colour crate)

Implementation:
- src/commands/idp/ directory module (idp/mod.rs + idp/migrate.rs)
- jsonschema crate (default-features = false, no blocking HTTP resolver)
- 26 unit tests covering version detection, all migration paths,
  multi-doc handling, companion deduplication, and file discovery
The PR converted commands/idp.rs into a directory module (idp/mod.rs +
idp/migrate.rs) but left the old flat file in place, causing a compile
error: "file for module found at both idp.rs and idp/mod.rs".

Also apply cargo fmt fixes in migrate.rs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@platinummonkey platinummonkey requested a review from a team as a code owner June 8, 2026 17:59
@dd-octo-sts-150931

Copy link
Copy Markdown

🐑 PR Shepherd is maintaining this PR

I watch your PR and automatically fix CI failures, rebase your branch, handle flaky tests, and push it to the merge queue when it's ready.

More about what I do → Guide

To pause me on this PR, add the flow-skip label.

@platinummonkey platinummonkey merged commit 4752de2 into main Jun 8, 2026
7 checks passed
@platinummonkey platinummonkey deleted the feat/idp-migrate-schema branch June 8, 2026 18:33
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