Add reusable workflow diff - #708
Open
platinummonkey wants to merge 3 commits into
Open
Conversation
|
I can only run on private repositories. |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: platinummonkey <cody.lee@datadoghq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds shared JSON resource diff plumbing and exposes
pup workflows diff <workflow-id> <file>with the same--only/--ignorefiltering used by monitor diff. It also keeps workflow diff tests aligned with the SDK's requiredaction_idresponse shape and fetches workflow diff state as raw JSON to avoid SDK deserialization/defaulting noise.Motivation
Issue #634 requests diff support beyond monitors, with workflows as the concrete example. This starts that rollout by extracting reusable diff output and normalization behavior, then applying it to Workflow Automation.
Changes
ResourceDiffOptions, nested read-only path stripping, optional diff roots, and shared diff formatting insrc/util_ext.rs.src/commands/workflows.rsandsrc/main.rs.action_idas read-only and included it in the workflow diff mock response so the SDK can deserialize representative workflow JSON where typed paths still apply.docs/COMMANDS.mdanddocs/EXAMPLES.md.Testing
cargo +stable fmt --checkgit diff --checkCheck, Test & CoverageandCross Compile (Windows)showed one failing test:commands::workflows::tests::test_workflows_diff_detects_changes, caused by missingaction_idin the workflow mock response; the follow-up CI run showed the same SDK deserialization dependency, so workflow diff now fetches raw JSON.cargo +stable test test_workflows_diff_detects_changes, but Cargo could not fetch the pinneddatadog-api-client-rustgit dependency from GitHub in this sandbox (403/ allowlist block).Additional Notes
Follow-up PRs can add dashboard, SLO, notebook, pipeline, and other resource diff commands on top of the shared helper.
Checklist
Related Issues
Closes #634
PR by Bits - View session in Datadog
Comment @DataDog to request changes