You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
Unpackaged is exactly that "unpackaged" it is only needed and used for the unit tests in an sfdx package:version:create call.
As far as sfpowerscripts is concerned, I would expect it to be completely ignored as it is ONLY needed by Salesforce for salesforces own package validation of unit tests.
Currently it is blocking, if I have it, it rejects my project file and aborts. I want the unpackaged to be ignored so I can use sfpowerscripts but still package my unlocked packages correctly.
@yippie - Is there a particular business reason why the "unpackaged" test classes would not want to be included in the package creation. In the Salesforce Docs, they do not really specify the business case to not include this but provide it as an option. Just wanted to see the context of this use case and why it would not just be included in the package folder for completeness.
@vuha-acn it is not unpackaged test classes. it is unpackaged Custom Metadata Records for a managed package we depend on. The managed package has triggers on objects we do test against (like task) that throw null pointers if the CMT does not exist (ie, in the packaging org). The "fix" is to include unpackaged CMT during package creation. If we don't include the metadata, our unit tests fail because the managed package code is throwing null pointers expecting a CMT record when there aren't any.
in #921, all three of the things you removed are ONLY used by sfdx force:package:version:create and the only thing sfpowerscripts needs to do to completely support them is to allow the sfdx force:package:version:create command to see them. There is nothing else to do with them so blocking their usage is just removing packaging options from people needlessly.
They are just used by salesforce servers to affect how the package behaves on salesforce servers. They should have no affect on sfpowerscripts or dx@scale flow.
Please put them back in the schema (or better yet, don't do a blocking schema check at all, if sfpowerscripts can add custom options, why can't I for my own use?)
There more I look at this the less sense it makes. sfpowerscripts currently is taking full ownership of sfdx-project and locking everyone else out. To use SFPowerscripts at all I have to ONLY use sfpowerscripts and cannot put my own notes or usage in it or even use all STANDARD salesforce features.
I would like to propose the following change to the sfdx-project.schema.json file to fix this:
Please please please consider doing this change and being better citizens
Yes, we could unblock unpackaged, but unpackaged being generic can point to any other source package or any other path.
During a parallel build sfpowerscripts create individual working directory for each package and we need to ensure the unpackaged directory is correctly copied into the working directory. This is currently not supported and once it is added we can add that back. There is a similar issue raised as #842
On the additional properties path, we are just being strict, for eg, if you add an additional property to unlocked package, it will fail during version:create. All additional sfpowerscripts properties are cleansed before being send to salesforce. .But we could have an optional environment variable to remove the check.
Please feel free to raise a PR or we could schedule for a future release
I would expect it to be completely ignored for all commands and tasks except for calling force:package:version:create. It is often pointing at another "real" package directly as typically you also will want/have the unpackaged in your scratch org for development also. The unpackaged directory is never, and should never, be sent or deployed to any orgs. It is nothing more than required config for unit tests to pass in a "packaging org" basically as a work around for the fact that scratch-def doesn't cover everything.
Yep, the pointing to the 'real' package is where it gets tricky. That means this is a something that need to be part of development scratch org, so it implies it has to be part of prepare as well, where prepare only uses last known validated package to build the scratch org
My current proposal is the following
Any such unpackaged addition shouldn't point to a real package. Lets reject if we find any
We will pack the unpackaged metadata into the artifact and will be deployed 'after' the actual contents of the package is deployed.
Are you trying to fake a packaging org (IE set up a scratch org identically to salesforce package validation orgs)? If you are, sure, but the unpackaged tag should never, ever be deployed to a pool scratch org, development scratch org, sandbox or production...ever.
If something should be deployed, I will, and people should, be making actual packages for them and then you just deploy the regular package list.
Unpackaged means exactly that, unpackaged, it is something that should not be packaged or distributed (although its contents might be shared with a real package). It is in practice and intent, an extension on the scratch-def.json used by salesforce for creating a new package version ID via force:package:version:create.
Please don't ever deploy it or restrict it, just make it available to the force:package:version:create command so that salesforce packaging can succeed. When developing and deploying from artifacts it should not exist.
Best practice is likely the opposite of what you proposed. Likely unpackaged SHOULD be pointing at a real package. That way you are developing with the same config that salesforce packages with. We had it different because we only needed a stripped down subset (3 custom metadata type records) to get unit tests to pass when packaging, but if I had to make it a real package with sfpowerscripts I wouldn't blink.
I guess ultimately what I am asking is that the native force:xxx behavior is maintained and not changed or restricted. force:push/pull never touch or look at the unpackagedMetadata directory. ONLY force:package:create does. As far as any other command is concerned, it doesn't exist and it never sees the light of day after the package is made.
Activity
azlam-abdulsalam commentedon Apr 29, 2022
@yippie We currently do not support 'unpackagedMetadata'. We are looking into how better to address this from an artifact perspective.
Supported schema is
https://github.com/Accenture/sfpowerscripts/blob/main/packages/sfpowerscripts-cli/resources/schemas/sfdx-project.schema.json
Refer to #921
yippie commentedon May 20, 2022
Unpackaged is exactly that "unpackaged" it is only needed and used for the unit tests in an sfdx package:version:create call.
As far as sfpowerscripts is concerned, I would expect it to be completely ignored as it is ONLY needed by Salesforce for salesforces own package validation of unit tests.
Currently it is blocking, if I have it, it rejects my project file and aborts. I want the unpackaged to be ignored so I can use sfpowerscripts but still package my unlocked packages correctly.
vuha-acn commentedon May 20, 2022
@yippie - Is there a particular business reason why the "unpackaged" test classes would not want to be included in the package creation. In the Salesforce Docs, they do not really specify the business case to not include this but provide it as an option. Just wanted to see the context of this use case and why it would not just be included in the package folder for completeness.
yippie commentedon May 20, 2022
@vuha-acn it is not unpackaged test classes. it is unpackaged Custom Metadata Records for a managed package we depend on. The managed package has triggers on objects we do test against (like task) that throw null pointers if the CMT does not exist (ie, in the packaging org). The "fix" is to include unpackaged CMT during package creation. If we don't include the metadata, our unit tests fail because the managed package code is throwing null pointers expecting a CMT record when there aren't any.
yippie commentedon May 20, 2022
in #921, all three of the things you removed are ONLY used by
sfdx force:package:version:createand the only thing sfpowerscripts needs to do to completely support them is to allow thesfdx force:package:version:createcommand to see them. There is nothing else to do with them so blocking their usage is just removing packaging options from people needlessly.They are just used by salesforce servers to affect how the package behaves on salesforce servers. They should have no affect on sfpowerscripts or dx@scale flow.
Please put them back in the schema (or better yet, don't do a blocking schema check at all, if sfpowerscripts can add custom options, why can't I for my own use?)
yippie commentedon May 23, 2022
There more I look at this the less sense it makes. sfpowerscripts currently is taking full ownership of sfdx-project and locking everyone else out. To use SFPowerscripts at all I have to ONLY use sfpowerscripts and cannot put my own notes or usage in it or even use all STANDARD salesforce features.
I would like to propose the following change to the sfdx-project.schema.json file to fix this:

