[Ops/QA] Migrate coverage data to elastic's bucket (#175891)

## Summary
The currently used bucket for https://kibana-coverage.elastic.dev/ is
`gs://elastic-bekitzur-kibana-coverage-live/` - this is probably
belonging to an ex-elastician, now outside the company, we can't adjust
access rights to it, won't be able to set up proper IAM access on it in
the future.

We're migrating to this bucket: `gs://elastic-kibana-coverage-live/`. 

To avoid having to copy over 6G of old coverage data, we're setting up
the pipeline that populates this bucket
(https://buildkite.com/elastic/kibana-code-coverage-main) to copy to
both for some time, then we shut down the old one, while the new has
some recent coverage data.
This commit is contained in:
Alex Szabo 2024-01-30 18:18:55 +01:00 committed by GitHub
parent ee8ec9ae3f
commit 88b7500964
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 3 deletions

View file

@ -2,10 +2,14 @@
set -euo pipefail
# TODO: Safe to remove this after 2024-03-01 (https://github.com/elastic/kibana/issues/175904)
gsutil -m cp -r gs://elastic-bekitzur-kibana-coverage-live/previous_pointer/previous.txt . || echo "### Previous Pointer NOT FOUND?"
# TODO: Activate after the above is removed
#gsutil -m cp -r gs://elastic-kibana-coverage-live/previous_pointer/previous.txt . || echo "### Previous Pointer NOT FOUND?"
if [ -e ./previous.txt ]; then
mv previous.txt downloaded_previous.txt
echo "### downloaded_previous.txt"
cat downloaded_previous.txt
fi
fi

View file

@ -9,4 +9,7 @@ collectPrevious() {
}
collectPrevious
gsutil cp previous.txt gs://elastic-bekitzur-kibana-coverage-live/previous_pointer/
# TODO: Safe to remove this after 2024-03-01 (https://github.com/elastic/kibana/issues/175904)
gsutil cp previous.txt gs://elastic-bekitzur-kibana-coverage-live/previous_pointer/
gsutil cp previous.txt gs://elastic-kibana-coverage-live/previous_pointer/

View file

@ -4,18 +4,24 @@ set -euo pipefail
xs=("$@")
uploadPrefix="gs://elastic-bekitzur-kibana-coverage-live/"
# TODO: Safe to remove this after 2024-03-01 (https://github.com/elastic/kibana/issues/175904) - also clean up usages
uploadPrefix_old="gs://elastic-bekitzur-kibana-coverage-live/"
uploadPrefixWithTimeStamp_old="${uploadPrefix}${TIME_STAMP}/"
uploadPrefix="gs://elastic-kibana-coverage-live/"
uploadPrefixWithTimeStamp="${uploadPrefix}${TIME_STAMP}/"
uploadBase() {
for x in 'src/dev/code_coverage/www/index.html' 'src/dev/code_coverage/www/404.html'; do
gsutil -m -q cp -r -a public-read -z js,css,html "${x}" "${uploadPrefix}"
gsutil -m -q cp -r -a public-read -z js,css,html "${x}" "${uploadPrefix_old}"
done
}
uploadRest() {
for x in "${xs[@]}"; do
gsutil -m -q cp -r -a public-read -z js,css,html "target/kibana-coverage/${x}-combined" "${uploadPrefixWithTimeStamp}"
gsutil -m -q cp -r -a public-read -z js,css,html "target/kibana-coverage/${x}-combined" "${uploadPrefixWithTimeStamp_old}"
done
}