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

specificTestClasses is added incorrectly to EmailServicesFunction #830

Closed
1 task done
bhushanpuri1991 opened this issue Apr 15, 2024 · 14 comments · Fixed by #831 or #844
Closed
1 task done

specificTestClasses is added incorrectly to EmailServicesFunction #830

bhushanpuri1991 opened this issue Apr 15, 2024 · 14 comments · Fixed by #831 or #844
Assignees
Labels
bug Something isn't working

Comments

@bhushanpuri1991
Copy link

Issue verification check:

  • is the current repository fully deployable at the commit SHA provided with the 'from' parameter of the command?

What is the problem?

When running sfdx sgd:source:delta --to HEAD --from HEAD^ --output . --ignore .gitignore, the output package.xml includes specificTestClasses as member of EmailServicesFunction.

<types>
        <members>specificTestClasses</members>
        <name>EmailServicesFunction</name>
</types>

This happens with 5.35.0 & latest-rc but NOT with 5.30.0

What is the parameter and the value you used with it?

sfdx sgd:source:delta --to HEAD --from HEAD^ --output . --ignore .gitignore

What is the expected result?

As there was no change on EmailServicesFunction, the following should have not appeared:

<types>
        <members>specificTestClasses</members>
        <name>EmailServicesFunction</name>
</types>

What is the actual result?

<types>
        <members>specificTestClasses</members>
        <name>EmailServicesFunction</name>
</types>

Steps to reproduce

  1. Include an Apex Class in commit
  2. Run sfdx plugins:install "sfdx-git-delta"
  3. Run sfdx sgd:source:delta --to HEAD --from HEAD^ --output . --ignore .gitignore
  4. Incorrect package.xml is generated
  5. Run sfdx plugins:install "sfdx-git-delta@5.30.0"
  6. Run sfdx sgd:source:delta --to HEAD --from HEAD^ --output . --ignore .gitignore
  7. Correct package.xml is generated

Execution context

Operating System: … Linux (build)

yarn version: … 1.22.22

node version: … 20.12.1

git version: … 2.43.2

sfdx version: … sfdx-cli@7.209.6

sgd plugin version: … Multiple (refer details above)

More information (optional)

@bhushanpuri1991 bhushanpuri1991 added the bug Something isn't working label Apr 15, 2024
@scolladon
Copy link
Owner

Hi @bhushanpuri1991 !

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

Could you provide the output of this commande please ?

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

I suspect a file named specificTestClasses .xml to be changed in HEAD. If it is the case I can think of 2 solutions (there could be more) :

  • add this file in a .sgdignore file (with the content of the .gitignore) and use it with -i
  • scope the content of the source the plugin should consider using the --source parameter (ex: -s force-app)

@Enszula
Copy link

Enszula commented Apr 15, 2024

Hi @scolladon, @bhushanpuri1991

Same for me in project. Was working fine on friday 11 Apr

