fix: dependabot config equality must be key-order-independent - #37
Merged
Conversation
## Why `src/dependabot.js:108` used `JSON.stringify(currentConfig) === JSON.stringify(targetConfig)` to compare the existing dependabot.yml against the target. yaml.load preserves source key order; identical configs serialised in different key orders compared *unequal* → unnecessary writes (and unnecessary PRs when `change_strategy.use_pull_requests: true`). ## What Tiny inline `canonicalize(value)` helper that recursively sorts object keys; arrays preserved in order; primitives unchanged. Comparison becomes `JSON.stringify(canonicalize(a)) === JSON.stringify(canonicalize(b))`. No new dependency. Helper stays inside `src/dependabot.js`. ## Source Wave-1 QA bug-hunter flagged this as Bug #27 in `docs/agent-fleet/bugs.md`. ## Test plan - [x] 809 tests pass (was 806; +3 covering: identical configs in different key order compare equal; genuinely different configs unequal; arrays with different element order unequal — intentional, arrays are ordered) - [x] eslint clean ## Risk & rollout - Risk: low. Pure equality refinement; only affects a "skip work when unchanged" branch. Worst case is one extra write per repo if the new comparator misses an equality (it doesn't). - Rollout: self-update on merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Fixes Bug #27 from
docs/agent-fleet/bugs.md(wave-1 QA bug-hunter).JSON.stringify(a) === JSON.stringify(b)was order-sensitive; identical configs in different key orders compared unequal → unnecessary writes / PRs. Tiny inlinecanonicalizehelper sorts keys deeply before comparing. No new dependency.🤖 Generated with Claude Code