Skip to content

Commit e15d087

Browse files
author
ci bot
committed
Merge branch 'qa-fixes' into 'enterprise'
QA fixes See merge request dkinternal/testgen/dataops-testgen!448
2 parents a37b106 + 1dfbfd9 commit e15d087

20 files changed

Lines changed: 123 additions & 72 deletions

deploy/testgen-base.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ COPY ./pyproject.toml /tmp/dk/pyproject.toml
4141
RUN mkdir /dk
4242

4343
# Upgrading pip for security
44-
RUN python3 -m pip install --upgrade pip==26.0
44+
RUN python3 -m pip install --no-cache-dir --upgrade pip==26.0
4545

4646
# hdbcli only ships manylinux wheels (no musl). pip 26+ correctly rejects these on Alpine.
4747
# We download the wheel for the correct arch, then extract it directly into site-packages
@@ -60,7 +60,7 @@ RUN ARCH=$(uname -m) && \
6060
# pip 26+ would fail trying to resolve it from PyPI on musl
6161
RUN sed -i '/hdbcli/d' /tmp/dk/pyproject.toml
6262

63-
RUN python3 -m pip install --prefix=/dk /tmp/dk
63+
RUN python3 -m pip install --no-cache-dir --prefix=/dk /tmp/dk
6464

6565
RUN apk del \
6666
gcc \

deploy/testgen.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ RUN apk upgrade
1515
# Now install everything (hdbcli is pre-installed in the base image via manual wheel extraction)
1616
COPY . /tmp/dk/
1717
RUN sed -i '/hdbcli/d' /tmp/dk/pyproject.toml /tmp/dk/testgen/pyproject.toml 2>/dev/null; \
18-
python3 -m pip install --prefix=/dk /tmp/dk
18+
python3 -m pip install --no-cache-dir --prefix=/dk /tmp/dk
1919

2020
# Generate third-party license notices from installed packages
21-
RUN pip install pip-licenses \
21+
RUN pip install --no-cache-dir pip-licenses \
2222
&& SCRIPT=$(find /tmp/dk -name generate_third_party_notices.py | head -1) \
2323
&& PYTHONPATH=/dk/lib/python3.12/site-packages python3 "$SCRIPT" --output /dk/THIRD-PARTY-NOTICES \
2424
&& pip uninstall -y pip-licenses