issue: unexpected EmailServicesFunction:abc-123-package added/generated in manifest file:
actual:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="[http://soap.sforce.com/2006/04/metadata">](http://soap.sforce.com/2006/04/metadata%22%3E)
    <types>
        <members>abc-123-package</members>
        <name>EmailServicesFunction</name>
    </types>
    <types>
        <members>AssetStatus</members>
        <name>StandardValueSet</name>
    </types>
    <version>58.0</version>
</Package>

expected:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="[http://soap.sforce.com/2006/04/metadata">](http://soap.sforce.com/2006/04/metadata%22%3E)
    <types>
        <members>AssetStatus</members>
        <name>StandardValueSet</name>
    </types>
    <version>58.0</version>
</Package>

Not sure exactly what wrong. But newest delta was picking file outside force-app/
ex i wrote script to create manifest file for each pull request based on feature branch name
ex. for feature branch: feature/abc-123 pipeline will create:
./manifest/abc-123-package.xml (thanks to @scolladon delta)

Temporary Resolution:
Downgraded
from: v5.38.2
to(last successfulyl working for me): sf plugins:install sfdx-git-delta@v5.34.0
to resolve issue in pipeline.

Thanks

@scolladon
Copy link
Owner

Yes @Enszula, you're right, everything was working fine past friday.

I moved the latest channel to the same version as the latest-rc this morning because the latest-rc was live without major issue for a long enough time.

The issue you have is the result of a feature introduced in v5.35.0.
This is mainly because the EmailServicesFunction metadata type have the xml suffix (it's a bit odd IMHO)...

I'll ship a fix tomorrow to only detect this type using the folder and not the file type as the suffix is not specific enough.
In the meantime you can have the old behavior for metadata type resolution using the v5.34.0 (or the stable channel).

Stay tuned.

@TonyWhiteSMS
Copy link

Yep spotted this crop up over the last few days ourselves. Look forward to seeing a fix tomorrow.

@Sero030
Copy link

Sero030 commented Apr 16, 2024

Faced the same issue, the files from Manifest folder are getting included in the package.xml as EmailServicesFunction. Added the --source ./force-app parameter to the command, it fixed the above issue, but for me it's still including the force-app folder as Experience Bundle now

image

Edit - Downgrading the version worked for me.

@scolladon
Copy link
Owner

Hi @Sero030, the issue with the force-app folder requires a different fix than for EmailServicesFunction. I need more information, especially a way to reproduce so I can investigate further. You could even create another issue to treat this

Could you provide the result of this command please :

$ git diff --name-status --no-renames <from> <to>

I suspect there are files in the force-app folder that are not metadata (like eslint files per example) but are interpreted like so.

@Sero030
Copy link

Sero030 commented Apr 16, 2024

Hi @Sero030, the issue with the force-app folder requires a different fix than for EmailServicesFunction. I need more information, especially a way to reproduce so I can investigate further. You could even create another issue to treat this

Could you provide the result of this command please :

$ git diff --name-status --no-renames <from> <to>

I suspect there are files in the force-app folder that are not metadata (like eslint files per example) but are interpreted like so.

Ran the above command, Can't list all the files, but these are the additional files other than required metadata files I can see -

M	.gitignore
A	.sf/config.json
A	commit-id.txt
M	destructive/destructiveChanges.xml
M	destructive/package.xml
M	manifest/package1_staticresources.xml
M	manifest/package2_independentcomponents.xml
M	manifest/package3_source.xml
M	sfdx-project.json
M	versionValue.txt 

But all these files I have checked in the branch are out of force-app folder. Also the pipeline was working without any issues till last Thursday. When I used the same commit as last successful deployment today, it fails with this issue.

@scolladon
Copy link
Owner

Thanks @Sero030, I explained why you have this issue since monday in this post.

Could you give me access to the repository and give me instructions to reproduce please ?
I need to have a setup to reproduce the issue and debug.
You can use my email on my github public profile if you need to share information.

Copy link

Shipped in release v5.38.3.
You can install the new version using the version number or the latest-rc channel

$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install sfdx-git-delta@v5.38.3

Happy incremental deployment!

@bhushanpuri1991
Copy link
Author

@scolladon, sadly, a similar issue happens with Readme.md and Custom Metadata. See the package.xml below:

<types>
        <members>README</members>
        <name>CustomMetadata</name>
</types>

@scolladon
Copy link
Owner

Thanks for logging it @bhushanpuri1991
I'll ship a fix soon. Stay tuned

@scolladon scolladon reopened this Apr 22, 2024
@bhushanpuri1991
Copy link
Author

@scolladon, Many thanks.
On a different note, I am planning to replace sfdx with sf. How shall the source-delta command look like?

@scolladon
Copy link
Owner

I hope you'll find all the information you need here @bhushanpuri1991 :)

Copy link

Shipped in release v5.39.1.
You can install the new version using the version number or the latest-rc channel

$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install sfdx-git-delta@v5.39.1

Happy incremental deployment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants