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

New force:source:push command JSON output has changed completely and is missing critical information, e.g., error messages/line/column info #1431

Closed
SCWells72 opened this issue Mar 5, 2022 · 6 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@SCWells72
Copy link

With the promotion of the beta commands to GA, the JSON-based tooling integration API has been changed completely. For example, the previous command reported a failure as:

{
  "status": 1,
  "result": [
    {
      "columnNumber": "5",
      "lineNumber": "12",
      "error": "Annotation does not exist: TestVisibleX (12:5)",
      "fullName": "CanTheUser",
      "type": "ApexClass",
      "filePath": "force-app\\main\\default\\classes\\Security Recipes\\CanTheUser.cls",
      "problemType": "Error"
    },
    {
      "columnNumber": "5",
      "lineNumber": "12",
      "error": "Annotation does not exist: TestVisibleX (12:5)",
      "fullName": "CanTheUser",
      "type": "ApexClass",
      "filePath": "force-app\\main\\default\\classes\\Security Recipes\\CanTheUser.cls",
      "problemType": "Error"
    }
  ],
  "name": "DeployFailed",
  "message": "Push failed.",
  "exitCode": 1,
  "actions": [],
  "commandName": "SourcePushCommand",
  "data": [
    {
      "columnNumber": "5",
      "lineNumber": "12",
      "error": "Annotation does not exist: TestVisibleX (12:5)",
      "fullName": "CanTheUser",
      "type": "ApexClass",
      "filePath": "force-app\\main\\default\\classes\\Security Recipes\\CanTheUser.cls",
      "problemType": "Error"
    },
    {
      "columnNumber": "5",
      "lineNumber": "12",
      "error": "Annotation does not exist: TestVisibleX (12:5)",
      "fullName": "CanTheUser",
      "type": "ApexClass",
      "filePath": "force-app\\main\\default\\classes\\Security Recipes\\CanTheUser.cls",
      "problemType": "Error"
    }
  ],
  "stack": "DeployFailed: ...",
  "warnings": []
}

while the new command reports the same failure as:

{
  "status": 1,
  "result": {
    "pushedSource": [
      {
        "state": "Failed",
        "fullName": "CanTheUser",
        "type": "ApexClass",
        "filePath": "C:\\Users\\Scott\\dev\\projects\\IlluminatedCloudTestProjects\\apex-recipes\\force-app\\main\\default\\classes\\Security Recipes\\CanTheUser.cls"
      },
      {
        "state": "Failed",
        "fullName": "CanTheUser",
        "type": "ApexClass",
        "filePath": "C:\\Users\\Scott\\dev\\projects\\IlluminatedCloudTestProjects\\apex-recipes\\force-app\\main\\default\\classes\\Security Recipes\\CanTheUser.cls"
      }
    ]
  }
}

Not only has the structure of the JSON changed completely, but there's no useful error information in the JSON output, e.g., columnNumber, lineNumber, or error information.

Unless I'm missing something, it looks like these commands should be rolled back to beta until they provide parity information via the JSON-based programmatic interface, no?

@SCWells72 SCWells72 added the investigating We're actively investigating this issue label Mar 5, 2022
@github-actions
Copy link

github-actions bot commented Mar 5, 2022

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@SCWells72 SCWells72 changed the title New force:source:push command JSON output has changed completely New force:source:push command JSON output has changed completely and is missing critical information, e.g., error messages/line/column info Mar 5, 2022
@SCWells72
Copy link
Author

Additionally the force:source:legacy:push command constantly reports conflicts. This may be due to me going back and forth between the two commands and associated source tracking metadata versions, but now I see conflicts reported on every attempt at force:source:legacy:push unless I also specify the -f flag. Given the aforementioned issues with the new force:source:push command, that makes switching to force:source:legacy:push also quite problematic.

@shetzel
Copy link
Contributor

shetzel commented Mar 7, 2022

@SCWells72 - thanks for posting this. We're working on a fix now.

@shetzel shetzel added bug Issue or pull request that identifies or fixes a bug and removed investigating We're actively investigating this issue labels Mar 7, 2022
@dcstuff
Copy link

dcstuff commented Mar 7, 2022

A standard sfdx force:source:push fails for me with 7.140.0. force:source:legacy:push works as expected.

I also ran with --dev-debug but nothing stood out. Lemme know if you'd like me to paste the entire log. I got this, in addition to what you see in the screenshot:

*** Internal Diagnostic ***

PushFailed: Push failed.
    at PushResultFormatter.display (C:\Users\super\AppData\Local\sfdx\client\7.140.0-a1b14a8\node_modules\@salesforce\plugin-source\lib\formatters\source\pushResultFormatter.js:54:19)
    at Push.formatResult (C:\Users\super\AppData\Local\sfdx\client\7.140.0-a1b14a8\node_modules\@salesforce\plugin-source\lib\commands\force\source\push.js:156:23)
    at Push.run (C:\Users\super\AppData\Local\sfdx\client\7.140.0-a1b14a8\node_modules\@salesforce\plugin-source\lib\commands\force\source\push.js:32:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Push._run (C:\Users\super\AppData\Local\sfdx\client\7.140.0-a1b14a8\node_modules\@salesforce\command\lib\sfdxCommand.js:81:40)
    at async Config.runCommand (C:\Users\super\AppData\Local\sfdx\client\7.140.0-a1b14a8\node_modules\@oclif\config\lib\config.js:173:24)
    at async SfdxMain.run (C:\Users\super\AppData\Local\sfdx\client\7.140.0-a1b14a8\node_modules\@oclif\command\lib\main.js:27:9)
    at async SfdxMain._run (C:\Users\super\AppData\Local\sfdx\client\7.140.0-a1b14a8\node_modules\@oclif\command\lib\command.js:43:20)
    at async Object.run (C:\Users\super\AppData\Local\sfdx\client\7.140.0-a1b14a8\dist\cli.js:162:47)
******

image

@shetzel
Copy link
Contributor

shetzel commented Mar 8, 2022

CLI version 7.141.1 has been published as a release candidate and contains the rollback. The legacy commands continue to be aliased such that (e.g. for source status):
sfdx force:source:status --> salesforce-alm plugin (old/legacy version)
sfdx force:source:legacy:status --> salesforce-alm plugin (old/legacy version)
sfdx force:source:beta:status --> source plugin (new/beta version)

UPDATE: CLI version 7.141.1 has now been promoted to production.

@SCWells72
Copy link
Author

@shetzel I've verified that 7.141.1 resolves the issues while retaining the behavior of the legacy commands for those who had already made that switch. Thanks so much for the quick resolution, and to reiterate what I said via DM, please let me know what you need from me to help verify these (and other) commands that are intended for promotion from beta to GA going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

3 participants