Please please please consider doing this change and being better citizens
azlam-abdulsalam commentedon May 23, 2022
Yes, we could unblock unpackaged, but unpackaged being generic can point to any other source package or any other path.
During a parallel build sfpowerscripts create individual working directory for each package and we need to ensure the unpackaged directory is correctly copied into the working directory. This is currently not supported and once it is added we can add that back. There is a similar issue raised as #842
On the additional properties path, we are just being strict, for eg, if you add an additional property to unlocked package, it will fail during version:create. All additional sfpowerscripts properties are cleansed before being send to salesforce. .But we could have an optional environment variable to remove the check.
Please feel free to raise a PR or we could schedule for a future release
azlam-abdulsalam commentedon May 23, 2022
Also, do you see how this plays out during validate command? Ignore this unpackaged directory?
yippie commentedon May 24, 2022
I would expect it to be completely ignored for all commands and tasks except for calling force:package:version:create. It is often pointing at another "real" package directly as typically you also will want/have the unpackaged in your scratch org for development also. The unpackaged directory is never, and should never, be sent or deployed to any orgs. It is nothing more than required config for unit tests to pass in a "packaging org" basically as a work around for the fact that scratch-def doesn't cover everything.
azlam-abdulsalam commentedon May 25, 2022
Yep, the pointing to the 'real' package is where it gets tricky. That means this is a something that need to be part of development scratch org, so it implies it has to be part of prepare as well, where prepare only uses last known validated package to build the scratch org
My current proposal is the following
yippie commentedon May 26, 2022
Are you trying to fake a packaging org (IE set up a scratch org identically to salesforce package validation orgs)? If you are, sure, but the unpackaged tag should never, ever be deployed to a pool scratch org, development scratch org, sandbox or production...ever.
If something should be deployed, I will, and people should, be making actual packages for them and then you just deploy the regular package list.
Unpackaged means exactly that, unpackaged, it is something that should not be packaged or distributed (although its contents might be shared with a real package). It is in practice and intent, an extension on the scratch-def.json used by salesforce for creating a new package version ID via force:package:version:create.
Please don't ever deploy it or restrict it, just make it available to the force:package:version:create command so that salesforce packaging can succeed. When developing and deploying from artifacts it should not exist.
Best practice is likely the opposite of what you proposed. Likely unpackaged SHOULD be pointing at a real package. That way you are developing with the same config that salesforce packages with. We had it different because we only needed a stripped down subset (3 custom metadata type records) to get unit tests to pass when packaging, but if I had to make it a real package with sfpowerscripts I wouldn't blink.
yippie commentedon May 26, 2022
I guess ultimately what I am asking is that the native
force:xxxbehavior is maintained and not changed or restricted. force:push/pull never touch or look at the unpackagedMetadata directory. ONLYforce:package:createdoes. As far as any other command is concerned, it doesn't exist and it never sees the light of day after the package is made.feat(sfp-package): add support for unpackaged metadata in unlocked pa…
feat(sfp-package): add support for unpackaged metadata in unlocked pa…