2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

[9.18] new: ci: Add a check for defined but never used anchors in .gitlab-ci.yaml

If an new orphan anchor is (`.anchor: &anchor` with no corresponding `*anchor` elsewhere in the file) is introduced the CI job will.

Depends on https://gitlab.isc.org/isc-projects/bind9-qa/-/merge_requests/101 (merge that first and then drop the `--branch` commit).

Backport of MR !10654

Merge branch 'backport-stepan/ci-orphaned-anchors-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!10667
This commit is contained in:
Štěpán Balážik 2025-06-27 17:38:51 +00:00
commit 115c1bf3a6

View File

@ -94,11 +94,6 @@ stages:
### Runner Tag Templates
.libvirt-amd64: &libvirt_amd64
tags:
- libvirt
- amd64
# Autoscaling GitLab Runner on AWS EC2 (amd64)
.linux-amd64: &linux_amd64
@ -246,10 +241,6 @@ stages:
- if: '$CI_PIPELINE_SOURCE =~ /^(api|pipeline|schedule|trigger|web)$/'
- if: '$CI_COMMIT_TAG != null'
.api-pipelines-schedules-triggers-web-triggering-rules: &api_pipelines_schedules_triggers_web_triggering_rules
rules:
- if: '$CI_PIPELINE_SOURCE =~ /^(api|pipeline|schedule|trigger|web)$/'
.default-triggering-rules_list: &default_triggering_rules_list
- if: '$CI_PIPELINE_SOURCE =~ /^(api|merge_request_event|pipeline|schedule|trigger|web)$/'
- if: '$CI_COMMIT_TAG != null'
@ -372,8 +363,7 @@ stages:
<<: *base_image
stage: performance
rules:
- &shotgun_rule_mr
if: '$CI_MERGE_REQUEST_DIFF_BASE_SHA != null'
- if: '$CI_MERGE_REQUEST_DIFF_BASE_SHA != null'
variables:
BASELINE: '$CI_MERGE_REQUEST_DIFF_BASE_SHA'
- &shotgun_rule_tag
@ -447,21 +437,6 @@ stages:
reports:
junit: junit.xml
.system_test_legacy: &system_test_legacy
script:
- cd bin/tests/system
- find . -maxdepth 2 -mindepth 2 -type f -name "tests.sh" | cut -d/ -f2 | xargs -n 1 -P ${TEST_PARALLEL_JOBS:-1} sh legacy.run.sh
- if git rev-parse > /dev/null 2>&1; then ( ! grep "^I:.*:file.*not removed$" *.log ); fi
- '( ! grep -F "grep: warning:" *.log )'
after_script:
- test -d bind-* && cd bind-*
- REALSOURCEDIR="$PWD"
- test -n "${OUT_OF_TREE_WORKSPACE}" && cd "${OUT_OF_TREE_WORKSPACE}"
- find bin/tests/system -name "*dig.*" | xargs grep "error" || true
- *find_python
- >
"$PYTHON" "$REALSOURCEDIR"/bin/tests/convert-trs-to-junit.py . > "$CI_PROJECT_DIR"/junit.xml
.system_test_make_check: &system_test_make_check_job
<<: *system_test_job
# This script needs to: 1) fail if the system tests fail, 2) fail if
@ -594,7 +569,6 @@ vulture:
- vulture --exclude "*/ans*/ans.py,conftest.py,get_algorithms.py,isctest" --ignore-names "pytestmark" bin/tests/system/
ci-variables:
stage: precheck
<<: *precheck_job
script:
- export BIND_BASELINE_BRANCH="$(sed -n -E "s|^m4_define\(\[bind_VERSION_MINOR\], ([0-9]+)\)dnl$|\1|p" configure.ac)"
@ -610,6 +584,16 @@ ci-variables:
reports:
dotenv: ci_vars.env
ci-orphaned-anchors:
<<: *precheck_job
script:
- git clone --depth 1 https://gitlab.isc.org/isc-projects/bind9-qa.git
- bind9-qa/ci-orphaned-anchors/check-orphaned-anchors-ci.py .gitlab-ci.yml
needs: []
rules:
- changes:
- .gitlab-ci.yml
clang-format:
<<: *precheck_job
needs: []
@ -1662,9 +1646,6 @@ shotgun:doh-get:
SHOTGUN_EVAL_THRESHOLD_LATENCY_PCTL_MAX: 0.4 # bump from the default due to increased tail-end jitter
rules: *shotgun_rules_manual_mr
.stress-test: &stress_test
stage: performance
generate-stress-test-configs:
<<: *base_image
<<: *default_triggering_rules