##// END OF EJS Templates
profiling: add an assertion to help pytype...
profiling: add an assertion to help pytype Pytype 2023.11.21 with Python 3.10.11 (correctly) flagged `self._fp` as possibly not having a `getvalue()` method, likely since 6a8edf9f0a6d: File "/mnt/c/Users/Matt/hg/mercurial/profiling.py", line 344, in __exit__: No attribute 'getvalue' on BinaryIO [attribute-error] In Union[Any, BinaryIO, io.BytesIO] It appears this was flagged in CI too, but the test was marked as a success anyway, so it wasn't noticed. We'll fix that on stable and then merge on top of this.

File last commit:

r53186:77b38c86 default
r53297:5ff6fba7 default
Show More
cleanup-pipeline.sh
36 lines | 876 B | application/x-sh | BashLexer
/ contrib / cleanup-pipeline.sh
ci: add a small script one can run to purge older pipeline...
r53186 #!/bin/bash
# A small script to cleanup old CI-pipeline that accumulate over time
d="`date -d '-1 month' --iso-8601`T00:00:00Z"
PROJECT_ID=22
token=$1
if [ -z $token ]; then
echo "USAGE: $0 GITLAB_TOKEN" >&2
exit 64
fi
get_ids() {
curl --silent "https://foss.heptapod.net/api/v4/projects/$PROJECT_ID/pipelines?updated_before=$d&per_page=100" | python3 -m json.tool | grep -E '"\bid": ([0-9]+),' | grep -oE '[0-9]+'
}
ids=`get_ids`
while [ -n "$ids" ]; do
echo '#########'
for pipeline_id in $ids; do
echo "deleting pipeline #$pipeline_id"
url="https://foss.heptapod.net/api/v4/projects/$PROJECT_ID/pipelines/$pipeline_id"
echo $url
curl \
--header "PRIVATE-TOKEN: $token"\
--request "DELETE"\
$url
done
ids=`get_ids`
if [ -n "$ids" ]; then
sleep 1
fi
done