testgen/common/notifications/monitor_run.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ def get_main_content_template(self):
6464
border="0">
6565
<tr>
6666
<td class="summary__title">Anomalies Summary</td>
67-
<td align="right">
68-
<a class="link" href="{{view_in_testgen_url}}" target="_blank">View on TestGen &gt;</a>
69-
</td>
7067
</tr>
7168
<tr><td><div style="height: 8px;"></div></td></tr>
7269
@@ -112,6 +109,11 @@ def get_main_content_template(self):
112109
{{/if}}
113110
</td>
114111
</tr>
112+
<tr>
113+
<td colspan="3">
114+
<a class="link" href="{{view_in_testgen_url}}" target="_blank">View on TestGen &gt;</a>
115+
</td>
116+
</tr>
115117
</table>
116118
</div>
117119
"""

testgen/common/notifications/profiling_run.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ def get_main_content_template(self):
5050
<td class="summary__value">{{project_name}}</td>
5151
<td class="summary__label">Schema</td>
5252
<td class="summary__value">{{table_group_schema}}</td>
53-
<td align="right">
54-
<a class="link" href="{{profiling_run.results_url}}" target="_blank">View results on TestGen &gt;</a>
55-
</td>
56-
5753
</tr>
5854
<tr>
5955
<td class="summary__label">Table Group</td>
@@ -71,6 +67,11 @@ def get_main_content_template(self):
7167
<td class="summary__label">Duration</td>
7268
<td class="summary__value">{{format_duration profiling_run.start_time profiling_run.end_time}}</td>
7369
</tr>
70+
<tr>
71+
<td colspan="4">
72+
<a class="link" href="{{profiling_run.results_url}}" target="_blank">View results on TestGen &gt;</a>
73+
</td>
74+
</tr>
7475
</table>
7576
</div>
7677
<div class="summary">
@@ -81,11 +82,6 @@ def get_main_content_template(self):
8182
border="0">
8283
<tr>
8384
<td class="summary__title">Issues Summary</td>
84-
{{#if (eq profiling_run.status 'Complete')}}
85-
<td align="right">
86-
<a class="link" href="{{profiling_run.issues_url}}" target="_blank">View {{format_number issue_count}} issues &gt;</a>
87-
</td>
88-
{{/if}}
8985
</tr>
9086
<tr>
9187
<td class="summary__subtitle">
@@ -140,6 +136,13 @@ def get_main_content_template(self):
140136
<td><div class="code">{{profiling_run.log_message}}</div></td>
141137
</tr>
142138
{{/if}}
139+
{{#if (eq profiling_run.status 'Complete')}}
140+
<tr>
141+
<td>
142+
<a class="link" href="{{profiling_run.issues_url}}" target="_blank">View {{format_number issue_count}} issues &gt;</a>
143+
</td>
144+
</tr>
145+
{{/if}}
143146
</table>
144147
</div>
145148
{{#each hygiene_issues_summary}}
@@ -165,11 +168,6 @@ def get_result_table_template(self):
165168
{{#if (eq priority 'High')}} text-red {{/if}}
166169
{{#if (eq priority 'Moderate')}} text-orange {{/if}}
167170
">{{label}}</td>
168-
<td colspan="2" align="right">
169-
<a class="link" href="{{url}}" target="_blank">
170-
View {{format_number count.total}} {{label}} &gt;
171-
</a>
172-
</td>
173171
</tr>
174172
{{#if (len issues)}}
175173
<tr class="text-caption">
@@ -189,13 +187,18 @@ def get_result_table_template(self):
189187
</tr>
190188
{{/each}}
191189
<tr>
192-
<td></td>
193-
<td colspan="2" class="summary__caption">
190+
<td style="width: 4px;">
191+
<td colspan="2">
192+
<a class="link" href="{{url}}" target="_blank">
193+
View {{format_number count.total}} {{label}} &gt;
194+
</a>
195+
</td>
196+
<td class="summary__caption">
194197
{{#if truncated}}
195198
+ {{truncated}} more
196199
{{/if}}
197200
</td>
198-
<td colspan="2" align="right" class="summary__caption">
201+
<td align="right" class="summary__caption">
199202
<span class="text-purple" style="margin-right: 4px; font-style: normal;">&#9679;</span>
200203
indicates new issues
201204
</td>

testgen/common/notifications/score_drop.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ def get_main_content_template(self):
4545
<tr>
4646
<td class="summary__label">Project</td>
4747
<td class="summary__value">{{project_name}}</td>
48-
<td align="right">
49-
<a class="link" href="{{scorecard_url}}" target="_blank">View on TestGen &gt;</a>
50-
</td>
5148
</tr>
5249
<tr>
5350
<td class="summary__label">Scorecard</td>
@@ -62,6 +59,11 @@ def get_main_content_template(self):
6259
{{/each}}
6360
</td>
6461
</tr>
62+
<tr>
63+
<td colspan="2">
64+
<a class="link" href="{{scorecard_url}}" target="_blank">View on TestGen &gt;</a>
65+
</td>
66+
</tr>
6567
</table>
6668
<table
6769
role="presentation"

testgen/common/notifications/test_run.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ def get_main_content_template(self):
7575
border="0">
7676
<tr>
7777
<td class="summary__title">Results Summary</td>
78-
{{#if (eq test_run.status 'Complete')}}
79-
<td align="right">
80-
<a class="link" href="{{test_run_url}}" target="_blank">View on TestGen &gt;</a>
81-
</td>
82-
{{/if}}
8378
</tr>
8479
<tr>
8580
<td class="summary__subtitle">
@@ -144,6 +139,13 @@ def get_main_content_template(self):
144139
<td><div class="code">{{test_run.log_message}}</div></td>
145140
</tr>
146141
{{/if}}
142+
{{#if (eq test_run.status 'Complete')}}
143+
<tr>
144+
<td>
145+
<a class="link" href="{{test_run_url}}" target="_blank">View on TestGen &gt;</a>
146+
</td>
147+
</tr>
148+
{{/if}}
147149
</table>
148150
</div>
149151
{{#each test_result_summary}}
@@ -167,11 +169,6 @@ def get_result_table_template(self):
167169
{{#if (eq status 'Warning')}} text-orange {{/if}}
168170
{{#if (eq status 'Error')}} text-brown {{/if}}
169171
">{{label}}</td>
170-
<td colspan="2" align="right">
171-
<a class="link" href="{{test_run_url}}&status={{status}}" target="_blank">
172-
View {{format_number total}} {{label}} &gt;
173-
</a>
174-
</td>
175172
</tr>
176173
<tr class="text-caption">
177174
<td></td>
@@ -190,13 +187,18 @@ def get_result_table_template(self):
190187
</tr>
191188
{{/each}}
192189
<tr>
193-
<td></td>
194-
<td colspan="2" class="summary__caption">
190+
<td style="width: 4px;">
191+
<td colspan="2">
192+
<a class="link" href="{{test_run_url}}&status={{status}}" target="_blank">
193+
View {{format_number total}} {{label}} &gt;
194+
</a>
195+
</td>
196+
<td class="summary__caption">
195197
{{#if truncated}}
196198
+ {{truncated}} more
197199
{{/if}}
198200
</td>
199-
<td colspan="2" align="right" class="summary__caption">
201+
<td align="right" class="summary__caption">
200202
<span class="text-purple" style="margin-right: 4px; font-style: normal;">&#9679;</span>
201203
indicates new {{label}}
202204
</td>

testgen/ui/components/frontend/js/components/wizard_progress_indicator.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
*
1515
* @param {WizardStepMeta[]} steps
1616
* @param {CurrentStep} currentStep
17-
* @returns
17+
* @param {function(string)?} onStepClick
18+
* @returns
1819
*/
1920
import van from '../van.min.js';
2021
import { colorMap } from '../display_utils.js';
2122

2223
const { div, i, span } = van.tags;
2324

24-
const WizardProgressIndicator = (steps, currentStep) => {
25+
const WizardProgressIndicator = (steps, currentStep, onStepClick) => {
2526
const currentPhysicalIndex = steps.findIndex(s => s.includedSteps.includes(currentStep.name));
2627
const progressWidth = van.state('0px');
2728

@@ -50,8 +51,12 @@ const WizardProgressIndicator = (steps, currentStep) => {
5051
z-index: -4;
5152
`;
5253

53-
const currentStepIndicator = (title, stepIndex) => div(
54-
{ class: `flex-column fx-align-flex-center fx-gap-1 step-icon-current`, style: 'position: relative;' },
54+
const currentStepIndicator = (title, stepIndex, step) => div(
55+
{
56+
class: `flex-column fx-align-flex-center fx-gap-1 step-icon-current`,
57+
style: `position: relative; ${onStepClick ? 'cursor: pointer;' : ''}`,
58+
onclick: () => onStepClick?.(step.includedSteps[0]),
59+
},
5560
stepIndex === 0
5661
? div({ style: 'position: absolute; width: 50%; height: 50%; left: 0px; background: var(--dk-dialog-background); z-index: -1;' }, '')
5762
: '',
@@ -66,7 +71,10 @@ const WizardProgressIndicator = (steps, currentStep) => {
6671
);
6772

6873
const pendingStepIndicator = (title, stepIndex) => div(
69-
{ class: `flex-column fx-align-flex-center fx-gap-1 ${currentPhysicalIndex === stepIndex ? 'step-icon-current' : 'text-secondary'}`, style: 'position: relative;' },
74+
{
75+
class: `flex-column fx-align-flex-center fx-gap-1 ${currentPhysicalIndex === stepIndex ? 'step-icon-current' : 'text-secondary'}`,
76+
style: 'position: relative; cursor: default;',
77+
},
7078
stepIndex === 0
7179
? div({ style: 'position: absolute; width: 50%; height: 50%; left: 0px; background: var(--dk-dialog-background); z-index: -1;' }, '')
7280
: '',
@@ -80,8 +88,12 @@ const WizardProgressIndicator = (steps, currentStep) => {
8088
span({}, title),
8189
);
8290

83-
const completedStepIndicator = (title, stepIndex) => div(
84-
{ class: `flex-column fx-align-flex-center fx-gap-1 ${currentPhysicalIndex === stepIndex ? 'step-icon-current' : 'text-secondary'}`, style: 'position: relative;' },
91+
const completedStepIndicator = (title, stepIndex, step) => div(
92+
{
93+
class: `flex-column fx-align-flex-center fx-gap-1 ${currentPhysicalIndex === stepIndex ? 'step-icon-current' : 'text-secondary'}`,
94+
style: `position: relative; ${onStepClick ? 'cursor: pointer;' : ''}`,
95+
onclick: () => onStepClick?.(step.includedSteps[0]),
96+
},
8597
stepIndex === 0
8698
? div({ style: 'position: absolute; width: 50%; height: 50%; left: 0px; background: var(--dk-dialog-background); z-index: -1;' }, '')
8799
: '',
@@ -134,9 +146,9 @@ const WizardProgressIndicator = (steps, currentStep) => {
134146
...steps.map((step, physicalIdx) => {
135147
if (step.index < currentStep.index) {
136148
if (step.skipped) return skippedStepIndicator(step.title, physicalIdx);
137-
return completedStepIndicator(step.title, physicalIdx);
149+
return completedStepIndicator(step.title, physicalIdx, step);
138150
} else if (step.includedSteps.includes(currentStep.name)) {
139-
return currentStepIndicator(step.title, physicalIdx);
151+
return currentStepIndicator(step.title, physicalIdx, step);
140152
} else {
141153
return pendingStepIndicator(step.title, physicalIdx);
142154
}

testgen/ui/components/frontend/js/pages/table_group_wizard.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ const TableGroupWizard = (props) => {
180180
index: stepIndex,
181181
name: steps[stepIndex],
182182
},
183+
(stepName) => setStep(steps.indexOf(stepName)),
183184
);
184185
},
185186
WizardStep(0, currentStepIndex, () => {

testgen/ui/static/js/components/wizard_progress_indicator.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
*
1515
* @param {WizardStepMeta[]} steps
1616
* @param {CurrentStep} currentStep
17-
* @returns
17+
* @param {function(string)?} onStepClick
18+
* @returns
1819
*/
1920
import van from '../van.min.js';
2021
import { colorMap } from '../display_utils.js';
2122

2223
const { div, i, span } = van.tags;
2324

24-
const WizardProgressIndicator = (steps, currentStep) => {
25+
const WizardProgressIndicator = (steps, currentStep, onStepClick) => {
2526
const currentPhysicalIndex = steps.findIndex(s => s.includedSteps.includes(currentStep.name));
2627
const progressWidth = van.state('0px');
2728

@@ -50,8 +51,12 @@ const WizardProgressIndicator = (steps, currentStep) => {
5051
z-index: -4;
5152
`;
5253

53-
const currentStepIndicator = (title, stepIndex) => div(
54-
{ class: `flex-column fx-align-flex-center fx-gap-1 step-icon-current`, style: 'position: relative;' },
54+
const currentStepIndicator = (title, stepIndex, step) => div(
55+
{
56+
class: `flex-column fx-align-flex-center fx-gap-1 step-icon-current`,
57+
style: `position: relative; ${onStepClick ? 'cursor: pointer;' : ''}`,
58+
onclick: () => onStepClick?.(step.includedSteps[0]),
59+
},
5560
stepIndex === 0
5661
? div({ style: 'position: absolute; width: 50%; height: 50%; left: 0px; background: var(--dk-dialog-background); z-index: -1;' }, '')
5762
: '',
@@ -66,7 +71,10 @@ const WizardProgressIndicator = (steps, currentStep) => {
6671
);
6772

6873
const pendingStepIndicator = (title, stepIndex) => div(
69-
{ class: `flex-column fx-align-flex-center fx-gap-1 ${currentPhysicalIndex === stepIndex ? 'step-icon-current' : 'text-secondary'}`, style: 'position: relative;' },
74+
{
75+
class: `flex-column fx-align-flex-center fx-gap-1 ${currentPhysicalIndex === stepIndex ? 'step-icon-current' : 'text-secondary'}`,
76+
style: 'position: relative; cursor: default;',
77+
},
7078
stepIndex === 0
7179
? div({ style: 'position: absolute; width: 50%; height: 50%; left: 0px; background: var(--dk-dialog-background); z-index: -1;' }, '')
7280
: '',
@@ -80,8 +88,12 @@ const WizardProgressIndicator = (steps, currentStep) => {
8088
span({}, title),
8189
);
8290

83-
const completedStepIndicator = (title, stepIndex) => div(
84-
{ class: `flex-column fx-align-flex-center fx-gap-1 ${currentPhysicalIndex === stepIndex ? 'step-icon-current' : 'text-secondary'}`, style: 'position: relative;' },
91+
const completedStepIndicator = (title, stepIndex, step) => div(
92+
{
93+
class: `flex-column fx-align-flex-center fx-gap-1 ${currentPhysicalIndex === stepIndex ? 'step-icon-current' : 'text-secondary'}`,
94+
style: `position: relative; ${onStepClick ? 'cursor: pointer;' : ''}`,
95+
onclick: () => onStepClick?.(step.includedSteps[0]),
96+
},
8597
stepIndex === 0
8698
? div({ style: 'position: absolute; width: 50%; height: 50%; left: 0px; background: var(--dk-dialog-background); z-index: -1;' }, '')
8799
: '',
@@ -134,9 +146,9 @@ const WizardProgressIndicator = (steps, currentStep) => {
134146
...steps.map((step, physicalIdx) => {
135147
if (step.index < currentStep.index) {
136148
if (step.skipped) return skippedStepIndicator(step.title, physicalIdx);
137-
return completedStepIndicator(step.title, physicalIdx);
149+
return completedStepIndicator(step.title, physicalIdx, step);
138150
} else if (step.includedSteps.includes(currentStep.name)) {
139-
return currentStepIndicator(step.title, physicalIdx);
151+
return currentStepIndicator(step.title, physicalIdx, step);
140152
} else {
141153
return pendingStepIndicator(step.title, physicalIdx);
142154
}

testgen/ui/views/connections.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def on_setup_table_group_clicked(*_args) -> None:
181181
connection.save()
182182
message = "Changes have been saved successfully."
183183
except Exception as error:
184-
message = "Error creating connection"
184+
message = "Something went wrong while creating the connection."
185185
success = False
186186
LOG.exception(message)
187187

@@ -269,7 +269,7 @@ def test_connection(self, connection: Connection) -> "ConnectionStatus":
269269
details = error.args[0]
270270
return ConnectionStatus(message="Error attempting the connection.", details=details, successful=False)
271271
except Exception as error:
272-
details = "Try again"
272+
details = "Something went wrong while testing the connection."
273273
if connection.connect_by_key and not connection.private_key:
274274
details = "The private key is missing."
275275
LOG.exception("Error testing database connection")
@@ -472,7 +472,7 @@ def on_close_clicked(_params: dict) -> None:
472472
LOG.info("Table group %s created", table_group.id)
473473
safe_rerun()
474474
except Exception as error:
475-
message = "Error creating table group"
475+
message = "Something went wrong while creating the table group."
476476
success = False
477477
LOG.exception(message)
478478

0 commit comments

Comments
 (0)