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

Beta Source plugin incorrectly records failed deployments as successful in local source tracking #1401

Closed
daveespo opened this issue Feb 10, 2022 · 3 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@daveespo
Copy link

Summary

When a force:source:beta:push fails due to a deployment failure, the output of the CLI reports that some of the metadata was pushed successfully (even though they haven't been). If you try to push again (after fixing the source of your deployment error), the files that were previously reported as successfully deployed are not included in the deploy (nor will they ever be). The user is told that everything was successfully pushed but some metadata is missing from the scratch org.

Also note that the number of metadata components differs between the beta and non-beta plugin (3 versus 2) in the initial push output.

Steps To Reproduce:

Repository to reproduce:

https://github.com/patronmanager/beta-source-plugin-tracking-bug

The README includes the repro steps but to repeat:

  1. sfdx force:org:create --setdefaultusername -f config/project-scratch-def.json
  2. sfdx force:source:beta:push
  3. Remove line 7 of the Security.settings metadata (remove the <enableClickjackSetup> element)
  4. sfdx force:source:beta:push

Expected result

This is what the GA plugin reports (the first push fails, then, after fixing the metadata, the second push pushes all of the metadata)

C:\Users\esposito\Documents\PatronManager\beta-source-plugin-mpd>sfdx force:source:push
*** Deploying with SOAP ***
Job ID | 0Af0U000019RPsNSAW
SOURCE PROGRESS | ███████████████████████████░░░░░░░░░░░░░ | 2/3 Components
TYPE   PROJECT PATH                                                PROBLEM
─────  ──────────────────────────────────────────────────────────  ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error  force-app\main\default\settings\Security.settings-meta.xml  Error parsing file: Element {http://soap.sforce.com/2006/04/metadata}enableClickjackSetup invalid at this location in type SecuritySettings (7:27)
ERROR running force:source:push:  Push failed.

C:\Users\esposito\Documents\PatronManager\beta-source-plugin-mpd>sfdx force:source:push
*** Deploying with SOAP ***
Job ID | 0Af0U000019RPsXSAW
SOURCE PROGRESS | ████████████████████████████████████████ | 3/3 Components
=== Pushed Source
STATE  FULL NAME  TYPE       PROJECT PATH
─────  ─────────  ─────────  ──────────────────────────────────────────────────────────
Add    Demo       ApexClass  force-app\main\default\classes\Demo.cls
Add    Demo       ApexClass  force-app\main\default\classes\Demo.cls-meta.xml
Add    Demo2      ApexClass  force-app\main\default\classes\Demo2.cls
Add    Demo2      ApexClass  force-app\main\default\classes\Demo2.cls-meta.xml
Add    Security   Settings   force-app\main\default\settings\Security.settings-meta.xml

Actual result

In the beta plugin, the first push reports that the Apex class deployments were successful (they weren't) and the second deployment only pushes the Settings metada (the Apex classes are never pushed)

*** Pushing with SOAP API v53.0 ***
DEPLOY PROGRESS | ████████████████████████████████████████ | 2/2 Components

=== Pushed Source
STATE    FULL NAME  TYPE       PROJECT PATH
───────  ─────────  ─────────  ─────────────────────────────────────────────────
Created  Demo       ApexClass  force-app\main\default\classes\Demo.cls
Created  Demo       ApexClass  force-app\main\default\classes\Demo.cls-meta.xml
Created  Demo2      ApexClass  force-app\main\default\classes\Demo2.cls
Created  Demo2      ApexClass  force-app\main\default\classes\Demo2.cls-meta.xml

=== Component Failures [1]
Type   Name      Problem
─────  ────────  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error  Security  Error parsing file: Element {http://soap.sforce.com/2006/04/metadata}enableClickjackSetup invalid at this location in type SecuritySettings


C:\Users\esposito\Documents\PatronManager\beta-source-plugin-mpd>sfdx force:source:beta:push
*** Pushing with SOAP API v53.0 ***
DEPLOY PROGRESS | ████████████████████████████████████████ | 1/1 Components

System Information

{
"cliVersion": "sfdx-cli/7.136.2",
"architecture": "win32-x64",
"nodeVersion": "node-v16.13.2",
"pluginVersions": [
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.3.1 (core)",
"@oclif/plugin-not-found 1.2.6 (core)",
"@oclif/plugin-plugins 1.10.11 (core)",
"@oclif/plugin-update 1.5.0 (core)",
"@oclif/plugin-warn-if-update-available 1.7.3 (core)",
"@oclif/plugin-which 1.0.4 (core)",
"@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
"alias 1.2.0 (core)",
"apex 0.8.0 (core)",
"auth 1.8.1 (core)",
"config 1.3.15 (core)",
"custom-metadata 1.0.12 (core)",
"data 0.6.8 (core)",
"etcopydata 0.6.6-Beta (beta)",
"generator 1.2.1 (core)",
"info 1.2.0 (core)",
"limits 1.3.0 (core)",
"org 1.11.1 (core)",
"salesforce-alm 53.7.6 (core)",
"schema 1.1.0 (core)",
"sfdmu 4.12.7",
"sfdx-cli 7.136.2 (core)",
"shane-sfdx-plugins 4.43.0",
"├─ @mshanemc/plugin-streaming 1.1.7",
"└─ @mshanemc/sfdx-sosl 1.1.0",
"source 1.8.9 (core)",
"telemetry 1.4.0 (core)",
"templates 53.3.0 (core)",
"trust 1.1.0 (core)",
"user 1.7.0 (core)"
],
"osVersion": "Windows_NT 10.0.19042"
}

@daveespo daveespo added the investigating We're actively investigating this issue label Feb 10, 2022
@github-actions
Copy link

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.

@mshanemc mshanemc added the bug Issue or pull request that identifies or fixes a bug label Feb 10, 2022
@uip-robot-zz
Copy link

This issue has been linked to a new work item: W-10678876

@cristiand391
Copy link
Member

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 investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

4 participants