Skip to content

Commit 9939b23

Browse files
committed
Fix linting issues.
The super-linter.env currently has the following additions that are to be addressed in the future: VALIDATE_GITHUB_ACTIONS=false VALIDATE_SHELL_SHFMT=false VALIDATE_YAML=false Most of the linting for the above has been addressed with just a single issue remaining that blocks the linter from being enabled.
1 parent b8a502f commit 9939b23

File tree

361 files changed

+4198
-3479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+4198
-3479
lines changed

.ansible-lint.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
---
22
skip_list:
3-
- var-naming[no-role-prefix]
3+
- role-name
4+
# Unresolved issues with parsing jinja in multiline strings
5+
# https://github.com/ansible/ansible-lint/issues/3935
6+
- jinja[spacing]
47
- galaxy[no-changelog]
5-
- galaxy[version-incorrect]
68
- meta-runtime[unsupported-version]
9+
10+
warn_list:
11+
- name[missing]
12+
- name[play]
13+
- var-naming
14+
715
exclude_paths:
816
- actionlint.yml
17+
- .ansible/
918
- .github/
19+
# The following are files with syntax errors.
20+
# Rule 'syntax-check' is unskippable, you cannot use it in 'skip_list' or 'warn_list'. Still, you could exclude the file.
21+
- ansible/roles/filebeat/tasks/runtime.yml
22+
- environments/common/files/filebeat/filebeat.yml

.checkov.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
skip-check:
3+
# Requires all blocks to have rescue: - not considered appropriate
4+
- CKV2_ANSIBLE_3

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
# shfmt will default to indenting shell scripts with tabs,
55
# define the indent as 2 spaces
6-
[bin/*]
6+
[{.github/bin,dev}/*.sh]
77
indent_style = space
88
indent_size = 2

.github/bin/create-merge-branch.sh

100644100755
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if git show-branch "remotes/origin/$BRANCH_NAME" >/dev/null 2>&1; then
4444
fi
4545

4646
echo "[INFO] Merging release tag - $RELEASE_TAG"
47-
git merge --strategy recursive -X theirs --no-commit $RELEASE_TAG
47+
git merge --strategy recursive -X theirs --no-commit "$RELEASE_TAG"
4848

4949
# Check if the merge resulted in any changes being staged
5050
if [ -n "$(git status --short)" ]; then
@@ -54,7 +54,7 @@ if [ -n "$(git status --short)" ]; then
5454
# NOTE(scott): The GitHub create-pull-request action does
5555
# the commiting for us, so we only need to make branches
5656
# and commits if running outside of GitHub actions.
57-
if [ ! $GITHUB_ACTIONS ]; then
57+
if [ ! "$GITHUB_ACTIONS" ]; then
5858
echo "[INFO] Checking out temporary branch '$BRANCH_NAME'..."
5959
git checkout -b "$BRANCH_NAME"
6060

@@ -74,8 +74,8 @@ if [ -n "$(git status --short)" ]; then
7474

7575
# Write a file containing the branch name and tag
7676
# for automatic PR or MR creation that follows
77-
echo "BRANCH_NAME=\"$BRANCH_NAME\"" > .mergeenv
78-
echo "RELEASE_TAG=\"$RELEASE_TAG\"" >> .mergeenv
77+
echo "BRANCH_NAME=\"$BRANCH_NAME\"" >.mergeenv
78+
echo "RELEASE_TAG=\"$RELEASE_TAG\"" >>.mergeenv
7979
else
8080
echo "[INFO] Merge resulted in no changes"
81-
fi
81+
fi

.github/bin/get-s3-image.sh

100644100755
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ echo "Checking if image $image_name exists in OpenStack"
1313
image_exists=$(openstack image list --name "$image_name" -f value -c Name)
1414

1515
if [ -n "$image_exists" ]; then
16-
echo "Image $image_name already exists in OpenStack."
16+
echo "Image $image_name already exists in OpenStack."
1717
else
18-
echo "Image $image_name not found in OpenStack. Getting it from S3."
18+
echo "Image $image_name not found in OpenStack. Getting it from S3."
1919

20-
wget https://object.arcus.openstack.hpc.cam.ac.uk/swift/v1/AUTH_3a06571936a0424bb40bc5c672c4ccb1/$bucket_name/$image_name --progress=dot:giga
20+
wget "https://object.arcus.openstack.hpc.cam.ac.uk/swift/v1/AUTH_3a06571936a0424bb40bc5c672c4ccb1/$bucket_name/$image_name --progress=dot:giga"
2121

22-
echo "Uploading image $image_name to OpenStack..."
23-
openstack image create --file $image_name --disk-format qcow2 $image_name --progress
22+
echo "Uploading image $image_name to OpenStack..."
23+
openstack image create --file "$image_name" --disk-format qcow2 "$image_name" --progress
2424

25-
echo "Image $image_name has been uploaded to OpenStack."
26-
fi
25+
echo "Image $image_name has been uploaded to OpenStack."
26+
fi

.github/linters/.checkov.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.checkov.yaml

.github/linters/.python-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.python-lint

.github/linters/.shellcheckrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.shellcheckrc

.github/linters/.yamllint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../.yamllint.yml

.github/workflows/extra.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ on:
1818
- 'ansible/roles/lustre/**'
1919
- '.github/workflows/extra.yml'
2020

21+
permissions:
22+
contents: read
23+
packages: write
24+
# To report GitHub Actions status checks
25+
statuses: write
26+
2127
jobs:
2228
doca:
2329
name: extra-build
@@ -44,7 +50,7 @@ jobs:
4450
ARK_PASSWORD: ${{ secrets.ARK_PASSWORD }}
4551

4652
steps:
47-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v4
4854

4955
- name: Load current fat images into GITHUB_ENV
5056
# see https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#example-of-a-multiline-string
@@ -58,7 +64,7 @@ jobs:
5864
- name: Record settings
5965
run: |
6066
echo CI_CLOUD: ${{ env.CI_CLOUD }}
61-
echo FAT_IMAGES: ${FAT_IMAGES}
67+
echo "FAT_IMAGES: ${FAT_IMAGES}"
6268
6369
- name: Setup ssh
6470
run: |
@@ -97,7 +103,7 @@ jobs:
97103
98104
PACKER_LOG=1 packer build \
99105
-on-error=${{ vars.PACKER_ON_ERROR }} \
100-
-var-file=$PKR_VAR_environment_root/${{ env.CI_CLOUD }}.pkrvars.hcl \
106+
-var-file="$PKR_VAR_environment_root/${{ env.CI_CLOUD }}.pkrvars.hcl" \
101107
-var "source_image_name=${{ fromJSON(env.FAT_IMAGES)['cluster_image'][matrix.build.source_image_name_key] }}" \
102108
-var "image_name=${{ matrix.build.image_name }}" \
103109
-var "inventory_groups=${{ matrix.build.inventory_groups }}" \
@@ -109,14 +115,14 @@ jobs:
109115
run: |
110116
. venv/bin/activate
111117
IMAGE_ID=$(jq --raw-output '.builds[-1].artifact_id' packer/packer-manifest.json)
112-
while ! openstack image show -f value -c name $IMAGE_ID; do
118+
while ! openstack image show -f value -c name "$IMAGE_ID"; do
113119
sleep 5
114120
done
115-
IMAGE_NAME=$(openstack image show -f value -c name $IMAGE_ID)
121+
IMAGE_NAME=$(openstack image show -f value -c name "$IMAGE_ID")
116122
echo "image-name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT"
117123
echo "image-id=$IMAGE_ID" >> "$GITHUB_OUTPUT"
118-
echo $IMAGE_ID > image-id.txt
119-
echo $IMAGE_NAME > image-name.txt
124+
echo "$IMAGE_ID" > image-id.txt
125+
echo "$IMAGE_NAME" > image-name.txt
120126
121127
- name: Make image usable for further builds
122128
run: |

0 commit comments

Comments
 (0)