Cli: .forceignore **.md bug

Created on 12 Mar 2019  ·  17Comments  ·  Source: forcedotcom/cli

Summary

Following this guide on excluding files when syncing or pushing to a scratch org I implemented **.md in my .forceignore.
Vivek also includes this notation in his template repo's forceignore.

There is an issue with the way sfdx is handling **.md in the forceignore and custom metadata when pushing to the org. If you have a customMetadata file named MyCustomMetadata.md-meta.xml, this will be ignored.

Steps To Reproduce:

  1. Step 1. Have a custom metadata file in your source directory named something like MyCustomMetadata.md-meta.xml
  2. Step 2. Have **.md in the forceignore file
  3. Step 3. Deploy to your scratch org, noting that your custom metadata isn't deployed.
  4. Step 4. Remove **.md in the forceignore file and redeploy to your scratch org. Take note that it deploys the custom metadata.

Expected result

Only .md extensions should be ignored, not .md-meta.xml, when adding **.md to the .forceignore file.

I could understand this behavior if I had added **.md* to the .forceignore file.

Actual result

.md-meta.xml files are not deployed with **.md in the .forceignore file.

Additional information

sfdx-cli/6.56.0 (darwin-x64) node-v8.15.1

@salesforce/plugin-generator 1.0.1 (core)
@salesforce/sfdx-trust 2.1.0 (core)
builtins 1.0.0 (core)
salesforcedx 45.5.0 (core)

Mac OS Mojave 10.14.3 (18D42)

bug

All 17 comments

@Kevmo92 thank you for reporting this. We have added it to our backlog.

Just ran into this issue today as well. Thanks so much for reporting this issue; we we're totally stuck.

How did you create the type "md"? Are you creating a custom object and renaming object-meta.xml to md-meta.xml?

Do you have steps to create this object in the lighting UI? That would help greatly.

It was actually due to creating a custom metadata type.
Charles Naccio
Founder
p:(855) 550-0606
m:(214) 305-8684
w:www.billable.io

On Fri, Apr 12, 2019 at 12:37 PM tnoonan-salesforce <
[email protected]> wrote:

How did you create the type "md"? Are you creating a custom object and
renaming object-meta.xml to md-meta.xml?

Do you have steps to create this object in the lighting UI? That would
help greatly.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/forcedotcom/cli/issues/48#issuecomment-482660267, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHq1Nzc3wA653cW3LXknBbdZkOIakq25ks5vgMRZgaJpZM4bryGQ
.

So if I create custom metadata type in Lightning:

Screen Shot 2019-04-12 at 12 38 26 PM

And pull the source I get a custom object that does not have an md extension. It's (object-meta.xml).

Screen Shot 2019-04-12 at 12 42 28 PM

@tnoonan-salesforce Thanks for the information! I believe our source code has .md-meta.xml files due to our source being converted from a mdapi format into the new sfdx source format.

I went through creating a new custom metadata type in a scratch org and it is creating mdt files like you've shown. However, this only solves the issue for new custom metadata files though 🙁
At least, I don't think i can simply rename a customMetadata/myCustomMetadata.md-meta.xml to a objects/myCustomMetadata__mdt/myCustomMetadata__mdt.object-meta.xml 🤔

I would still argue that **.md should only ignore .md extensions too. As it stands, **.md in the .forceignore file acts as if it's **.md*

Awesome ok we are getting somewhere. Can you describe how you did the source convert?

When we do a source:pull it runs the exact same source convert behind the scenes.

I don't disagree with on .forceignore. but it's important to know how this scenario evolved.

We had the issue even without converting. Our metadata files are stored
with .md-meta.xml extensions and the *.md pattern in our .forceignore
matches this file name. Removing it solved the issue.

On Fri, Apr 12, 2019 at 4:14 PM tnoonan-salesforce notifications@github.com
wrote:

Awesome ok we are getting somewhere. Can you describe how you did the
source convert?

When we do a source:pull it runs the exact same source convert behind the
scenes.

I don't disagree with on .forceignore. but it's important to know how this
scenario evolved.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/forcedotcom/cli/issues/48#issuecomment-482725254, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHq1N_Ys6IluVkEmoUFFJctcCujN5zBGks5vgPcjgaJpZM4bryGQ
.

@Kevmo92 , @cnaccio , this looks like a generic issue and not just related to metadata files. I am working on it and will update as soon as I am able to fix it. Thanks!

Awesome thanks!

On Wed, Apr 17, 2019 at 4:18 PM nramyasri-sf notifications@github.com
wrote:

@Kevmo92 https://github.com/Kevmo92 , @cnaccio
https://github.com/cnaccio , this looks like a generic issue and not
just related to metadata files. I am working on it and will update as soon
as I am able to fix it. Thanks!


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/forcedotcom/cli/issues/48#issuecomment-484265219, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB5LKN53W4N4B3DIDQSBP43PQ6HYVANCNFSM4G5PEGIA
.

>

Charles Naccio
Founder
p:(855) 550-0606
m:(214) 305-8684
w:www.billable.io

@nramyasri-sf Thank you!

Meanwhile as a workaround, please add : !**.md-meta.xml to your .forceignore file.

@clairebianchi @nramyasri-sf Any update on this bug?

@nramyasri-sf the workaround does not work either, even with !**.md-meta.xml added to my forceignore

anyone found a workaround for this?

We updated the library we use to be more like gitignore in 7.75.1. 55.1.0. We have to slowly roll out this change though as to not break existing forceignore files. Can you try to add the following to your forceignore file to see if it resolves your issue?

# .forceignore v2

Still no luck.

Here is what my current force ignore file looks like

Profiles

Custom%3A Sales Profile.profile
Custom%3A Marketing Profile.profile
Custom%3A Support Profile.profile
Trial Customer Portal User.profile
sfdx-source/hsp/main/default/profiles/Custom%3A Sales
Profile.profile-meta.xml
sfdx-source/hsp/main/default/profiles/Custom%3A Marketing
Profile.profile-meta.xml
sfdx-source/hsp/main/default/profiles/Custom%3A Support
Profile.profile-meta.xml

Custom metadata

Uncomment to prevent custom metadata from being considered

sfdx-source/unpackaged/main/default/customMetada/*.md-meta.xml

*/jsconfig.json
*
/.eslintrc.json

.forceignore v2

On Tue, Oct 20, 2020 at 10:16 PM Thomas Dvornik notifications@github.com
wrote:

We updated the library we use to be more like gitignore in 7.75.1. 55.1.0
https://github.com/forcedotcom/cli/blob/master/releasenotes/README.md#other-changes.
We have to slowly roll out this change though as to not break existing
forceignore files. Can you try to add the following to your forceignore
file to see if it resolves your issue?

.forceignore v2


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/forcedotcom/cli/issues/48#issuecomment-713308983, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAHJXINFKZ2D6OZMQB2FPNTSLZVETANCNFSM4G5PEGIA
.

--
Thanks

Was this page helpful?
0 / 5 - 0 ratings