Skip to content

Commit 19b14ad

Browse files
authored
Merge branch 'stable-25-1' into 25-1
2 parents a90234e + 5f292f0 commit 19b14ad

File tree

2,059 files changed

+68427
-29020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,059 files changed

+68427
-29020
lines changed

.github/actions/test_ya/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ runs:
468468
--public_dir "$PUBLIC_DIR" \
469469
--public_dir_url "$PUBLIC_DIR_URL" \
470470
--build_preset "$BUILD_PRESET" \
471+
--branch "$BRANCH_NAME" \
471472
--status_report_file statusrep.txt \
472473
--is_retry $IS_RETRY \
473474
--is_last_retry $IS_LAST_RETRY \

.github/config/muted_ya.txt

Lines changed: 24 additions & 102 deletions
Large diffs are not rendered by default.

.github/docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ COPY --from=builder \
4444
EXPOSE ${GRPC_TLS_PORT:-2135}
4545
EXPOSE ${GRPC_PORT:-2136}
4646
EXPOSE ${MON_PORT:-8765}
47+
EXPOSE ${YDB_KAFKA_PROXY_PORT:-9092}
4748

4849
HEALTHCHECK --start-period=60s --interval=1s CMD sh ./health_check
4950

.github/docker/files/initialize_local_ydb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export YDB_GRPC_ENABLE_TLS="true"
77
export GRPC_TLS_PORT=${GRPC_TLS_PORT:-2135}
88
export GRPC_PORT=${GRPC_PORT:-2136}
99
export YDB_GRPC_TLS_DATA_PATH="/ydb_certs"
10+
export YDB_KAFKA_PROXY_PORT=${YDB_KAFKA_PROXY_PORT:-9092}
1011

1112
# Start local_ydb tool. Pass additional arguments for local_ydb
1213
/local_ydb deploy --ydb-working-dir /ydb_data --ydb-binary-path /ydbd --fixed-ports --dont-use-log-files "$@";
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
import ydb
5+
import configparser
6+
import os
7+
8+
# Load configuration
9+
dir = os.path.dirname(__file__)
10+
config = configparser.ConfigParser()
11+
config_file_path = f"{dir}/../../config/ydb_qa_db.ini"
12+
config.read(config_file_path)
13+
14+
DATABASE_ENDPOINT = config["QA_DB"]["DATABASE_ENDPOINT"]
15+
DATABASE_PATH = config["QA_DB"]["DATABASE_PATH"]
16+
17+
def parse_args():
18+
parser = argparse.ArgumentParser(description="Delete a YDB table")
19+
parser.add_argument("--table_path", required=True, help="Table path and name to delete")
20+
21+
return parser.parse_args()
22+
23+
def check_table_exists(session, table_path):
24+
"""Check if table exists"""
25+
try:
26+
session.describe_table(table_path)
27+
return True
28+
except ydb.SchemeError:
29+
return False
30+
31+
def delete_table(session, table_path):
32+
"""Delete the specified table."""
33+
try:
34+
session.drop_table(table_path)
35+
print(f"Table '{table_path}' successfully deleted.")
36+
return True
37+
except ydb.Error as e:
38+
print(f"Error deleting table: {e}")
39+
return False
40+
41+
def main():
42+
args = parse_args()
43+
44+
if "CI_YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS" not in os.environ:
45+
print("Error: Env variable CI_YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS is missing, skipping")
46+
return 1
47+
else:
48+
os.environ["YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS"] = os.environ[
49+
"CI_YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS"
50+
]
51+
52+
table_path = args.table_path
53+
full_table_path = f'{DATABASE_PATH}/{table_path}'
54+
55+
print(f"Connecting to YDB to delete table {full_table_path}")
56+
57+
with ydb.Driver(
58+
endpoint=DATABASE_ENDPOINT,
59+
database=DATABASE_PATH,
60+
credentials=ydb.credentials_from_env_variables()
61+
) as driver:
62+
# Wait until driver is ready
63+
driver.wait(timeout=10, fail_fast=True)
64+
65+
with ydb.SessionPool(driver) as pool:
66+
# Проверяем существование таблицы
67+
def check_and_delete(session):
68+
exists = check_table_exists(session, full_table_path)
69+
if exists:
70+
return delete_table(session, full_table_path)
71+
else:
72+
print(f"Table '{full_table_path}' does not exist.")
73+
return False
74+
75+
result = pool.retry_operation_sync(check_and_delete)
76+
77+
if result:
78+
print(f"Table {full_table_path} has been deleted successfully.")
79+
return 0
80+
else:
81+
print(f"No table was deleted.")
82+
return 1
83+
84+
if __name__ == "__main__":
85+
exit_code = main()
86+
exit(exit_code)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
SELECT
2+
build_type ,
3+
job_name,
4+
job_id,
5+
commit,
6+
branch,
7+
pull,
8+
run_timestamp,
9+
test_id,
10+
suite_folder,
11+
test_name,
12+
cast(suite_folder || '/' || test_name as UTF8) as full_name,
13+
duration,
14+
status,
15+
String::ReplaceAll(status_description, ';;', '\n') as status_description,
16+
owners,
17+
String::ReplaceAll(owners, 'TEAM:@ydb-platform/', '') as owner_team,
18+
String::SplitToList(pull,'_A')[0] as pull_raw,
19+
cast(COALESCE(String::SplitToList(pull,'_A')[1],"1") as Uint16) as attempt,
20+
(cast(pull as String) || '_' || SUBSTRING(cast(commit as String), 1, 8)) as pull_commit,
21+
CASE
22+
WHEN String::Contains(test_name, 'chunk chunk') OR String::Contains(test_name, 'chunk+chunk') THEN TRUE
23+
ELSE FALSE
24+
END as with_cunks
25+
26+
FROM `test_results/test_runs_column`
27+
28+
WHERE
29+
run_timestamp >= CurrentUtcDate() - 6*Interval("P1D")
30+
and build_type = 'relwithdebinfo'
31+
and String::Contains(test_name, '.flake8') = FALSE
32+
and (CASE
33+
WHEN String::Contains(test_name, 'chunk chunk') OR String::Contains(test_name, 'chunk+chunk') THEN TRUE
34+
ELSE FALSE
35+
END) = FALSE
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
SELECT
2+
build_type,
3+
job_name,
4+
job_id,
5+
commit,
6+
branch,
7+
pull,
8+
run_timestamp,
9+
test_id,
10+
suite_folder,
11+
test_name,
12+
cast(suite_folder || '/' || test_name as UTF8) as full_name,
13+
duration,
14+
status,
15+
cast(String::ReplaceAll(status_description, ';;', '\n')as Utf8) as status_description ,
16+
owners
17+
FROM `test_results/test_runs_column` as all_data
18+
WHERE
19+
run_timestamp >= CurrentUtcDate() - Interval("P1D")
20+
and String::Contains(test_name, '.flake8') = FALSE
21+
and (CASE
22+
WHEN String::Contains(test_name, 'chunk chunk') OR String::Contains(test_name, 'chunk+chunk') THEN TRUE
23+
ELSE FALSE
24+
END) = FALSE
25+
and (branch = 'main' or branch like 'stable-%')
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
SELECT
2+
state_filtered,
3+
test_name,
4+
suite_folder,
5+
full_name,
6+
date_window,
7+
build_type,
8+
branch,
9+
days_ago_window,
10+
pass_count,
11+
mute_count,
12+
fail_count,
13+
skip_count,
14+
owner,
15+
is_muted,
16+
is_test_chunk,
17+
state,
18+
previous_state,
19+
state_change_date,
20+
days_in_state,
21+
previous_mute_state,
22+
mute_state_change_date,
23+
days_in_mute_state,
24+
previous_state_filtered,
25+
state_change_date_filtered,
26+
days_in_state_filtered,
27+
CASE
28+
WHEN (state = 'Skipped' AND days_in_state > 14) THEN 'Skipped'
29+
WHEN days_in_mute_state >= 30 THEN 'MUTED: delete candidate'
30+
ELSE 'MUTED: in sla'
31+
END as resolution,
32+
String::ReplaceAll(owner, 'TEAM:@ydb-platform/', '') as owner_team,
33+
CASE
34+
WHEN is_muted = 1 OR (state = 'Skipped' AND days_in_state > 14) THEN TRUE
35+
ELSE FALSE
36+
END as is_muted_or_skipped
37+
FROM `test_results/analytics/tests_monitor`
38+
WHERE date_window >= CurrentUtcDate() - 30 * Interval("P1D")
39+
and ( branch = 'main' or branch like 'stable-%')
40+
and is_test_chunk = 0
41+
and (CASE
42+
WHEN is_muted = 1 OR (state = 'Skipped' AND days_in_state > 14) THEN TRUE
43+
ELSE FALSE
44+
END ) = TRUE
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
import ydb
5+
import configparser
6+
import os
7+
import time
8+
9+
# Load configuration
10+
dir = os.path.dirname(__file__)
11+
config = configparser.ConfigParser()
12+
config_file_path = f"{dir}/../../config/ydb_qa_db.ini"
13+
config.read(config_file_path)
14+
15+
DATABASE_ENDPOINT = config["QA_DB"]["DATABASE_ENDPOINT"]
16+
DATABASE_PATH = config["QA_DB"]["DATABASE_PATH"]
17+
18+
def parse_args():
19+
parser = argparse.ArgumentParser(description="Delete old records from YDB table")
20+
parser.add_argument("--table-path", required=True, help="Table path and name")
21+
parser.add_argument("--timestamp-field", required=True, help="Name of the timestamp field")
22+
parser.add_argument("--delete-interval", required=True, help="Interval to delete records older than, in ISO 8601 format (https://en.wikipedia.org/wiki/ISO_8601#Durations) without 'P'")
23+
24+
return parser.parse_args()
25+
26+
def delete_old_records(session, full_table_path, timestamp_field, delete_interval):
27+
"""Delete records older than the specified interval."""
28+
# First, count the number of records that will be deleted
29+
count_query = f"""
30+
SELECT COUNT(*) as count
31+
FROM `{full_table_path}`
32+
WHERE `{timestamp_field}` < CurrentUtcDate() - Interval("P{delete_interval}")
33+
"""
34+
35+
print(f"Counting records to delete...")
36+
result_sets = session.transaction().execute(count_query)
37+
row_count = result_sets[0].rows[0].count
38+
39+
if row_count == 0:
40+
print("No records to delete.")
41+
return 0
42+
43+
print(f"Found {row_count} records older than {delete_interval}.")
44+
45+
# Now perform the delete operation
46+
delete_query = f"""
47+
DELETE FROM `{full_table_path}`
48+
WHERE `{timestamp_field}` < CurrentUtcDate() - Interval("P{delete_interval}")
49+
"""
50+
51+
print(f"Executing DELETE query: {delete_query}")
52+
start_time = time.time()
53+
session.transaction().execute(delete_query, commit_tx=True)
54+
end_time = time.time()
55+
56+
print(f"Deleted {row_count} records in {end_time - start_time:.2f} seconds.")
57+
return row_count
58+
59+
def main():
60+
args = parse_args()
61+
62+
if "CI_YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS" not in os.environ:
63+
print("Error: Env variable CI_YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS is missing, skipping")
64+
return 1
65+
else:
66+
os.environ["YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS"] = os.environ[
67+
"CI_YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS"
68+
]
69+
70+
table_path = args.table_path
71+
full_table_path = f'{DATABASE_PATH}/{table_path}'
72+
timestamp_field = args.timestamp_field
73+
delete_interval = args.delete_interval
74+
75+
print(f"Connecting to YDB to delete records from {full_table_path}")
76+
print(f"Will delete records where {timestamp_field} < CurrentUtcDate() - Interval(\"P{delete_interval}\")")
77+
78+
with ydb.Driver(
79+
endpoint=DATABASE_ENDPOINT,
80+
database=DATABASE_PATH,
81+
credentials=ydb.credentials_from_env_variables()
82+
) as driver:
83+
# Wait until driver is ready
84+
driver.wait(timeout=10, fail_fast=True)
85+
86+
with ydb.SessionPool(driver) as pool:
87+
try:
88+
def transaction_delete(session):
89+
return delete_old_records(session, full_table_path, timestamp_field, delete_interval)
90+
91+
deleted_count = pool.retry_operation_sync(transaction_delete)
92+
93+
print(f"Successfully deleted old records from {full_table_path}")
94+
print(f"Total records deleted: {deleted_count}")
95+
return 0
96+
except ydb.Error as e:
97+
print(f"Error deleting records: {e}")
98+
return 1
99+
100+
if __name__ == "__main__":
101+
exit_code = main()
102+
exit(exit_code)

.github/scripts/analytics/flaky_tests_history.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def main():
7878
parser = argparse.ArgumentParser()
7979

8080
parser.add_argument('--days-window', default=1, type=int, help='how many days back we collecting history')
81-
parser.add_argument('--build_type',choices=['relwithdebinfo', 'release-asan'], default='relwithdebinfo', type=str, help='build : relwithdebinfo or release-asan')
82-
parser.add_argument('--branch', default='main',choices=['main'], type=str, help='branch')
81+
parser.add_argument('--build_type', default='relwithdebinfo', type=str, help='build types')
82+
parser.add_argument('--branch', default='main', type=str, help='branch')
8383

8484
args, unknown = parser.parse_known_args()
8585
history_for_n_day = args.days_window
@@ -203,6 +203,9 @@ def main():
203203
and job_name in (
204204
'Nightly-run',
205205
'Regression-run',
206+
'Regression-run_Large',
207+
'Regression-run_Small_and_Medium',
208+
'Regression-run_compatibility',
206209
'Regression-whitelist-run',
207210
'Postcommit_relwithdebinfo',
208211
'Postcommit_asan'

0 commit comments

Comments
 (0)