Skip to content

Commit

Permalink
idk where my changes went
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelethus committed Oct 21, 2024
1 parent 2cc6285 commit b1e240b
Show file tree
Hide file tree
Showing 26 changed files with 150 additions and 51 deletions.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion web/api/js/codechecker-api-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codechecker-api",
"version": "6.58.0",
"version": "6.59.0",
"description": "Generated node.js compatible API stubs for CodeChecker server.",
"main": "lib",
"homepage": "https://github.com/Ericsson/codechecker",
Expand Down
Binary file modified web/api/py/codechecker_api/dist/codechecker_api.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion web/api/py/codechecker_api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with open('README.md', encoding='utf-8', errors="ignore") as f:
long_description = f.read()

api_version = '6.58.0'
api_version = '6.59.0'

setup(
name='codechecker_api',
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion web/api/py/codechecker_api_shared/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with open('README.md', encoding='utf-8', errors="ignore") as f:
long_description = f.read()

api_version = '6.58.0'
api_version = '6.59.0'

setup(
name='codechecker_api_shared',
Expand Down
2 changes: 2 additions & 0 deletions web/api/report_server.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ struct ReportFilter {
// have "value1" OR "value2" for "key1" AND have "value3" for "key2".
22: optional list<Pair> annotations,
23: optional list<ReportStatus> reportStatus, // Specifying the status of the filtered reports.
24: bool byReportChanges // TODO
}

struct RunReportCount {
Expand Down Expand Up @@ -455,6 +456,7 @@ struct CompareData {
2: DiffType diffType,
3: list<i64> runTag, // Ids of the run history tags.
4: optional i64 openReportsDate, // Open reports date in unix time format.
5: bool byReportChanges, // TODO
}

// This type is used to get line content information for the given file at the
Expand Down
2 changes: 1 addition & 1 deletion web/codechecker_web/shared/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The newest supported minor version (value) for each supported major version
# (key) in this particular build.
SUPPORTED_VERSIONS = {
6: 58
6: 59
}

# Used by the client to automatically identify the latest major and minor
Expand Down
2 changes: 1 addition & 1 deletion web/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lxml==5.2.2
sqlalchemy==1.3.23
sqlalchemy==1.4.45
alembic==1.5.5
portalocker==2.2.1
psutil==5.8.0
Expand Down
2 changes: 1 addition & 1 deletion web/requirements_py/db_pg8000/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lxml==5.2.2
sqlalchemy==1.3.23
sqlalchemy==1.4.45
alembic==1.5.5
pg8000==1.15.2
psutil==5.8.0
Expand Down
2 changes: 1 addition & 1 deletion web/requirements_py/db_psycopg2/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lxml==5.2.2
sqlalchemy==1.3.23
sqlalchemy==1.4.45
alembic==1.5.5
psycopg2-binary==2.8.6
psutil==5.8.0
Expand Down
75 changes: 53 additions & 22 deletions web/server/codechecker_server/api/report_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@

import sqlalchemy
from sqlalchemy.sql.expression import or_, and_, not_, func, \
asc, desc, union_all, select, bindparam, literal_column, case, cast
from sqlalchemy.orm import contains_eager
asc, desc, union_all, select, bindparam, literal_column, case, cast, \
except_, intersect
from sqlalchemy.orm import contains_eager, aliased

import codechecker_api_shared
from codechecker_api.codeCheckerDBAccess_v6 import constants, ttypes
Expand Down Expand Up @@ -227,6 +228,14 @@ def process_report_filter(
cmp_filter_expr, join_tables = process_cmp_data_filter(
session, run_ids, report_filter, cmp_data)

if cmp_filter_expr is not None:
print("---------------____")
print("--------cmp_filter_expr-------____")
print(cmp_filter_expr)
print(cmp_filter_expr.compile().params)
print("---------------____")
print("---------------____")

if cmp_filter_expr is not None:
AND.append(cmp_filter_expr)

Expand Down Expand Up @@ -640,10 +649,8 @@ def get_open_reports_date_filter_query_old(tbl=Report, date=RunHistory.time):
return tbl.detected_at <= date


def get_diff_bug_id_query(session, run_ids, tag_ids, open_reports_date):
def get_diff_bug_id_query_impl(q, run_ids, tag_ids, open_reports_date):
""" Get bug id query for diff. """
q = session.query(Report.bug_id.distinct())

if run_ids:
q = q.filter(Report.run_id.in_(run_ids))
if not tag_ids and not open_reports_date:
Expand All @@ -662,6 +669,15 @@ def get_diff_bug_id_query(session, run_ids, tag_ids, open_reports_date):

return q

def get_diff_bug_id_query(session, run_ids, tag_ids, open_reports_date):
""" Get bug id query for diff. """
q = session.query(Report.bug_id.distinct().label("id"))
return get_diff_bug_id_query_impl(q, run_ids, tag_ids, open_reports_date)

def get_diff_bug_id_query_with_length(session, run_ids, tag_ids, open_reports_date):
""" Get bug id query for diff. """
q = session.query(Report.bug_id.distinct().label("id"), Report.path_length.label("length"))
return get_diff_bug_id_query_impl(q, run_ids, tag_ids, open_reports_date)

def get_diff_bug_id_filter(run_ids, tag_ids, open_reports_date):
""" Get bug id filter for diff. """
Expand Down Expand Up @@ -736,30 +752,45 @@ def process_cmp_data_filter(session, run_ids, report_filter, cmp_data):

return and_(diff_filter), join_tables

query_base = get_diff_bug_id_query(session, run_ids, base_tag_ids,
base_open_reports_date)
query_base_runs = get_diff_run_id_query(session, run_ids, base_tag_ids)
if cmp_data.byReportChanges is not None and cmp_data.byReportChanges:
query_base = get_diff_bug_id_query_with_length(session, run_ids, base_tag_ids,
base_open_reports_date)

query_new = get_diff_bug_id_query(session, cmp_data.runIds,
cmp_data.runTag,
cmp_data.openReportsDate)
query_new = get_diff_bug_id_query_with_length(session, cmp_data.runIds,
cmp_data.runTag,
cmp_data.openReportsDate)

else:
query_base = get_diff_bug_id_query(session, run_ids, base_tag_ids,
base_open_reports_date)

query_new = get_diff_bug_id_query(session, cmp_data.runIds,
cmp_data.runTag,
cmp_data.openReportsDate)

query_base_runs = get_diff_run_id_query(session, run_ids, base_tag_ids)
query_new_runs = get_diff_run_id_query(session, cmp_data.runIds,
cmp_data.runTag)

if cmp_data.diffType == DiffType.NEW:
return and_(Report.bug_id.in_(query_new.except_(query_base)),
Report.run_id.in_(query_new_runs)), [Run]
query_bug_list = except_(query_new, query_base)
query_run_list = query_new_runs

elif cmp_data.diffType == DiffType.RESOLVED:
return and_(Report.bug_id.in_(query_base.except_(query_new)),
Report.run_id.in_(query_base_runs)), [Run]
query_bug_list = except_(query_base, query_new)
query_run_list = query_base_runs

elif cmp_data.diffType == DiffType.UNRESOLVED:
return and_(Report.bug_id.in_(query_base.intersect(query_new)),
Report.run_id.in_(query_new_runs)), [Run]
query_bug_list = intersect(query_base, query_new)
query_run_list = query_new_runs

else:
raise codechecker_api_shared.ttypes.RequestFailed(
codechecker_api_shared.ttypes.ErrorCode.DATABASE,
'Unsupported diff type: ' + str(cmp_data.diffType))

return and_(Report.bug_id.in_(select(query_bug_list.c.id)),
Report.run_id.in_(query_run_list)), [Run]

def process_run_history_filter(query, run_ids, run_history_filter):
"""
Expand Down Expand Up @@ -1160,15 +1191,13 @@ def get_analysis_statistics_query(session, run_ids, run_history_ids=None):
query = session.query(AnalyzerStatistic, Run.id)

if run_ids:
# Subquery to get analyzer statistics only for these run history id's.
history_ids_subq = session.query(
func.max(AnalyzerStatistic.run_history_id)) \
.filter(RunHistory.run_id.in_(run_ids)) \
.outerjoin(
RunHistory,
RunHistory.id == AnalyzerStatistic.run_history_id) \
.group_by(RunHistory.run_id) \
.subquery()
.group_by(RunHistory.run_id)

query = query.filter(
AnalyzerStatistic.run_history_id.in_(history_ids_subq))
Expand Down Expand Up @@ -1844,8 +1873,10 @@ def getDiffResultsHash(self, run_ids, report_hashes, diff_type,
new_hashes_query = union_all(*[
select([bindparam('bug_id' + str(i), h)
.label('bug_id')])
for i, h in enumerate(chunk)])
q = select([new_hashes_query]).except_(base_hashes)
for i, h in enumerate(chunk)]).subquery()
q = select([new_hashes_query]) \
.except_(base_hashes) \
.subquery()
new_hashes.extend([res[0] for res in session.query(q)])

return new_hashes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def upgrade():
op.add_column('run_histories',
sa.Column('check_command', sa.Binary(), nullable=True))
sa.Column('check_command', sa.LargeBinary(), nullable=True))


def downgrade():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def upgrade():
op.create_table(
'source_components',
sa.Column('name', sa.String(), nullable=False),
sa.Column('value', sa.Binary(), nullable=False),
sa.Column('value', sa.LargeBinary(), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('username', sa.String(), nullable=True),
sa.PrimaryKeyConstraint('name', name=op.f('pk_source_components'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def upgrade():
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('run_history_id', sa.Integer(), nullable=True),
sa.Column('analyzer_type', sa.String(), nullable=True),
sa.Column('version', sa.Binary(), nullable=True),
sa.Column('version', sa.LargeBinary(), nullable=True),
sa.Column('successful', sa.Integer(), nullable=True),
sa.Column('failed', sa.Integer(), nullable=True),
sa.Column('failed_files', sa.Binary(), nullable=True),
sa.Column('failed_files', sa.LargeBinary(), nullable=True),
sa.ForeignKeyConstraint(
['run_history_id'], ['run_histories.id'],
name=op.f('fk_analyzer_statistics_run_history_id_'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def decode_file_content(content):
'review_status_is_in_source',
sa.Boolean(), server_default='0', nullable=True)
col_rs_message = sa.Column(
'review_status_message', sa.Binary(), nullable=True)
'review_status_message', sa.LargeBinary(), nullable=True)

conn = op.get_bind()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def upgrade():
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('bug_hash', sa.String(), nullable=False),
sa.Column('author', sa.String(), nullable=False),
sa.Column('message', sa.Binary(), nullable=False),
sa.Column('message', sa.LargeBinary(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_comments'))
)
Expand All @@ -40,7 +40,7 @@ def upgrade():
op.create_table(
'file_contents',
sa.Column('content_hash', sa.String(), nullable=False),
sa.Column('content', sa.Binary(), nullable=True),
sa.Column('content', sa.LargeBinary(), nullable=True),
sa.PrimaryKeyConstraint('content_hash', name=op.f('pk_file_contents'))
)

Expand All @@ -54,7 +54,7 @@ def upgrade():
name='review_status'),
nullable=False),
sa.Column('author', sa.String(), nullable=False),
sa.Column('message', sa.Binary(), nullable=False),
sa.Column('message', sa.LargeBinary(), nullable=False),
sa.Column('date', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('bug_hash', name=op.f('pk_review_statuses'))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def upgrade():
sa.Column('tracking_branch', sa.String(), nullable=True))

op.add_column('file_contents',
sa.Column('blame_info', sa.Binary(), nullable=True))
sa.Column('blame_info', sa.LargeBinary(), nullable=True))


def downgrade():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def upgrade():
analysis_info_tbl = op.create_table(
'analysis_info',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('analyzer_command', sa.Binary(), nullable=True),
sa.Column('analyzer_command', sa.LargeBinary(), nullable=True),
sa.PrimaryKeyConstraint('id', name=op.f('pk_analysis_info'))
)

Expand Down
13 changes: 6 additions & 7 deletions web/server/vue-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/server/vue-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"dependencies": {
"@mdi/font": "^6.5.95",
"codechecker-api": "file:../../api/js/codechecker-api-node/dist/codechecker-api-6.58.0.tgz",
"codechecker-api": "file:../../api/js/codechecker-api-node/dist/codechecker-api-6.59.0.tgz",
"chart.js": "^2.9.4",
"chartjs-plugin-datalabels": "^0.7.0",
"codemirror": "^5.65.0",
Expand Down
Loading

0 comments on commit b1e240b

Please sign in to comment.