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

Wr/improve did you mean #1329

Merged
merged 5 commits into from
Jun 3, 2024
Merged

Wr/improve did you mean #1329

merged 5 commits into from
Jun 3, 2024

Conversation

WillieRuemmele
Copy link
Member

What does this PR do?

fixes a bug when a MD format file was converted to MD format, it would strip the last char from the file path, and then cause a error when trying to identify the metadata with the then incorrect suffix

fixes error
it now emits a warning when md format files are found and the toFormat is metadata

What issues does this PR fix or reference?

@W-15783171@

Functionality Before

 ➜  sf project convert source --output-dir md --source-dir force-app/main/default/enablementMeasureDefinitions
Error (1): /Users/william.ruemmele/projects/scratches/dreamhouse-lwc/md/enablementMeasureDefinitions/testing.enablementMeasureDefinitio: Could not infer a metadata type

Try this:

A metadata type lookup for "testing.enablementMeasureDefinitio" found the following close matches:
-- Did you mean ".enablementMeasureDefinition" instead for the "EnablementMeasureDefinition" metadata type?

Functionality After

 ➜  ../../oss/plugin-deploy-retrieve/bin/run.js project convert source --output-dir md/format --source-dir force-app/main/default/enablementMeasureDefinitions 
Warning: Potential metadata-format file enablementMeasureDefinitions/testing.enablementMeasureDefinition found in a source-format directory
Source was successfully converted to Metadata API format and written to the location: /Users/william.ruemmele/projects/scratches/dreamhouse-lwc/md/format

@WillieRuemmele WillieRuemmele requested a review from a team as a code owner May 29, 2024 21:58
genUniqueDir: false,
outputDirectory: 'output',
});
expect(lifecycleSpy.calledOnce).to.be.true;
Copy link
Contributor

Choose a reason for hiding this comment

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

if this comes back false does that mean it was not called, or called twice?
[see below comment...does the warning count matter, or does the test only care that the expected warning happened?]

Suggested change
expect(lifecycleSpy.calledOnce).to.be.true;
expect(lifecycleSpy.callCount).to.equal(1);

outputDirectory: 'output',
});
expect(lifecycleSpy.calledOnce).to.be.true;
expect(lifecycleSpy.args[0][0]).to.equal(
Copy link
Contributor

Choose a reason for hiding this comment

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

can you write this to assert that the expected error exists, not its ordinality, so that some future warning doesn't break the UT?

@mshanemc
Copy link
Contributor

mshanemc commented Jun 3, 2024

QA:

converted project to MDAPI, deleted applications/dreamhouse, then put the mdapi version in its place
✅ sees warning

change Broker__c.object-meta.xml => Broker__c.object
📓 no warning (maybe ok, we're only addressing the "basic" type since object is quite a different format?

change a flexipage
✅ get 2 warnings

tested:

✅ apexClass ( w/ content type because those have 2 files, one w/ and without the -meta.xml)
✅ bundles (lwc, aura) because bundles don't have a -meta.xml on most of their files in content

@mshanemc mshanemc merged commit 8830972 into main Jun 3, 2024
68 of 70 checks passed
@mshanemc mshanemc deleted the wr/improveDidYouMean branch June 3, 2024 22:54
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