-
Notifications
You must be signed in to change notification settings - Fork 207
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
Allow specifying version of Codecov uploader #515
Conversation
2df245e
to
f0715a6
Compare
Codecov Report
@@ Coverage Diff @@
## master #515 +/- ##
==========================================
+ Coverage 95.23% 96.00% +0.76%
==========================================
Files 4 4
Lines 147 150 +3
Branches 40 41 +1
==========================================
+ Hits 140 144 +4
+ Misses 7 6 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
a22f02e
to
e4d4085
Compare
e4d4085
to
9c1c202
Compare
import * as core from '@actions/core'; | ||
import * as fetch from 'node-fetch'; | ||
|
||
const versionInfo = async (platform: string, version?: string) => { | ||
if (version) { | ||
core.info(`==> Running version ${version}`); | ||
} | ||
|
||
try { | ||
const metadataRes = await fetch( `https://uploader.codecov.io/${platform}/latest`, { | ||
headers: {'Accept': 'application/json'}, | ||
}); | ||
const metadata = await metadataRes.json(); | ||
core.info(`==> Running version ${metadata['version']}`); | ||
} catch (err) { | ||
core.info(`Could not pull latest version information: ${err}`); | ||
} | ||
}; | ||
export default versionInfo; |
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.
What is the intention behind this functionality? E.g., is this supposed to print the version that would actually run, the value of the string ultimately used to fetch the uploader, etc.?
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.
Intention is to print out the version of the uploader if on latest
. This will be extremely helpful for debugging (as we only mark 0.1.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.
Understood.
Could we derive this more accurately via the SHA verification somehow? This method of retrieval is not guaranteed to be accurate (the version is pulled after the uploader is retrieved—these could be different depending on if/when a release occurs between the requests).
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.
Yeah, unfortunately, this is the only API handle we have and it's not at the same time nor the same endpoint. I totally agree with you
5173f60
to
8b3f9ce
Compare
8b3f9ce
to
72dfd47
Compare
Allows users to specify which version of the Codecov uploader to use (e.g.
v0.1.0_8880
)