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

Allow specifying version of Codecov uploader #515

Merged
merged 1 commit into from Sep 13, 2021

Conversation

thomasrockhu-codecov
Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov commented Sep 9, 2021

Allows users to specify which version of the Codecov uploader to use (e.g. v0.1.0_8880)

@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #515 (72dfd47) into master (f6d4366) will increase coverage by 0.76%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
demo 85.71% <ø> (ø)
macos-latest 96.00% <100.00%> (+0.76%) ⬆️
script 97.05% <100.00%> (+0.81%) ⬆️
ubuntu-latest 96.00% <100.00%> (+0.76%) ⬆️
version 85.71% <ø> (?)
windows-latest 96.00% <100.00%> (+0.76%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/buildExec.ts 99.02% <100.00%> (+1.02%) ⬆️
src/helpers.ts 90.90% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6d4366...72dfd47. Read the comment docs.

src/helpers.ts Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
Comment on lines +1 to +19
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;
Copy link
Contributor

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.?

Copy link
Contributor Author

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)

Copy link
Contributor

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).

Copy link
Contributor Author

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

@thomasrockhu-codecov thomasrockhu-codecov force-pushed the specify-version branch 2 times, most recently from 5173f60 to 8b3f9ce Compare September 9, 2021 18:50
@thomasrockhu-codecov thomasrockhu-codecov merged commit f32b3a3 into master Sep 13, 2021
@thomasrockhu-codecov thomasrockhu-codecov deleted the specify-version branch September 13, 2021 12:58
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.

None yet

3 participants