Skip to content

Conversation

WillieRuemmele
Copy link
Member

What does this PR do?

bumps @salesforce/core to v3 - and planned as part of a major 6.0.0 release

What issues does this PR fix or reference?

@W-10743680@

@WillieRuemmele WillieRuemmele requested review from a team as code owners March 24, 2022 20:34
Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved pending 1 return type confirmation
several comments about things outside this repo/pr

"@salesforce/ts-sinon": "^1.1.2",
"@types/archiver": "^5.1.1",
"@types/deep-equal-in-any-order": "^1.0.1",
"@types/jsforce": "^1.9.38",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's pretty exciting!

void connection.metadata
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore _invoke is private on the jsforce metadata object, and cancelDeploy is not an exposed method
._invoke('cancelDeploy', { id: this.id })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make a WI to

  1. add a proper cancel method to the metadata class
  2. update this code to use it instead of this nastiness

const fromConnection = await ComponentSet.fromConnection({
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
usernameOrConnection: (await Aliases.fetch(org.username)) || org.username,
usernameOrConnection: (await GlobalInfo.create()).aliases.get(org.username) || org.username,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirm that the new aliases.get returns something falsy
prefer ?? over || if it's returning undefined/null

Copy link
Contributor

@jayree jayree Mar 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mshanemc @WillieRuemmele as in this case org.username is either an username or an alias we can use here usernameOrConnection: (await GlobalInfo.create()).aliases.resolveUsername(org.username),

I think you need an username to use aliases.get() to get an alias. And it seems that the documentation for Aliases.fetch()is wrong, because this method returns an username not an alias.

import { createSandbox, SinonSandbox } from 'sinon';
import { AnyJson } from '@salesforce/ts-types';
import { nls } from '../../../src/i18n';
import { ToolingDeployStatus, ComponentStatus } from '../../../src/client';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an eslint rule for alphabetizing imports that we can turn on to have less of this happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is... but I couldn't get it working to match what my IDE did. I'll turn off that setting

@mshanemc mshanemc merged commit c78625b into sm/no-hardcoded-apiVersion Mar 29, 2022
@mshanemc mshanemc deleted the wr/corev3 branch March 29, 2022 14:44
shetzel added a commit that referenced this pull request May 20, 2022
* feat!: no hardcoded api version

* feat: componentSet can omit version

* chore: adding types for SDR

* feat: export currentApiVersion

* fix: set version from org, coverageReport

* test: retrieve uses connection apiVersion

* feat: async versions of getObject and getPackageXml

* test: updates for breaking changes

* chore: adding types for SDR

* refactor: async write (pr feedback)

* chore: adding types for SDR

* Wr/corev3 (#598)

* chore: migrating to core3

* chore: fix UT method

* chore: adding types for SDR

* chore: resolve alias to username

Co-authored-by: mshanemc <shane.mclaughlin@salesforce.com>

* chore: fix deploy cancel method

* fix: handle BooleanString properly

* fix: reverse false value

* fix: another place allowing BooleanString

* chore: adding types for SDR

* fix: type array and destructure tasks

* chore: adding types for SDR

* test: correct stub for fs

* refactor: pr and cleanup

* feat: use core error/messages

* feat: use core errors and messages, test changes from v5 main

* chore: auto-update metadata coverage in METADATA_SUPPORT.md

* feat: use jsforce2 rest deploys

* chore: auto-update metadata coverage in METADATA_SUPPORT.md

* ci: external nuts

* chore: bump kit

* fix: don't send rest param to mdapi

* chore: bump jsforce

* test: adjust ut for the new jsforce mdapi

* chore: auto-update metadata coverage in METADATA_SUPPORT.md

* chore: update core lib

Co-authored-by: Willie Ruemmele <willieruemmele@gmail.com>
Co-authored-by: Steve Hetzel <shetzel@salesforce.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants