1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
name: Compare-ydb-configs-in-branches
on:
schedule:
- cron: "0 * * * *" # Every hour
workflow_dispatch:
inputs:
commit_sha:
type: string
default: ""
branches:
type: string
default: ""
description: |
List of branches for compare separated by space.
If not set, result will be uploaded to global store for the default list of branches.
required: false
defaults:
run:
shell: bash
jobs:
main:
name: Compare configs
runs-on: [ self-hosted, auto-provisioned, build-preset-analytic-node]
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: ${{ inputs.commit_sha }}
fetch-depth: 1
- name: Setup ydb access
uses: ./.github/actions/setup_ci_ydb_service_account_key_file_credentials
with:
ci_ydb_service_account_key_file_credentials: ${{ secrets.CI_YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS }}
ydb_qa_config: ${{ vars.YDB_QA_CONFIG }}
- name: Build
uses: ./.github/actions/build_and_test_ya
with:
build_preset: "release"
build_target: "ydb/tests/library/compatibility/configs/dump ydb/tests/library/compatibility/configs/comparator"
increment: false
run_tests: false
put_build_results_to_cache: false
add_vcs_info: true
secs: ${{ format('{{"AWS_KEY_ID":"{0}","AWS_KEY_VALUE":"{1}","REMOTE_CACHE_USERNAME":"{2}","REMOTE_CACHE_PASSWORD":"{3}","TELEGRAM_YDBOT_TOKEN":"{4}"}}',
secrets.AWS_KEY_ID, secrets.AWS_KEY_VALUE, secrets.REMOTE_CACHE_USERNAME, secrets.REMOTE_CACHE_PASSWORD, secrets.TELEGRAM_YDBOT_TOKEN ) }}
vars: ${{ format('{{"AWS_BUCKET":"{0}","AWS_ENDPOINT":"{1}","REMOTE_CACHE_URL":"{2}","GH_ALERTS_TG_LOGINS":"{3}","GH_ALERTS_TG_CHAT":"{4}"}}',
vars.AWS_BUCKET, vars.AWS_ENDPOINT, vars.REMOTE_CACHE_URL_YA, vars.GH_ALERTS_TG_LOGINS, vars.GH_ALERTS_TG_CHAT ) }}
- name: Setup s3cmd
uses: ./.github/actions/s3cmd
with:
s3_bucket: "ydb-builds"
s3_endpoint: ${{ vars.AWS_ENDPOINT }}
s3_key_id: ${{ secrets.AWS_KEY_ID }}
s3_key_secret: ${{ secrets.AWS_KEY_VALUE }}
build_preset: "release"
- name: Comapare and publish result
shell: bash
run: |
set -xe
cd ./ydb/tests/library/compatibility/configs
if [[ -z "${{inputs.branches}}" ]]; then
BRANCH_LIST="stable-26-1-1 stable-26-1 stable-26-2-1 stable-26-2 prestable-26-3 current"
else
BRANCH_LIST="${{inputs.branches}}"
fi
BRANCH_LIST_NO_PRESTABLE=()
for BRANCH in $BRANCH_LIST; do
if [[ $BRANCH == 'current' ]]; then
if [[ -e dump/config-meta.json ]]; then
ln -s -f dump/config-meta.json current
else
echo "Error: dump/config-meta.json not found for 'current' branch" >&2
exit 1
fi
else
s3cmd get s3://ydb-builds/$BRANCH/release/config-meta.json $BRANCH
fi
if [[ $BRANCH != prestable* ]]; then
BRANCH_LIST_NO_PRESTABLE+=($BRANCH)
fi
done
./comparator/comparator $BRANCH_LIST > config_diff_with_prestable.html
s3cmd sync --follow-symlinks --acl-public --no-progress --stats --check-md5 "config_diff_with_prestable.html" "$S3_BUCKET_PATH/"
./comparator/comparator ${BRANCH_LIST_NO_PRESTABLE[@]} > config_diff.html
s3cmd sync --follow-symlinks --acl-public --no-progress --stats --check-md5 "config_diff.html" "$S3_BUCKET_PATH/"
if [[ -z "${{inputs.branches}}" ]]; then
s3cmd sync --follow-symlinks --acl-public --no-progress --stats --check-md5 "config_diff_with_prestable.html" "s3://ydb-builds/main/config_diff_with_prestable.html" -d
echo "Report (including prestables) with comparison placed to [global](${{ vars.AWS_ENDPOINT }}/ydb-builds/main/config_diff_with_prestable.html) and [per run]($S3_URL_PREFIX/config_diff_with_prestable.html) storages.">> $GITHUB_STEP_SUMMARY
s3cmd sync --follow-symlinks --acl-public --no-progress --stats --check-md5 "config_diff.html" "s3://ydb-builds/main/config_diff.html" -d
echo "Report with comparison placed to [global](${{ vars.AWS_ENDPOINT }}/ydb-builds/main/config_diff.html) and [per run]($S3_URL_PREFIX/config_diff.html) storages.">> $GITHUB_STEP_SUMMARY
else
echo "Report (including prestables) with comparison placed to [per run]($S3_URL_PREFIX/config_diff_with_prestable.html) storage.">> $GITHUB_STEP_SUMMARY
echo "Report with comparison placed to [per run]($S3_URL_PREFIX/config_diff.html) storage.">> $GITHUB_STEP_SUMMARY
fi
|