0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-05-17 02:53:46 +02:00

Add suffices to scripts in scripts-dev (#12137)

* Rename scripts-dev to have suffices

* Update references to `scripts-dev`

* Changelog

* These scripts don't pass mypy
This commit is contained in:
David Robertson 2022-03-02 18:00:26 +00:00 committed by GitHub
parent 106959b3cf
commit 1fbe0316a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 19 additions and 12 deletions

View file

@ -31,7 +31,7 @@ jobs:
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid # if we're running from a tag, get the full list of distros; otherwise just use debian:sid
dists='["debian:sid"]' dists='["debian:sid"]'
if [[ $GITHUB_REF == refs/tags/* ]]; then if [[ $GITHUB_REF == refs/tags/* ]]; then
dists=$(scripts-dev/build_debian_packages --show-dists-json) dists=$(scripts-dev/build_debian_packages.py --show-dists-json)
fi fi
echo "::set-output name=distros::$dists" echo "::set-output name=distros::$dists"
# map the step outputs to job outputs # map the step outputs to job outputs
@ -74,7 +74,7 @@ jobs:
# see https://github.com/docker/build-push-action/issues/252 # see https://github.com/docker/build-push-action/issues/252
# for the cache magic here # for the cache magic here
run: | run: |
./src/scripts-dev/build_debian_packages \ ./src/scripts-dev/build_debian_packages.py \
--docker-build-arg=--cache-from=type=local,src=/tmp/.buildx-cache \ --docker-build-arg=--cache-from=type=local,src=/tmp/.buildx-cache \
--docker-build-arg=--cache-to=type=local,mode=max,dest=/tmp/.buildx-cache-new \ --docker-build-arg=--cache-to=type=local,mode=max,dest=/tmp/.buildx-cache-new \
--docker-build-arg=--progress=plain \ --docker-build-arg=--progress=plain \

View file

@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
- run: pip install -e . - run: pip install -e .
- run: scripts-dev/generate_sample_config --check - run: scripts-dev/generate_sample_config.sh --check
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -51,7 +51,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
- run: "pip install 'towncrier>=18.6.0rc1'" - run: "pip install 'towncrier>=18.6.0rc1'"
- run: scripts-dev/check-newsfragment - run: scripts-dev/check-newsfragment.sh
env: env:
PULL_REQUEST_NUMBER: ${{ github.event.number }} PULL_REQUEST_NUMBER: ${{ github.event.number }}

1
changelog.d/12137.misc Normal file
View file

@ -0,0 +1 @@
Give `scripts-dev` scripts suffixes for neater CI config.

View file

@ -172,6 +172,6 @@ frobber:
``` ```
Note that the sample configuration is generated from the synapse code Note that the sample configuration is generated from the synapse code
and is maintained by a script, `scripts-dev/generate_sample_config`. and is maintained by a script, `scripts-dev/generate_sample_config.sh`.
Making sure that the output from this script matches the desired format Making sure that the output from this script matches the desired format
is left as an exercise for the reader! is left as an exercise for the reader!

View file

@ -11,7 +11,7 @@ local_partial_types = True
no_implicit_optional = True no_implicit_optional = True
files = files =
scripts-dev/sign_json, scripts-dev/,
setup.py, setup.py,
synapse/, synapse/,
tests/ tests/
@ -23,10 +23,20 @@ files =
# https://docs.python.org/3/library/re.html#re.X # https://docs.python.org/3/library/re.html#re.X
exclude = (?x) exclude = (?x)
^( ^(
|scripts-dev/build_debian_packages.py
|scripts-dev/check_signature.py
|scripts-dev/definitions.py
|scripts-dev/federation_client.py
|scripts-dev/hash_history.py
|scripts-dev/list_url_patterns.py
|scripts-dev/release.py
|scripts-dev/tail-synapse.py
|synapse/_scripts/export_signing_key.py |synapse/_scripts/export_signing_key.py
|synapse/_scripts/move_remote_media_to_new_store.py |synapse/_scripts/move_remote_media_to_new_store.py
|synapse/_scripts/synapse_port_db.py |synapse/_scripts/synapse_port_db.py
|synapse/_scripts/update_synapse_database.py |synapse/_scripts/update_synapse_database.py
|synapse/storage/databases/__init__.py |synapse/storage/databases/__init__.py
|synapse/storage/databases/main/__init__.py |synapse/storage/databases/main/__init__.py
|synapse/storage/databases/main/cache.py |synapse/storage/databases/main/cache.py

View file

@ -15,11 +15,11 @@ check() {
if [ "$1" == "--check" ]; then if [ "$1" == "--check" ]; then
diff -u "$SAMPLE_CONFIG" <(synapse/_scripts/generate_config.py --header-file docs/.sample_config_header.yaml) >/dev/null || { diff -u "$SAMPLE_CONFIG" <(synapse/_scripts/generate_config.py --header-file docs/.sample_config_header.yaml) >/dev/null || {
echo -e "\e[1m\e[31m$SAMPLE_CONFIG is not up-to-date. Regenerate it with \`scripts-dev/generate_sample_config\`.\e[0m" >&2 echo -e "\e[1m\e[31m$SAMPLE_CONFIG is not up-to-date. Regenerate it with \`scripts-dev/generate_sample_config.sh\`.\e[0m" >&2
exit 1 exit 1
} }
diff -u "$SAMPLE_LOG_CONFIG" <(synapse/_scripts/generate_log_config.py) >/dev/null || { diff -u "$SAMPLE_LOG_CONFIG" <(synapse/_scripts/generate_log_config.py) >/dev/null || {
echo -e "\e[1m\e[31m$SAMPLE_LOG_CONFIG is not up-to-date. Regenerate it with \`scripts-dev/generate_sample_config\`.\e[0m" >&2 echo -e "\e[1m\e[31m$SAMPLE_LOG_CONFIG is not up-to-date. Regenerate it with \`scripts-dev/generate_sample_config.sh\`.\e[0m" >&2
exit 1 exit 1
} }
else else

View file

@ -85,8 +85,6 @@ else
"synapse" "docker" "tests" "synapse" "docker" "tests"
# annoyingly, black doesn't find these so we have to list them # annoyingly, black doesn't find these so we have to list them
"scripts-dev" "scripts-dev"
"scripts-dev/build_debian_packages"
"scripts-dev/sign_json"
"contrib" "synctl" "setup.py" "synmark" "stubs" ".ci" "contrib" "synctl" "setup.py" "synmark" "stubs" ".ci"
) )
fi fi

View file

@ -40,8 +40,6 @@ lint_targets =
tests tests
# annoyingly, black doesn't find these so we have to list them # annoyingly, black doesn't find these so we have to list them
scripts-dev scripts-dev
scripts-dev/build_debian_packages
scripts-dev/sign_json
stubs stubs
contrib contrib
synctl synctl