Lighthouse-ci: Instructions on deleting individual data points?

Created on 10 Dec 2019  路  3Comments  路  Source: GoogleChrome/lighthouse-ci

Is there currently a way to delete individual data points that were uploaded with lhci upload? Particularly with the kubernetes server.

question

Most helpful comment

You'd need to connect directly to your database in kubernetes and delete the statistic/run/build associated with it. Because the server is still unauthenticated, the API doesn't allow any destructive updates.

rough steps:

# Connect to your pod
kubectl exec -it lhci-pod -- /bin/bash
# Make sure your server isn't running/actively connected to your database and make a backup in case mistakes are made
cp /data/lhci.db /data/lhci.db.bak
# Connect to your sql database, default if using docker image recipe is /data/lhci.db
sqlite3 /data/lhci.db
# Find the build you want to delete
> SELECT id FROM builds WHERE hash = '<whatever hash you want to delete>'
# Delete the rows
> DELETE FROM statistics WHERE buildId = '<buildId>'
> DELETE FROM runs WHERE buildId = '<buildId>'
> DELETE FROM builds WHERE id = '<buildId>'

EDIT: #85 tracks adding auth to the server so the UI can be used for things like this in the future :)

All 3 comments

You'd need to connect directly to your database in kubernetes and delete the statistic/run/build associated with it. Because the server is still unauthenticated, the API doesn't allow any destructive updates.

rough steps:

# Connect to your pod
kubectl exec -it lhci-pod -- /bin/bash
# Make sure your server isn't running/actively connected to your database and make a backup in case mistakes are made
cp /data/lhci.db /data/lhci.db.bak
# Connect to your sql database, default if using docker image recipe is /data/lhci.db
sqlite3 /data/lhci.db
# Find the build you want to delete
> SELECT id FROM builds WHERE hash = '<whatever hash you want to delete>'
# Delete the rows
> DELETE FROM statistics WHERE buildId = '<buildId>'
> DELETE FROM runs WHERE buildId = '<buildId>'
> DELETE FROM builds WHERE id = '<buildId>'

EDIT: #85 tracks adding auth to the server so the UI can be used for things like this in the future :)

Thanks. That worked perfectly. I just had to do apt-get update && apt-get install sqlite3 to get sqlite3.

Awesome glad to hear it! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thasmo picture thasmo  路  3Comments

xavierfoucrier picture xavierfoucrier  路  4Comments

idbartosz picture idbartosz  路  3Comments

thomkrupa picture thomkrupa  路  4Comments

trptcolin picture trptcolin  路  5Comments