Skip to content

fix(adk): remove false from isEmpty in checkMetadataUnchanged#90

Merged
ThePlenkov merged 2 commits intomainfrom
feat/abapgit-roundtrip
Apr 2, 2026
Merged

fix(adk): remove false from isEmpty in checkMetadataUnchanged#90
ThePlenkov merged 2 commits intomainfrom
feat/abapgit-roundtrip

Conversation

@ThePlenkov
Copy link
Copy Markdown
Member

@ThePlenkov ThePlenkov commented Apr 2, 2026

false was treated as "empty-like", causing isSubsetMatch(false, true) to return true — silently skipping saves when boolean flags are toggled from true to false (e.g., lowercase, fixPointArithmetic, final).

Now only null, undefined, "", [], and {} are empty-like. An explicit false is compared against SAP's value as a real change.

Generated with Devin

Summary by CodeRabbit

  • Bug Fixes
    • Improved metadata change detection for boolean values, ensuring proper identification when flag values change to or from false.

`false` was treated as "empty-like", causing isSubsetMatch(false, true)
to return true — silently skipping saves when boolean flags are toggled
from true to false (e.g., lowercase, fixPointArithmetic, final).

Now only null, undefined, "", [], and {} are empty-like. An explicit
`false` is compared against SAP's value as a real change.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 2, 2026 13:36
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Modified the isEmpty helper function within checkMetadataUnchanged() in packages/adk/src/base/model.ts to exclude boolean false from empty-like values. Now only null, undefined, empty strings, empty arrays, and empty objects are treated as empty-like, with an updated comment explaining that boolean flags require explicit comparison.

Changes

Cohort / File(s) Summary
Empty-Like Equivalence Logic
packages/adk/src/base/model.ts
Modified isEmpty helper to exclude boolean false from empty-like classification; adjusted metadata comparison logic and comment to require explicit boolean flag detection.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 False flags no longer hide in shadows deep,
Now booleans stand proud, their truths to keep,
A tiny tweak in logic's gentle way,
Makes metadata comparisons work just right today! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main fix: removing false from isEmpty in checkMetadataUnchanged, which directly addresses the bug described in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/abapgit-roundtrip

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Apr 2, 2026

View your CI Pipeline Execution ↗ for commit 7d3d903

Command Status Duration Result
nx affected -t lint test build e2e-ci --verbose... ✅ Succeeded 19s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-02 13:38:12 UTC

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

@ThePlenkov ThePlenkov merged commit 658f86b into main Apr 2, 2026
3 of 4 checks passed
@ThePlenkov ThePlenkov deleted the feat/abapgit-roundtrip branch April 2, 2026 13:38
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Stale comment still lists false as an empty-like value after it was explicitly removed

Line 867 contains the comment // Both empty-like → match (handles null/undefined/""/false/[]/{} which still lists false as an empty-like value. However, this PR explicitly removed false from the isEmpty function (line 858-862) and added a comment (line 856-857) clarifying that false is NOT empty-like. The stale comment contradicts the new behavior and could mislead future developers into thinking isEmpty(false) returns true when it now returns false.

(Refers to lines 867-868)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

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

Fixes ADK metadata “unchanged” detection so explicit boolean false is no longer treated as empty-like, preventing saves from being silently skipped when flags toggle from truefalse.

Changes:

  • Update checkMetadataUnchanged() empty-like detection to exclude false.
  • Adjust inline documentation/examples to reflect that false must be compared as a real value.

Comment on lines +853 to +857
// "Empty-like" values (null, undefined, "", [], {}) are treated
// as equivalent, since SAP normalizes defaults differently than
// abapGit serialization (e.g., style "" → "00", missing → false).
// abapGit serialization (e.g., style "" → "00", missing → undefined).
// Note: `false` is NOT empty-like — an explicit `false` must be
// compared against SAP's value to detect boolean flag toggles.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline documentation is now inconsistent with the updated isEmpty semantics. In this same function, the comment above the isEmpty(local) && isEmpty(sap) branch still mentions false as an empty-like value, and earlier in save() the comment still lists false as empty-like (around lines ~486-487). Please update those comments to match the new behavior (only null/undefined/""/[]/{} are empty-like, and false is compared as a real value).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

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