Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DXCDT-373: Address notation for keyword preservation #741

Merged
merged 16 commits into from
Feb 14, 2023

Conversation

willvedd
Copy link
Contributor

@willvedd willvedd commented Feb 13, 2023

🔧 Changes

Building off of the previous few PRs for keyword preservation (#736, #738 , #740), this PR introduces the concept of an "address". An address is a proprietary notation for looking-up properties within an arbitrary data structure, similar to JSON dot notation. The primary difference is the ability to identify array items by a unique field instead of order. What this does is set us up to identify preservable fields in on asset tree and then look-up its value on another asset tree by the address.

Example:

{
  "tenant": {
    "friendly_name": "Friendly name ##KEYWORD##"
  },
  "actions": [
    {
      "name": "action-1",
      "enabled": true
    }
  ]
}

Address for tenant friendly_name field: tenant.friendly_name
Address for action name field: actions.[name=action-1].name

📚 References

Related Issues:

#328
#688

🔬 Testing

Added and updated unit tests.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@willvedd willvedd requested a review from a team as a code owner February 13, 2023 23:04
@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2023

Codecov Report

Base: 83.72% // Head: 83.75% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (8dac9f5) compared to base (808aa3e).
Patch coverage: 90.90% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #741      +/-   ##
==========================================
+ Coverage   83.72%   83.75%   +0.03%     
==========================================
  Files         115      115              
  Lines        3403     3422      +19     
  Branches      634      640       +6     
==========================================
+ Hits         2849     2866      +17     
  Misses        324      324              
- Partials      230      232       +2     
Impacted Files Coverage Δ
src/keywordPreservation.ts 94.87% <90.90%> (-5.13%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Base automatically changed from DXCDT-372-preserve-keywords-traverse-assets to master February 14, 2023 08:11
@sergiught sergiught force-pushed the DXCDT-373-keyword-preservation-address-notation branch from a76e9a6 to 2a23090 Compare February 14, 2023 08:19
@willvedd willvedd merged commit ec3d248 into master Feb 14, 2023
@willvedd willvedd deleted the DXCDT-373-keyword-preservation-address-notation branch February 14, 2023 16:38
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.

3 participants