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

Custom Fields not recognized in latest version #869

Closed
JulienDryepondt opened this issue May 16, 2024 · 8 comments
Closed

Custom Fields not recognized in latest version #869

JulienDryepondt opened this issue May 16, 2024 · 8 comments
Assignees
Labels
bug Something isn't working reproduction steps needed Need reproduction steps to further with the analysis

Comments

@JulienDryepondt
Copy link

What is the problem?

While doing
mkdir output && sfdx sgd:source:delta -d -t HEAD -f $LAST_DEPLOYED_COMMIT -i .forceignore -o output
my custom fields aren't inside the package.xml or in the force-app/main/default

What is the expected result?

Fields should be included inside the force-app folder.

Steps to reproduce

Download latest plugin (tested with 5.39 and 5.40) with
echo y | sfdx plugins:install -f sfdx-git-delta
and launch command using SHA1 including fields
sfdx sgd:source:delta -d -t HEAD -f $LAST_DEPLOYED_COMMIT -i .forceignore -o output

More information (optional)

I found a workaround, i changed the version installed of the plugins.
echo y | sfdx plugins:install -f sfdx-git-delta@5.3.0
And then i found my field TEST__c.field-meta.xml inside the force-app folder.

@JulienDryepondt JulienDryepondt added the bug Something isn't working label May 16, 2024
@scolladon
Copy link
Owner

Hi @JulienDryepondt !

Thanks for raising this issue and thanks for contributing in making this project better!

I just had a look to our E2E test and there does not seems to be a regression there

Could you help us reproduce the issue by providing the steps to reproduce it please ?
What commit I should create locally to have the issue and what command should I execute ?

@JulienDryepondt
Copy link
Author

It's a gitlab runner doing the commands
I put in CICD variable the current SHA1 HEAD in the variable named LAST_DEPLOYED_COMMIT from the branch where you want to test
I add a text TEST__c field inside Accound object. I commited it and pushed it.

The runner does
`- echo y | sfdx plugins:install -f sfdx-git-delta

  • mkdir output && sfdx sgd:source:delta -d -t HEAD -f $LAST_DEPLOYED_COMMIT -i .forceignore -o output
  • if [ -d output/force-app ]; then rm -rf force-app && mv output/force-app .; else echo "Delta is empty, please check the variable inside settings" && exit 1 ; fi`

I entered in the case where the Delta is empty so it doesn't find anything.

By changing the pluging version and not taking the lastest, i don't enter in my custom error message. I hoped this is the reason. But it might be a combination of different versions of tools since you don't have the issue.

@scolladon
Copy link
Owner

I see.

Could you show us the result of this command please:

$ git diff --name-status --no-renames $LAST_DEPLOYED_COMMIT HEAD

And if you could replicate the issue inside a fork of our reproduction playground and give me access to your fork it would be greatly helpful !

@JulienDryepondt
Copy link
Author

Here's my script logs on latest version :

$ git diff --name-status --no-renames $LAST_DEPLOYED_COMMIT HEAD
M	.gitlab-ci.yml
D	.husky/pre-commit
A	force-app/main/default/objects/Account/fields/TEST_JDR2__c.field-metal.xml
A	package-lock.json
A	pipeline/deploy.sh

And lower with the command sfdx sgd:source:delta -d -t HEAD -f $LAST_DEPLOYED_COMMIT -i .forceignore -o output

$ mkdir output && sfdx sgd:source:delta -d -t HEAD -f $LAST_DEPLOYED_COMMIT -i .forceignore -o output
(node:665445) Warning: Deprecated config name: apiVersion. Please use org-api-version instead.
(Use `node --trace-warnings ...` to show where the warning was created)
{
  "error": null,
  "output": "output",
  "success": true,
  "warnings": []
}
$ ls output/force-app/main/default
ls: cannot access 'output/force-app/main/default': No such file or directory

I'll try to reproduce on a fork tommorow

@scolladon
Copy link
Owner

Thanks for that already, could you show the content of the forceignore file before doing the reproduction setup in the fork please ?

@JulienDryepondt
Copy link
Author

forceignore is the standard one at the creation of an sfdx project

# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
#

package.xml

# LWC configuration files
**/jsconfig.json
**/.eslintrc.json

# LWC Jest
**/__tests__/**

@scolladon
Copy link
Owner

Hi @JulienDryepondt
I think the issue is from the name of the file:
force-app/main/default/objects/Account/fields/TEST_JDR2__c.field-metal.xml => it has an "l" at the of meta (metal.xml).
It should be ...-meta.xml IMO

Could you try renaming the file force-app/main/default/objects/Account/fields/TEST_JDR2__c.field-meta.xml please ?

@scolladon scolladon added the reproduction steps needed Need reproduction steps to further with the analysis label May 19, 2024
@JulienDryepondt
Copy link
Author

Hello, sorry for the delay.

You pointed my error, thanks. It's working as expected now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working reproduction steps needed Need reproduction steps to further with the analysis
Projects
None yet
Development

No branches or pull requests

2 participants