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

Error when there is a flow in the destructive package #980

Closed
1 task done
elliot41 opened this issue Jan 9, 2025 · 8 comments · Fixed by #983
Closed
1 task done

Error when there is a flow in the destructive package #980

elliot41 opened this issue Jan 9, 2025 · 8 comments · Fixed by #983
Assignees
Labels
bug Something isn't working

Comments

@elliot41
Copy link

elliot41 commented Jan 9, 2025

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?

Error when there is a flow in the destructive package

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

sf sgd:source:delta --to "HEAD" --from "HEAD~1" --output-dir ./changed-sources --generate-delta --json

What is the expected result?

{
"status": 0,
"result": {
"output-dir": "./changed-sources"
},
"warnings": []
}

What is the actual result?

{
"status": 1,
"output-dir": "./changed-sources",
"error": "Cannot read properties of undefined (reading 'warnings')"
},
"warnings": []
}

Execution context


11.0.0
v22.12.0
git version 2.41.0.windows.1
@salesforce/cli/2.70.7 win32-x64 node-v22.12.0
sfdx-git-delta 6.0.0

Operating System: Windows 10

npm version: 11.0.0

node version: v22.12.0

git version: git version 2.41.0.windows.1

sf version: @salesforce/cli/2.70.7 win32-x64 node-v22.12.0

sgd plugin version: sfdx-git-delta 6.0.0


@elliot41 elliot41 added the bug Something isn't working label Jan 9, 2025
@elliot41
Copy link
Author

elliot41 commented Jan 9, 2025

git diff --name-status --no-renames "HEAD" "HEAD~1"
A force-app/main/default/flows/SOSLive.flow-meta.xml

@scolladon scolladon changed the title [Error when there is a flow in the destructive package] Error when there is a flow in the destructive package Jan 9, 2025
@scolladon
Copy link
Owner

Hi @elliot41 !

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

Thanks for all the information, I'll try soon to reproduce this locally.
If my understanding is correct, I juste need to have a commit with a flow deletion and it should reproduce the issue right ?

@elliot41
Copy link
Author

elliot41 commented Jan 9, 2025

Yes, just commit with a flow deletion.

Thanks for your work :)
I'm on Bouygues Telecom, a project where you worked I think :)

@scolladon
Copy link
Owner

scolladon commented Jan 9, 2025

That's true I work there a few months a few years ago :)
I hope everything goes fine :)

I tried to reproduce locally and was not successful at it
I created a branch in our reproduction playground where I have committed a flow creation and then committed its deletion.
I then run the following command : sf sgd source delta -f HEAD~1 -d
And I see the flow is listed in the destructive changes:

cat output/destructiveChanges/destructiveChanges.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>FlowTest</members>
        <name>Flow</name>
    </types>
    <version>61.0</version>
</Package>

Do you have the same behavior as me with my branch ? Or do you have an issue with my branch ?
Maybe this is related to a content of the flow ? Could you share a content that reproduce the issue ?
Maybe this is related to a translation ?

@elliot41
Copy link
Author

elliot41 commented Jan 9, 2025

Yes everything goes fine here thanks :)

I tried with differents flow, and it is the same.
In fact I should have been more accurate. The desctrutive package is well generated.

The issue that I face is in the output of the sgd command. In fact, if you put the --json flag, in my repo, I have this issue :

{
"status": 1,
"output-dir": "./changed-sources",
"error": "Cannot read properties of undefined (reading 'warnings')"
},
"warnings": []
}

The status is 1 instead of 0, and my pipeline fails.

@elliot41
Copy link
Author

elliot41 commented Jan 9, 2025

I tried with a very simple test flow and I face the same thing :

sf sgd:source:delta --to "HEAD" --from "HEAD~1" --output-dir ./changed-sources --generate-delta --json
{
"status": 1,
"result": {
"output-dir": "./changed-sources",
"error": "Cannot read properties of undefined (reading 'warnings')"
},
"warnings": []
}

And my flow :

62.0 Default aTestFlow {!$Flow.CurrentDateTime} aTestFlow BuilderType LightningFlowBuilder CanvasMode AUTO_LAYOUT_CANVAS OriginBuilderType LightningFlowBuilder Flow testScreen test 176 134 true true true test String hello test InputField UseStoredValues false true true 50 0 testScreen Draft

@scolladon
Copy link
Owner

I reproduce now, thanks
I'll investigate and fix it soon

Copy link

github-actions bot commented Jan 9, 2025

Shipped in release v6.0.2.
Version v6.0.2 will be assigned to the latest npm channel soon
Install it using either v6.0.2 or the latest-rc npm channel

$ sf plugins install sfdx-git-delta@latest-rc
# Or
$ sf plugins install [email protected]

💡 Enjoying sfdx-git-delta?
Your contribution helps us provide fast support 🚀 and high quality features 🔥
Become a sponsor 💙
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
Development

Successfully merging a pull request may close this issue.

2 participants