Skip to content

Commit c6f23eb

Browse files
authored
Merge pull request #139 from cloudblue/LITE-29057-show-product-version-in-dr
LITE-29057 Output product version for Deployment Request
2 parents 1d49dc5 + c946672 commit c6f23eb

File tree

8 files changed

+15
-13
lines changed

8 files changed

+15
-13
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM cloudblueconnect/connect-extension-runner:29.4
1+
FROM cloudblueconnect/connect-extension-runner:30.0
22

33
COPY pyproject.toml /install_temp/.
44
COPY poetry.* /install_temp/.

connect_ext_ppr/service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def create_ppr(ppr, user_id, deployment, db, client, logger):
185185
config_json = {}
186186
status = PPRVersion.STATUS.ready
187187
active_configuration = None
188-
product_version = None
188+
product_version = deployment.product.version
189189
if not file_data:
190190
active_configuration = (
191191
db.query(Configuration)
@@ -209,7 +209,6 @@ def create_ppr(ppr, user_id, deployment, db, client, logger):
209209
.first()
210210
)
211211
data = None
212-
product_version = deployment.product.version
213212
product_info = (
214213
f"(product_id={deployment.product_id}, "
215214
f"product_version={deployment.product.version})"

connect_ext_ppr/static/index.be01a9ee781833b05409.js renamed to connect_ext_ppr/static/index.8907dee66ebdfb4a3a16.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

connect_ext_ppr/static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono&family=Roboto:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap" rel="stylesheet">
1313
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
1414
<title>Index</title>
15-
<script defer src="vendors.d43ac28a3eb5fa40c6ce.js"></script><script defer src="index.be01a9ee781833b05409.js"></script><link href="index.078542b7141079d77ac1.css" rel="stylesheet"></head>
15+
<script defer src="vendors.d43ac28a3eb5fa40c6ce.js"></script><script defer src="index.8907dee66ebdfb4a3a16.js"></script><link href="index.078542b7141079d77ac1.css" rel="stylesheet"></head>
1616

1717
<body>
1818
<div id="app"></div>

connect_ext_ppr/static/request-details.d2e1e1181d6531e0ff8b.js renamed to connect_ext_ppr/static/request-details.52f77cb9d466174a428e.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

connect_ext_ppr/utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,10 @@ def get_deployment_reference_schema(deployment, hub):
242242

243243
def get_deployment_request_schema(deployment_request, hub):
244244
"""
245-
Returns DeploymentSchema for the deployment
246-
:param deployment: Deployment model
247-
:param product: Product model from Connect
248-
:param vendor: Vendor Account model from Connect
245+
Returns DeploymentRequestSchema for the deployment request
246+
:param deployment_request: DeploymentRequest model
249247
:param hub: Hub model from Connect
250-
:rtype: DeploymentSchema
248+
:rtype: DeploymentRequestSchema
251249
"""
252250
ppr = deployment_request.ppr
253251
ppr_schema = PPRVersionReferenceSchema(

tests/api/test_pprs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ def test_upload_ppr(
318318
},
319319
'description': '\n**Description**\nWhat a lovely day\n\n\n',
320320
'status': 'ready',
321+
'product_version': 3,
321322
}
322323
assert id[:6] == 'PPRFL-'
323324
assert isinstance(events['created']['at'], str)
@@ -382,6 +383,7 @@ def test_upload_ppr_invalid(
382383
"does not contain items matching the given schema\n\n"
383384
),
384385
'status': 'failed',
386+
'product_version': 3,
385387
}
386388
assert id[:6] == 'PPRFL-'
387389
assert isinstance(events['created']['at'], str)
@@ -444,6 +446,7 @@ def test_post_ppr_new_version(
444446
},
445447
'description': '\n**Description**\nWhat a lovely day\n\n\n',
446448
'status': 'ready',
449+
'product_version': 3,
447450
}
448451
assert id[:6] == 'PPRFL-'
449452
assert isinstance(events['created']['at'], str)

ui/src/pages/RequestDetails.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ c-view.request-details(
5959
)
6060
template(#value="")
6161
detail-item(
62-
:body-text="request.deployment?.product?.name",
62+
:body-text="`${request.deployment?.product?.name} (version ${productVersion})`",
6363
dense,
6464
)
6565
template(#image="")
@@ -184,6 +184,7 @@ export default {
184184
currentTab: null,
185185
loading: true,
186186
request: null,
187+
productVersion: null,
187188
isAbortingRequest: false,
188189
isRetryingRequest: false,
189190
areTasksUpdating: false,
@@ -231,6 +232,7 @@ export default {
231232
async getPprFileUrl() {
232233
const ppr = await getPPR(this.request.deployment.id, this.request.ppr.id);
233234
this.pprFileUrl = ppr.file.location;
235+
this.productVersion = ppr.product_version;
234236
},
235237
236238
downloadPPR() {

0 commit comments

Comments
 (0)