locationsNotCovered gets empty objects
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- node.js
- Domain
- cli
Research direction
Start with the sf project deploy report and sf project deploy resume paths in the @salesforce/plugin-deploy-retrieve plugin, using the provided package.xml and command sequence. Compare the JSON produced in the Docker runner with the working resume result and local report result. Done means dry-run-result.json retains the column, line, numExecutions, and time fields inside each locationsNotCovered object.
Written by the indexing model from the issue text.
Description
Summary
I'm trying to get uncovered lines of code from a "validate" job result.
Running the same commands on my machine works like a charm but running them from the docker runner on the server doesn't.
Steps To Reproduce
- Make a package.xml with at least one meta to deploy (doesn't matter which one)
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexPage</name>
</types>
<version>63.0</version>
</Package>
- Run a validation with
sf project deploy validate -x ./package.xml --json -g --async -l RunLocalTests > ./dry-run-id.json - Run
sf project deploy resume -i JOB_ID --json > ./validate-resume.json(replaceJOB_IDby the deployment id) - Get the result with
sf project deploy report -i JOB_ID --json > ./dry-run-result.json(replaceJOB_IDby the deployment id)
Check validate-resume.json and dry-run-result.json file. They should both contains test results with uncovered lines.
Expected result
Example part of the file about codeCoverage, especially the locationsNotCovered section.
{
"id": "some_sf_id",
"locationsNotCovered": [
{
"column": 0,
"line": 11,
"numExecutions": 0,
"time": -1
},
{
"column": 0,
"line": 26,
"numExecutions": 0,
"time": -1
}
],
"name": "some_trigger",
"namespace": null,
"numLocations": 15,
"numLocationsNotCovered": 2,
"type": "Trigger"
},
Actual result
In the dry-run-result.json file all locationsNotCovered sections are broken like that (validate-resume.json is fine)
{
"id": "some_sf_id",
"locationsNotCovered": [
{},
{}
],
"name": "some_trigger",
"namespace": null,
"numLocations": 15,
"numLocationsNotCovered": 2,
"type": "Trigger"
},
Additional information
I tried to reproduce in several ways without success. It only happens inside my gitlab docker runner.
I tried :
- locally by executing directly the commands (windows with powershell)
- in a local docker runner using the exact same docker image (windows with docker desktop)
Running the report command locally when my gitlab job fails and using the exact same JOB_ID is giving me the correct result.
I tried to look in the source code to see if I was missing some flags but it doesn't seems to exist any that would kind of limit the depth of the JSON file.
System Information
sf doctor command result on the local docker runner (should be identical with the gitlab docker runner).
{
"status": 0,
"result": {
"versionDetail": {
"architecture": "linux-x64",
"cliVersion": "@salesforce/cli/2.98.6",
"nodeVersion": "node-v22.18.0",
"osVersion": "Linux 6.6.87.2-microsoft-standard-WSL2",
"rootPath": "/usr/lib/node_modules/@salesforce/cli",
"shell": "bash",
"pluginVersions": [
"@oclif/plugin-autocomplete 3.2.33 (core)",
"@oclif/plugin-commands 4.1.29 (core)",
"@oclif/plugin-help 6.2.31 (core)",
"@oclif/plugin-not-found 3.2.60 (core)",
"@oclif/plugin-plugins 5.4.45 (core)",
"@oclif/plugin-search 1.2.27 (core)",
"@oclif/plugin-update 4.7.1 (core)",
"@oclif/plugin-version 2.2.31 (core)",
"@oclif/plugin-warn-if-update-available 3.1.44 (core)",
"@oclif/plugin-which 3.2.39 (core)",
"@salesforce/cli 2.98.6 (core)",
"agent 1.23.3 (core)",
"apex 3.6.19 (core)",
"api 1.3.3 (core)",
"auth 3.7.9 (core)",
"data 4.0.46 (core)",
"deploy-retrieve 3.22.33 (core)",
"info 3.4.73 (core)",
"limits 3.3.60 (core)",
"marketplace 1.3.8 (core)",
"org 5.9.9 (core)",
"packaging 2.18.0 (core)",
"schema 3.3.73 (core)",
"settings 2.4.36 (core)",
"sobject 1.4.65 (core)",
"telemetry 3.6.48 (core)",
"templates 56.3.54 (core)",
"trust 3.7.109 (core)",
"user 3.6.29 (core)",
"sfdx-git-delta 6.16.0 (user)"
]
},
"sfdxEnvVars": [],
"sfEnvVars": [
[
"SF_DISABLE_AUTOUPDATE",
"true"
],
[
"SF_IMPROVED_CODE_COVERAGE",
"true"
],
[
"SF_ORG_METADATA_REST_DEPLOY",
"true"
],
[
"SF_DOMAIN_RETRY",
"300"
],
[
"SF_DISABLE_TELEMETRY",
"true"
],
[
"SF_CONTAINER_MODE",
"true"
],
[
"SF_SKIP_NEW_VERSION_CHECK",
"true"
],
[
"SF_CONTENT_TYPE",
"JSON"
],
[
"SF_UPDATE_INSTRUCTIONS",
"Use \"npm update --global @salesforce/cli\" to update npm-based installations."
]
],
"proxyEnvVars": [],
"cliConfig": {
"arch": "x64",
"bin": "sf",
"binAliases": [
"sfdx"
],
"cacheDir": "/root/.cache/sf",
"channel": "stable",
"configDir": "/root/.config/sf",
"dataDir": "/root/.local/share/sf",
"dirname": "sf",
"flexibleTaxonomy": true,
"home": "/root",
"isSingleCommandCLI": false,
"name": "@salesforce/cli",
"nsisCustomization": "scripts/nsis.nsi",
"platform": "linux",
"root": "/usr/lib/node_modules/@salesforce/cli",
"shell": "bash",
"theme": {
"bin": "blueBright",
"command": "blueBright",
"dollarSign": "green",
"flag": "green",
"flagDefaultValue": "blueBright",
"flagOptions": "blueBright",
"flagRequired": "red",
"sectionHeader": "blue",
"topic": "blueBright",
"json": {
"brace": "whiteBright",
"bracket": "whiteBright",
"comma": "green",
"key": "blueBright",
"string": "greenBright",
"number": "blue",
"boolean": "redBright",
"null": "blackBright"
}
},
"topicSeparator": " ",
"updateConfig": {
"node": {
"options": [
"--no-deprecation"
]
},
"s3": {
"bucket": "dfc-data-production",
"host": "https://developer.salesforce.com",
"templates": {
"target": {
"baseDir": "<%- bin %>",
"manifest": "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- platform %>-<%- arch %>",
"unversioned": "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-<%- platform %>-<%- arch %><%- ext %>",
"versioned": "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %>-<%- platform %>-<%- arch %><%- ext %>"
},
"vanilla": {
"baseDir": "<%- bin %>",
"manifest": "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %>version",
"unversioned": "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %><%- ext %>",
"versioned": "<%- channel === 'stable' ? '' : 'channels/' + channel + '/' %><%- bin %>-v<%- version %>/<%- bin %>-v<%- version %><%- ext %>"
}
}
}
},
"userAgent": "@salesforce/cli/2.98.6 linux-x64 node-v22.18.0",
"valid": true,
"version": "2.98.6",
"warned": false,
"windows": false,
"_base": "@oclif/[email protected]",
"_commands": {},
"_topics": {},
"commandPermutations": {
"validPermutations": {}
},
"pluginLoader": {
"options": {
"root": "/usr/lib/node_modules/@salesforce/cli/dist"
},
"errors": [],
"plugins": {},
"pluginsProvided": false
},
"topicPermutations": {
"validPermutations": {}
},
"nodeEngine": ">=18.6.0"
},
"pluginSpecificData": {
"@salesforce/plugin-deploy-retrieve": [
{}
],
"@salesforce/plugin-auth": [
{
"isUsingGenericKeychain": false,
"sfCryptoV2Support": true,
"cryptoVersion": "unknown"
}
]
},
"diagnosticResults": [
{
"testName": "salesforcedx plugin isn’t installed",
"status": "pass"
},
{
"testName": "you don't have any linked plugins",
"status": "pass"
},
{
"testName": "[@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion",
"status": "warn"
},
{
"testName": "[@salesforce/plugin-trust] can ping: https://registry.npmjs.org",
"status": "pass"
},
{
"testName": "[@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com",
"status": "pass"
},
{
"testName": "[@salesforce/plugin-trust] can ping: https://registry.npmjs.org/",
"status": "pass"
},
{
"testName": "using latest or latest-rc CLI version",
"status": "pass"
},
{
"testName": "can access: https://test.salesforce.com",
"status": "pass"
},
{
"testName": "can access: https://appexchange.salesforce.com/services/data",
"status": "pass"
},
{
"testName": "can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest",
"status": "pass"
},
{
"testName": "[@salesforce/plugin-auth] CLI supports v2 crypto",
"status": "pass"
}
],
"suggestions": [
"Check https://github.com/forcedotcom/cli/issues for CLI issues posted by the community.",
"Check http://status.salesforce.com for general Salesforce availability and performance.",
"Neither sourceApiVersion nor apiVersion are defined. The commands that deploy and retrieve source use the max apiVersion of the target org in this case. The issue isn't a problem, as long as it's the behavior you actually want.",
"using npm registry https://registry.npmjs.org/ from npm config"
],
"logFilePaths": [
"/opt/ci-scripts/1754984540366-diagnosis.json",
"/opt/ci-scripts/1754984540366-diagnosis.json"
],
"commandExitCode": 0
},
"warnings": []
}
- Dominant language
- No language data
- Stars
- 571
- Forks
- 80
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from forcedotcom/cli
-
investigating validated
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
forcedotcom/cli#3657 · 2 comments ·
-
area:afdx owned by another team
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
forcedotcom/cli#3645 · 2 comments ·
-
bug investigating validated
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
forcedotcom/cli#3644 · 6 comments ·
-
area:afdx bug investigating owned by another team validated
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
forcedotcom/cli#3625 · 4 comments ·
-
area:afdx bug owned by another team
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
forcedotcom/cli#3608 · 2 comments ·
Similar issues
-
discover: `sudo RTK_DISABLED=$VAR …` is not detected as a bypass when `sudo` is a transparent prefixOpenarea:cli bug good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
filamentphp/filament#20630 ·
Maintainers usually reply within 1 day
-
component:ktuner
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
agentic-os-org/ANOLISA#4109 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
lawndoc/stack-back#121 ·
-
type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day