-
Notifications
You must be signed in to change notification settings - Fork 103
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
fix: change mdcoverage url for getCurrentApiVersion #1191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment is nit.
I'd suggest recommend an FYI to VSCode team about this change--they should be doing apiVersion stuff already. I just know they've had some issues in the past around these Singleton and cwd
patterns in the past when they have long-running processes. Give Pete's folks something else to test.
members: ['b', 'c'], | ||
}, | ||
], | ||
version: '58.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why version 58.0 as default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just chose a recent one. It's better than throwing an error. We really should never get to this point. ComponentSets should have apiVersion and sourceApiVersion set by the consumer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point version 58.0 will be too old and things may not function as expected on this version. In that case does it make sense to throw an error vs using a default value that is old?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code will warn with the missingApiVersion
message should it ever get to this point and use v58.0, so if an end user sees this message they can do things to get better results should it fail. If we throw, they will definitely need to do something to get it to work. Both Shane and I felt that doing what we could to not fail is better.
In practice, the checks for an API version should never get past the sourceApiVersion
and apiVersion
set on the ComponentSet
. If users of SDR are creating ComponentSets without setting a sourceApiVersion
and/or apiVersion
then they shouldn't be creating a manifest from it.
}; | ||
|
||
export const getCurrentApiVersion = async (): Promise<number> => { | ||
const apiVersionsUrl = 'https://dx-extended-coverage.my.salesforce-sites.com/services/data'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're taking that approach, maybe https://org62.my.salesforce-sites.com/services/data
would be more reliable/scalable than this team's endpoint.
or use Promise.any
of several known URLs
QA (using the node REPL)
✅ has
✅ defaulted to v58 ' 58.0\n' + |
What does this PR do?
Changes the URL to get an API version from https://mdcoverage.secure.force.com/services/apexrest/report to https://dx-extended-coverage.my.salesforce-sites.com/services/data
If neither
sourceApiVersion
norapiVersion
were set on aComponentSet
before callinggetObject()
, will then look for and use (in order):What issues does this PR fix or reference?
@W-14621701@