Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Additionally attributes in sfdx-project.json is blocked #1329

Closed
Schuchie opened this issue Jun 7, 2023 · 3 comments
Closed

Additionally attributes in sfdx-project.json is blocked #1329

Schuchie opened this issue Jun 7, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Schuchie
Copy link
Contributor

Schuchie commented Jun 7, 2023

Describe the bug
The validation of the sfdx-project.json in sfpowerscripts blocks the extension from the sfdx-project.json. Sfpowerscripts should only validate json ranges that are managed by Sfpowerscript or just throw an warning. Otherwise third party extensions will be blocked or prevented from adding properties e.g. to the packages.

To Reproduce
Steps to reproduce the behavior:
For example add a property to the one of the package, which is not included/supported by sfpowerscripts, but in another package:

{
  "packageDirectories": [
    {
      "path": "./src-translation",
      "package": "translation",
      "versionNumber": "1.0.0.0",
      "testProperty": ["Test","Test123"],
      "dependencies": []
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "57.0",
  "packageAliases": {}
}

Expected behavior
No error happens on running the command sfdx sfpowerscripts:dependency:shrink

Screenshots/Log

ERROR running sfpowerscripts:dependency:shrink :  The sfdx-project.json is invalid, Please fix the following errors

1: /packageDirectories/4: must NOT have additional properties {
    "additionalProperty": "testProperty"
}
Error: Process completed with exit code 1.

Platform Details (please complete the following information):

  • OS: Ubuntu
  • Version @dxatscale/sfpowerscripts 20.20.3
  • Salesforce CLI(sfdx cli) Version: 7.186.2
  • CI Platform: GitHub Actions

Additional context
Similar issue as #1256

@github-actions github-actions bot added the analysis To be decided on how to solution/fix label Jun 7, 2023
@petter-eikeland
Copy link

Agree!

I'm currently using the "tags" attribute to handle custom attribute needs 😄

@azlam-abdulsalam azlam-abdulsalam added bug Something isn't working and removed analysis To be decided on how to solution/fix labels Jun 15, 2023
@Rocko1204
Copy link
Contributor

Hi @Schuchie Can you please update your sfpowerscripts version (20.20.3 > min 20.26.2). The additional property function was activated with version 20.26.2 in the february 26 release. Please test it and give a small feedback. Thx and Regards Ronny

@Schuchie
Copy link
Contributor Author

Hey @Rocko1204 ,
I think you're right. The validation isnt a problem anymore. Looks more like some fine tuning on my site with the command:

-------------------------------------------------------------------------------------------
sfpowerscripts  -- The DX@Scale CI/CD Orchestrator -Version:21.1.0 -Release:April 23
-------------------------------------------------------------------------------------------
Shrinking Project Dependencies...
Validating Project Dependencies...
ERROR running sfpowerscripts:dependency:shrink:  Unable to shrink project config file:TypeError: Cannot set properties of undefined (setting 'externalDependencyMap')

azlam-abdulsalam pushed a commit that referenced this issue Jun 23, 2023
fixes #1329, sfpowerscripts earlier used to error out when new additional attributes are encountered
in sfdx-project.json. This option was later disabled, when the schema was allowed tfor additional
enhancements in  sfdc li . This fchange request rather enahnces it to display warning for itemms
that are not supported by sfpowerscripts but don not error out

fixes #1329
@azlam-abdulsalam azlam-abdulsalam added this to the Release - June 2023 milestone Jun 29, 2023
azlam-abdulsalam pushed a commit that referenced this issue Aug 11, 2023
fixes #1329, sfpowerscripts earlier used to error out when new additional attributes are encountered
in sfdx-project.json. This option was later disabled, when the schema was allowed tfor additional
enhancements in  sfdc li . This fchange request rather enahnces it to display warning for itemms
that are not supported by sfpowerscripts but don not error out

fixes #1329
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants