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

CLI creates projects with API v59.0 when that's not actually available yet #2417

Closed
SCWells72 opened this issue Aug 21, 2023 · 7 comments
Closed
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@SCWells72
Copy link

SCWells72 commented Aug 21, 2023

I noticed deployment and retrieval failures in a newly-created project about API v59.0 not being supported, then noticed that the CLI is creating projects with that API version, e.g.:

$ sf version
@salesforce/cli/2.4.10 win32-x64 node-v18.15.0

$ sfdx force:project:create -d . -n foobarbaz -p force-app -t standard -x
target dir = C:\Users\Scott\dev\projects\test-projects
   ...
   create foobarbaz\sfdx-project.json
   create foobarbaz\manifest\package.xml
   ...

$ cat foobarbaz/sfdx-project.json
{
  ...
  "sourceApiVersion": "59.0"
}

$ cat foobarbaz/manifest/package.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    ...
    <version>59.0</version>
</Package>

This can obviously be changed easily, but I imagine it's a bug that should be fixed since almost everyone is going to have to do so until 59.0 is more broadly-available.

Here's the more complete version information:

$ sf version --verbose --json
{
  "cliVersion": "@salesforce/cli/2.4.10",
  "architecture": "win32-x64",
  "nodeVersion": "node-v18.15.0",
  "osVersion": "Windows_NT 10.0.22621",
  "shell": "cmd.exe",
  "rootPath": "C:\\Users\\Scott\\AppData\\Local\\sf\\client\\2.4.10-703551c",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.6 (core)",
    "@oclif/plugin-commands 2.2.21 (core)",
    "@oclif/plugin-help 5.2.16 (core)",
    "@oclif/plugin-not-found 2.3.36 (core)",
    "@oclif/plugin-plugins 3.2.0 (core)",
    "@oclif/plugin-search 0.0.22 (core)",
    "@oclif/plugin-update 3.1.30 (core)",
    "@oclif/plugin-version 1.3.8 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.46 (core)",
    "@oclif/plugin-which 2.2.29 (core)",
    "@salesforce/cli 2.4.10 (core)",
    "apex 2.3.10 (core)",
    "auth 2.8.12 (core)",
    "data 2.5.5 (core)",
    "deploy-retrieve 1.17.2 (core)",
    "functions 1.21.11 (user)",
    "info 2.6.38 (core)",
    "limits 2.3.29 (core)",
    "login 1.2.25 (core)",
    "org 2.9.30 (core)",
    "schema 2.3.22 (core)",
    "settings 1.4.24 (core)",
    "sobject 0.2.2 (core)",
    "source 2.10.30 (core)",
    "telemetry 2.2.5 (core)",
    "templates 55.5.9 (core)",
    "trust 2.5.4 (core)",
    "user 2.3.28 (core)"
  ]
}
@SCWells72 SCWells72 added the investigating We're actively investigating this issue label Aug 21, 2023
@github-actions
Copy link

Hello @SCWells72 👋 It looks like you didn't include the full Salesforce CLI version information in your issue.
Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

@github-actions github-actions bot added more information required Issue requires more information or a response from the customer and removed investigating We're actively investigating this issue labels Aug 21, 2023
@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.

@github-actions github-actions bot added investigating We're actively investigating this issue validated Version information for this issue has been validated and removed more information required Issue requires more information or a response from the customer labels Aug 21, 2023
@cristiand391
Copy link
Member

Hi @SCWells72 , sorry for the late reply.
I'll ask Shane when he's back, but I think he had to bump it to v59 to get a new major release of the templates package:
forcedotcom/salesforcedx-templates#565

that was required to get sfdx-core v5 in it and completely remove v4 from the CLI dependency tree.

@SCWells72
Copy link
Author

@cristiand391, so is there not a concern that the resulting projects aren't going to work "out-of-the-box" for users until v59 is generally available?

@SCWells72
Copy link
Author

FYI, there's another downstream issue resulting from this, notably that an API call like listMetadata that uses the API version from the created sfdx-project.json will result in an actual NPE on the Salesforce servers:

image

It really does seems like projects should be generated with a valid/broadly-available API version at any given time, no?

@mshanemc
Copy link
Contributor

There was no good way around this. The library https://github.com/forcedotcom/salesforcedx-templates tries to keep pace with the server major version, but that prevents it from allowing major releases when it does need a breaking changes otherwise.

CLI team doesn't own it and had to work within those constraints. This issue resolves itself as v59 rolls out to more orgs, so there's nothing to do but wait for it to go away.

In the future, we could try to plan these types of changes right after major releases.

sf project generate does let you specify an --api-version if you don't like the default

@SCWells72
Copy link
Author

You should be able to resolve/close this now that Winter '24 / API v59.0 has been released in all orgs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants