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

fix: issue when filtering same file name for different metadata #196

Merged
merged 4 commits into from
Oct 13, 2021

Conversation

scolladon
Copy link
Owner

What does this pull request contains


  • Added for new features.
  • Changed for changes in existing functionality.
  • Deprecated for soon-to-be removed features.
  • Removed for now removed features.
  • Fixed for any bug fixes.
  • Security in case of vulnerabilities.

Explain your changes


It builds a more complete base of comparison to detect which file is deleted, renamed, added, moved by taking part of the path containing available metadata type.
For exemple :
force-app/main/default/objects/Account/fields/CustomField__c.field-meta.xml
before the algorithm was taking CustomField__c.field-meta.xml as comparison element
now it takes objects/Account/fields/CustomField__c.field-meta.xml
which allow to have the same field for another object being manipulated by the plugin

Does this close any currently open issues?


closes #193

  • Jest test to check the fix is applied are added.

Any particular element to being able to test locally


You can use the sgd reproduction playground branch issue/193 to test current version of sgd (4.9.0) against the one in this PR

Any other comments?


Next release can be considered to ship this

Where has this been tested?


Operating System: Darwin Kernel Version 19.6.0: Thu Sep 16 20:58:47 PDT 2021; root:xnu-6153.141.40.1~1/RELEASE_X86_64

yarn version: 1.22.11

node version: v16.10.0

git version: 2.33.0

sfdx version: sfdx-cli/7.120.0 darwin-x64 node-v16.10.0

sgd plugin version: 4.9.0

@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #196 (886589f) into master (94e7261) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #196   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        20    +1     
  Lines          462       482   +20     
=========================================
+ Hits           462       482   +20     
Impacted Files Coverage Δ
src/main.js 100.00% <100.00%> (ø)
src/service/inTranslationHandler.js 100.00% <100.00%> (ø)
src/service/subCustomObjectHandler.js 100.00% <100.00%> (ø)
src/service/typeHandlerFactory.js 100.00% <100.00%> (ø)
src/utils/repoGitDiff.js 100.00% <100.00%> (ø)
src/utils/typeUtils.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94e7261...886589f. Read the comment docs.

line
.split(path.sep)
.some(part => Object.prototype.hasOwnProperty.call(metadata, part))
_treatResult(repoDiffResult) {
Copy link

Choose a reason for hiding this comment

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

Function _treatResult has 26 lines of code (exceeds 25 allowed). Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Oct 12, 2021

Code Climate has analyzed commit 886589f and detected 0 issues on this pull request.

View more on Code Climate.

@scolladon scolladon merged commit ca7488b into master Oct 13, 2021
@scolladon scolladon deleted the fix/do-not-filter-same-name-different-metadata branch October 13, 2021 13:46
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.

Renaming field name - not destroying the old one - git status R100 and R065
2 participants