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.

Validation of sfdx-project.json blocks other extensions #1256

Closed

Description

@Schuchie

Describe the bug
The validation of sfpowerscripts blocks the extension from the sfdx-project.json. Sfpowerscripts should only validate json ranges that are managed by Sfpowerscript. 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:orchestrator:validate

Screenshots/Log

ERROR running sfpowerscripts:orchestrator:validate:  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 sfpowerscripts: sfpowerkit -- The DX@Scale Developer Toolkit - Version:5.0.0 - Release:August 22
  • Salesforce CLI(sfdx cli) Version: 7.186.2
  • CI Platform: GitHub Actions

Additional context

For features that are currently ported from sfpowerkit to sfpowerscripts and are not yet supported, a validation should be made explicitly on the respective properties (e.g. replacements).
image

Reason for blocking: sfpowerscripts/packages/sfpowerscripts-cli/resources/schemas/sfdx-project.schema.json:33

One way to implement the validation would be with the following:

//sfpowerscripts/packages/sfpowerscripts-cli/resources/schemas/sfdx-project.schema.json:34
                "properties": {
                    "replacements": {
                        "not": {}
                    },
                    "ancestorId": {
                        "$ref": "#/definitions/packageDirectory.ancestorId"
                    },

would result into the following error:
image

Activity

  1. changed the title [-]Validation of sfdx-project.json blocks other extension[/-] [+]Validation of sfdx-project.json blocks other extensions[/+] on Mar 2, 2023
  2. added
    analysis
    on Mar 2, 2023
  3. added
    enhancement
    and removed
    analysis
    on Mar 3, 2023
  4. azlam-abdulsalam commented on Mar 3, 2023

    @azlam-abdulsalam
    Contributor

    The validation is removed in February 23 release, future work will be scheduled for validation of properties used by sfpowerscripts or disabling features not suppoerted

  5. added a commit that references this issue on Mar 21, 2023
    e004843
  6. added a commit that references this issue on Aug 8, 2025
    43dcacb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions