Skip to content

Commit

Permalink
fix(RELEASE-1087): fix linting issues (#753)
Browse files Browse the repository at this point in the history
- fix linting issues in run-file-updates

Signed-off-by: Scott Hebert <[email protected]>
  • Loading branch information
scoheb authored Dec 18, 2024
1 parent 5489940 commit e63b1f2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 2 additions & 0 deletions tasks/run-file-updates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ the field `spec.data.fileUpdates` in the ReleasePlanAdmission resource.
| pipelineRunUid | The uid of the current pipelineRun. Used as a label value when creating internal requests | No | - |
| resultsDirPath | Path to results directory in the data workspace | No | - |

## Changes in 2.0.2
* fix linting issues

## Changes in 2.0.1
* fix typo in default value for `jq`
Expand Down
10 changes: 5 additions & 5 deletions tasks/run-file-updates/run-file-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Task
metadata:
name: run-file-updates
labels:
app.kubernetes.io/version: "2.0.1"
app.kubernetes.io/version: "2.0.2"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/tags: release
Expand Down Expand Up @@ -52,10 +52,10 @@ spec:
set -ex
# Obtain application from snapshot
application=$(jq -rc .application $(workspaces.data.path)/$(params.snapshotPath))
application=$(jq -rc .application "$(workspaces.data.path)/$(params.snapshotPath)")
# Extract the key from the JSON file
fileUpdates=$(jq -rc "$(params.jsonKey)" $(workspaces.data.path)/$(params.fileUpdatesPath))
fileUpdates=$(jq -rc "$(params.jsonKey)" "$(workspaces.data.path)/$(params.fileUpdatesPath)")
TASK_LABEL="internal-services.appstudio.openshift.io/group-id"
REQUEST_LABEL="internal-services.appstudio.openshift.io/request-id"
Expand All @@ -82,7 +82,7 @@ spec:
echo "=== Updates for repo: ${repo} ==="
echo -en " Evaluating '{{ }}' expressions..."
updatedPaths=$(update-paths -p "${paths}" -f $(workspaces.data.path)/$(params.snapshotPath))
updatedPaths=$(update-paths -p "${paths}" -f "$(workspaces.data.path)/$(params.snapshotPath)")
echo "done"
echo -en " Creating InternalRequest to produce file-updates..."
Expand All @@ -92,7 +92,7 @@ spec:
-p repo="${repo}" \
-p ref="${ref}" \
-p paths="${updatedPaths}" \
-p application=${application} \
-p application="${application}" \
-p file_updates_secret="${file_updates_secret}" \
-s "$(params.synchronously)" \
-l ${TASK_LABEL}="${TASK_ID}" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ spec:
set -ex
# Get application
application=$(jq -r '.application' $(workspaces.data.path)/snapshot_spec.json)
application=$(jq -r '.application' "$(workspaces.data.path)/snapshot_spec.json")
# Parse the input json file
fileUpdates=$(jq -r '.spec.data.fileUpdates | length' "$(workspaces.data.path)/rpa.json")
Expand All @@ -126,8 +126,6 @@ spec:
do
repo=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].repo' \
"$(workspaces.data.path)/rpa.json")
paths=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].paths' \
"$(workspaces.data.path)/rpa.json")
file_updates_secret=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].file_updates_secret' \
"$(workspaces.data.path)/rpa.json")
Expand Down
4 changes: 1 addition & 3 deletions tasks/run-file-updates/tests/test-run-file-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ spec:
set -ex
# Get application
application=$(jq -r '.application' $(workspaces.data.path)/snapshot_spec.json)
application=$(jq -r '.application' "$(workspaces.data.path)/snapshot_spec.json")
# Parse the input json file
fileUpdates=$(jq -r '.spec.data.fileUpdates | length' "$(workspaces.data.path)/rpa.json")
Expand Down Expand Up @@ -143,8 +143,6 @@ spec:
repo=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].repo' \
"$(workspaces.data.path)/rpa.json")
paths=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].paths' \
"$(workspaces.data.path)/rpa.json")
# Check if ref is present in the input file. If not, set it to 'main'
ref=$(jq -r --argjson i "$i" '.spec.data.fileUpdates[$i].ref // "main"' \
Expand Down

0 comments on commit e63b1f2

Please sign in to comment.