Fix for HPCC4J BareMetal GitHub Action Py Issue #678
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change:
Checklist:
Testing:
There appears to be an issue with the baremetal-regression-suite.yml GitHub workflow; it's breaking due to a Python-related problem as mentioned in this JIRA Ticket
The Problem seems to be lying here:
previousVersion = [latestVersion[0], latestVersion[1], latestVersion[2] - 2]
A subtraction operation is attempted on the third element of the latestVersion list.
However, latestVersion = getLatestBranchVersion(branch_name) returns the latest version as string (e.g., '9.6.0'), which is why we're encountering an error.
To resolve the issue, I modified the workflow so that it converts the 3rd string element into an integer:
previousVersion = [latestVersion[0], latestVersion[1], int(latestVersion[2]) - 2]
Here is the print statements with outputs:
print(f"Latest version: {latestVersion}, type of third element: {type(latestVersion[2])}") # Outputs: Latest version: 9.6.0, type of third element: <class 'str'> print(f"{latestVersion[0]}, {latestVersion[1]}, {int(latestVersion[2]} - 2") # Outputs: 9, ., 6 previousVersion = [latestVersion[0], latestVersion[1], int(latestVersion[2]) - 2] print(f"{previousVersion}") # Outputs: ['9', '.', 4]
UPDATE:
I updated the previous edit to fix the issue in
install latest version
Please let me know if any additional changes are needed.