Skip to content

Commit

Permalink
LITE-29057 Output product version for Deployment Request
Browse files Browse the repository at this point in the history
  • Loading branch information
Hairash committed Jan 15, 2024
1 parent b14e05c commit 101214e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cloudblueconnect/connect-extension-runner:29.4
FROM cloudblueconnect/connect-extension-runner:30.0

COPY pyproject.toml /install_temp/.
COPY poetry.* /install_temp/.
Expand Down
3 changes: 1 addition & 2 deletions connect_ext_ppr/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def create_ppr(ppr, user_id, deployment, db, client, logger):
config_json = {}
status = PPRVersion.STATUS.ready
active_configuration = None
product_version = None
product_version = deployment.product.version
if not file_data:
active_configuration = (
db.query(Configuration)
Expand All @@ -209,7 +209,6 @@ def create_ppr(ppr, user_id, deployment, db, client, logger):
.first()
)
data = None
product_version = deployment.product.version
product_info = (
f"(product_id={deployment.product_id}, "
f"product_version={deployment.product.version})"
Expand Down
8 changes: 3 additions & 5 deletions connect_ext_ppr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,10 @@ def get_deployment_reference_schema(deployment, hub):

def get_deployment_request_schema(deployment_request, hub):
"""
Returns DeploymentSchema for the deployment
:param deployment: Deployment model
:param product: Product model from Connect
:param vendor: Vendor Account model from Connect
Returns DeploymentRequestSchema for the deployment request
:param deployment_request: DeploymentRequest model
:param hub: Hub model from Connect
:rtype: DeploymentSchema
:rtype: DeploymentRequestSchema
"""
ppr = deployment_request.ppr
ppr_schema = PPRVersionReferenceSchema(
Expand Down
3 changes: 3 additions & 0 deletions tests/api/test_pprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def test_upload_ppr(
},
'description': '\n**Description**\nWhat a lovely day\n\n\n',
'status': 'ready',
'product_version': 3,
}
assert id[:6] == 'PPRFL-'
assert isinstance(events['created']['at'], str)
Expand Down Expand Up @@ -382,6 +383,7 @@ def test_upload_ppr_invalid(
"does not contain items matching the given schema\n\n"
),
'status': 'failed',
'product_version': 3,
}
assert id[:6] == 'PPRFL-'
assert isinstance(events['created']['at'], str)
Expand Down Expand Up @@ -444,6 +446,7 @@ def test_post_ppr_new_version(
},
'description': '\n**Description**\nWhat a lovely day\n\n\n',
'status': 'ready',
'product_version': 3,
}
assert id[:6] == 'PPRFL-'
assert isinstance(events['created']['at'], str)
Expand Down
4 changes: 3 additions & 1 deletion ui/src/pages/RequestDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ c-view.request-details(
)
template(#value="")
detail-item(
:body-text="request.deployment?.product?.name",
:body-text="`${request.deployment?.product?.name} (version ${productVersion})`",
dense,
)
template(#image="")
Expand Down Expand Up @@ -184,6 +184,7 @@ export default {
currentTab: null,
loading: true,
request: null,
productVersion: null,
isAbortingRequest: false,
isRetryingRequest: false,
areTasksUpdating: false,
Expand Down Expand Up @@ -231,6 +232,7 @@ export default {
async getPprFileUrl() {
const ppr = await getPPR(this.request.deployment.id, this.request.ppr.id);
this.pprFileUrl = ppr.file.location;
this.productVersion = ppr.product_version;
},
downloadPPR() {
Expand Down

0 comments on commit 101214e

Please sign in to comment.