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

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

Closed

Description

@Schuchie

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

Activity

  1. added
    analysis
    on Jun 7, 2023
  2. petter-eikeland commented on Jun 9, 2023

    @petter-eikeland

    Agree!

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

  3. added
    bug
    and removed
    analysis
    on Jun 15, 2023
  4. Rocko1204 commented on Jun 16, 2023

    @Rocko1204
    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

  5. Schuchie commented on Jun 16, 2023

    @Schuchie
    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')
    
  6. added a commit that references this issue on Jun 23, 2023
    672902b
  7. added a commit that references this issue on Aug 11, 2023
    477d36c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions