##// END OF EJS Templates
interfaces: make `dirstate` Protocol class methods abstract...
interfaces: make `dirstate` Protocol class methods abstract Now all known Protocol methods that should be implemented by the subclass are abstract. See cdd4bc69bfc1 for details. Note that this will break the `git` extension more, because there are a bunch of methods that aren't implemented that should be, in favor of some very old methods that won't be called (like `add()` and `drop()`). It's already broken, so I'm not taking the time to figure out how to modernize it right now. It's not detected by pytype because the only instantiation of `gitdirstate` is in `git/__init__.py`, which was already excluded from pytype checking for some other reason. AT least with this, it 1) doesn't get forgotten about, and 2) will require changing the interface if/when the core dirstate class evolves.

File last commit:

r53186:77b38c86 default
r53405:2ac368d0 default
Show More
cleanup-pipeline.sh
36 lines | 876 B | application/x-sh | BashLexer
#!/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