Skip to content

Improve coverage report format in GitHub pull requests. #1377

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

Merged
merged 5 commits into from
Mar 25, 2020

Conversation

yifanyang
Copy link
Contributor

Calculate and upload coverage reports to our own Metrics Service instead
of Codecov.

@yifanyang yifanyang requested a review from vkryachko March 20, 2020 16:33
@googlebot googlebot added the cla: yes Override cla label Mar 20, 2020
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Mar 20, 2020

Binary Size Report

Affected SDKs

SDKTypeBase (b878917)Head (aa1370d)Diff
firebase-inappmessagingapk (release)?3256643.00? (?)
aar?467661.00? (?)
apk (aggressive)?601340.00? (?)
firebase-common:ktxaar?5965.00? (?)
protolite-well-known-typesapk (release)?561089.00? (?)
aar?1203203.00? (?)
apk (aggressive)?122384.00? (?)
firebase-inappmessaging:ktxaar?5003.00? (?)
firebase-segmentationapk (release)?1667839.00? (?)
aar?35427.00? (?)
apk (aggressive)?1017130.00? (?)
firebase-database:ktxaar?6706.00? (?)
firebase-functions:ktxaar?5844.00? (?)
firebase-storageapk (release)?976604.00? (?)
aar?119257.00? (?)
apk (aggressive)?325641.00? (?)
firebase-commonapk (release)?646638.00? (?)
aar?34517.00? (?)
apk (aggressive)?82939.00? (?)
encoders:firebase-encoders-jsonaar?15335.00? (?)
firebase-firestore:ktxaar?7093.00? (?)
firebase-crashlytics-ndkapk (release)?1936966.00? (?)
aar?598746.00? (?)
apk (aggressive)?1170706.00? (?)
transport:transport-apiaar?6439.00? (?)
transport:transport-backend-cctaar?38343.00? (?)
firebase-inappmessaging-display:ktxaar?22190.00? (?)
firebase-databaseapk (release)?1101570.00? (?)
aar?480458.00? (?)
apk (aggressive)?325607.00? (?)
encoders:firebase-encoders-reflectiveaar?7650.00? (?)
firebase-crashlyticsapk (release)?1353912.00? (?)
aar?400122.00? (?)
apk (aggressive)?584013.00? (?)
transport:transport-runtimeaar?122725.00? (?)
firebase-installationsapk (release)?665523.00? (?)
aar?55057.00? (?)
apk (aggressive)?84604.00? (?)
firebase-config:ktxaar?6162.00? (?)
firebase-dynamic-linksapk (release)?951227.00? (?)
aar?51149.00? (?)
apk (aggressive)?327459.00? (?)
firebase-storage:ktxaar?6143.00? (?)
firebase-installations-interopapk (release)?616109.00? (?)
aar?7509.00? (?)
apk (aggressive)?61699.00? (?)
firebase-componentsapk (release)?25749.00? (?)
aar?34495.00? (?)
apk (aggressive)?10959.00? (?)
firebase-abtapk (release)?746406.00? (?)
aar?35383.00? (?)
apk (aggressive)?85717.00? (?)
firebase-configapk (release)?1143995.00? (?)
aar?214548.00? (?)
apk (aggressive)?395817.00? (?)
firebase-datatransportapk (release)?711393.00? (?)
aar?5041.00? (?)
apk (aggressive)?116347.00? (?)
firebase-dynamic-links:ktxaar?7877.00? (?)
firebase-inappmessaging-displayapk (release)?4520175.00? (?)
aar?165930.00? (?)
apk (aggressive)?1603058.00? (?)
firebase-functionsapk (release)?1178560.00? (?)
aar?25859.00? (?)
apk (aggressive)?393472.00? (?)
firebase-database-collectionapk (release)?912665.00? (?)
aar?34214.00? (?)
apk (aggressive)?313605.00? (?)
firebase-firestoreapk (release)?3139586.00? (?)
aar?1067163.00? (?)
apk (aggressive)?443174.00? (?)
baseapk (release)?8754.00? (?)
apk (aggressive)?10678.00? (?)
Metric Unit: byte

Test Logs

@vkryachko
Copy link
Member

Could the parsing logic be done in fireci?

The motivation for fireci was to:
keep any ci related postprocessing logic separate from the gradle build with the intent to avoid dependency creep in the main build which, in addition to build slowdown, can cause classpath issues.

@yifanyang
Copy link
Contributor Author

I'm not sure I understand. What do you mean by doing it in fireci?

@vkryachko
Copy link
Member

You can extend https://github.com/firebase/firebase-android-sdk/tree/master/ci/fireci with custom commands, via fireciplugins directory.

So in your case you could invoke gradle and then do postprocessing on the expected output of the build.

Calculate and upload coverage reports to our own Metrics Service instead
of Codecov.
@yifanyang
Copy link
Contributor Author

/test fireci

@yifanyang
Copy link
Contributor Author

/test smoke-tests



def construct_request_header():
result = subprocess.run(['gcloud', 'auth', 'print-identity-token'], stdout=subprocess.PIPE)
Copy link
Member

Choose a reason for hiding this comment

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

Pls add:

Suggested change
result = subprocess.run(['gcloud', 'auth', 'print-identity-token'], stdout=subprocess.PIPE)
result = subprocess.run(['gcloud', 'auth', 'print-identity-token'], stdout=subprocess.PIPE, check=True)

Otherwise you won't know if gcloud fails

Copy link
Member

Choose a reason for hiding this comment

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

additionally, this seems a good candidate for a cli flag as well with a default that makes the subprocess call, that way if one has a token it can be passed in without an additonal call to gcloud

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

endpoint = construct_request_endpoint()
headers = construct_request_header()

print('Posting to the metrics service ...')
Copy link
Member

Choose a reason for hiding this comment

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

pls use logging.getLogger('fireci.coverage') throughout.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

return 0


def find_prow_job_link():
Copy link
Member

Choose a reason for hiding this comment

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

Consider making this a flag and have its default point to this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.



def post_request(data):
metrics_service_url = os.getenv('METRICS_SERVICE_URL')
Copy link
Member

Choose a reason for hiding this comment

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

consider making this an option with envvar="METRICS_SERVICE_URL"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By "option", do you mean a @click.option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@yifanyang yifanyang merged commit fd3abfc into master Mar 25, 2020
@yifanyang yifanyang deleted the yifany/coverage branch March 25, 2020 17:05
@firebase firebase locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants