From 009df56bb6347596d6f650f40ba6de34b51568b8 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:06:24 +0530 Subject: [PATCH 01/13] Proper message display when no bash files chnaged in the PR Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .github/workflows/bash_formatter.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bash_formatter.yaml b/.github/workflows/bash_formatter.yaml index fd1d254bf..5881eee3b 100644 --- a/.github/workflows/bash_formatter.yaml +++ b/.github/workflows/bash_formatter.yaml @@ -26,15 +26,19 @@ jobs: run: git fetch origin master - name: Set up changed files + id: changed_files run: | git diff --name-only origin/master...HEAD | grep -E '^.*\.sh$' | grep -v '^apps/' > changed_files_in_PR.txt || true - + if [ ! -s changed_files_in_PR.txt ]; then + echo "No bash files have changed in this PR." + fi + - name: Display changed files - run: cat changed_files_in_PR.txt + if: always() # Always run this step + run: cat changed_files_in_PR.txt || echo "No files to display." - name: Run ShellCheck on changed files + if: steps.changed_files.outputs.changed_files != '' run: | - cat changed_files_in_PR.txt | xargs -I {} shellcheck {} + cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || echo "No changes needed for the bash files." shell: bash - - From ad63bac66b9a87dc13deba747b09fc9a8fffb1f1 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:19:17 +0530 Subject: [PATCH 02/13] Proper message display when no Yaml files chnaged in the PR Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .github/workflows/bash_formatter.yaml | 2 +- .github/workflows/yaml_formatter.yaml | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bash_formatter.yaml b/.github/workflows/bash_formatter.yaml index 5881eee3b..7c992f8ab 100644 --- a/.github/workflows/bash_formatter.yaml +++ b/.github/workflows/bash_formatter.yaml @@ -35,7 +35,7 @@ jobs: - name: Display changed files if: always() # Always run this step - run: cat changed_files_in_PR.txt || echo "No files to display." + run: cat changed_files_in_PR.txt || echo "No bash files have changed in this PR." - name: Run ShellCheck on changed files if: steps.changed_files.outputs.changed_files != '' diff --git a/.github/workflows/yaml_formatter.yaml b/.github/workflows/yaml_formatter.yaml index dca73409d..fd5cef4a5 100644 --- a/.github/workflows/yaml_formatter.yaml +++ b/.github/workflows/yaml_formatter.yaml @@ -43,17 +43,26 @@ jobs: run: git fetch origin master - name: Set up changed files + id: changed_files run: | git diff --name-only origin/master...HEAD | grep -E '^common/.*\.ya?ml$|^example/.*\.ya?ml$' > changed_files_in_PR.txt || true + if [ ! -s changed_files_in_PR.txt ]; then + echo "No YAML files have changed in this PR." > changed_files_in_PR.txt + fi - name: Display changed files run: cat changed_files_in_PR.txt - name: Run yamllint on changed files run: | - chmod +x ./run_yamllint.sh - ./run_yamllint.sh + if [ -s changed_files_in_PR.txt ]; then + cat changed_files_in_PR.txt | xargs yamllint + if [ $? -eq 0 ]; then + echo "No YAML style errors found in the changed files." + else + echo "YAML style errors were found." + fi + else + echo "No YAML files have changed in this PR." + fi shell: bash - - - From 1d28ed8587cf0bafe909be15356085183f2aad2b Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:24:08 +0530 Subject: [PATCH 03/13] Proper message display when no Yaml files chnaged and styled in the PR Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .github/workflows/yaml_formatter.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/yaml_formatter.yaml b/.github/workflows/yaml_formatter.yaml index fd5cef4a5..34047ca6d 100644 --- a/.github/workflows/yaml_formatter.yaml +++ b/.github/workflows/yaml_formatter.yaml @@ -43,7 +43,6 @@ jobs: run: git fetch origin master - name: Set up changed files - id: changed_files run: | git diff --name-only origin/master...HEAD | grep -E '^common/.*\.ya?ml$|^example/.*\.ya?ml$' > changed_files_in_PR.txt || true if [ ! -s changed_files_in_PR.txt ]; then From 6de525df8c645c5716b966e2969800fbe6892788 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:28:36 +0530 Subject: [PATCH 04/13] Proper message display when no need to do style in Yaml files Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .github/workflows/yaml_formatter.yaml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/yaml_formatter.yaml b/.github/workflows/yaml_formatter.yaml index 34047ca6d..afa1b4c1b 100644 --- a/.github/workflows/yaml_formatter.yaml +++ b/.github/workflows/yaml_formatter.yaml @@ -43,6 +43,7 @@ jobs: run: git fetch origin master - name: Set up changed files + id: changed_files run: | git diff --name-only origin/master...HEAD | grep -E '^common/.*\.ya?ml$|^example/.*\.ya?ml$' > changed_files_in_PR.txt || true if [ ! -s changed_files_in_PR.txt ]; then @@ -53,15 +54,7 @@ jobs: run: cat changed_files_in_PR.txt - name: Run yamllint on changed files + if: steps.changed_files.outputs.changed_files != '' run: | - if [ -s changed_files_in_PR.txt ]; then - cat changed_files_in_PR.txt | xargs yamllint - if [ $? -eq 0 ]; then - echo "No YAML style errors found in the changed files." - else - echo "YAML style errors were found." - fi - else - echo "No YAML files have changed in this PR." - fi + cat changed_files_in_PR.txt | xargs -I {} yamllint {} || echo "No changes needed for the YAML files." shell: bash From 69143680b2e683634690224c032bd8dcb01ab4e5 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:38:55 +0530 Subject: [PATCH 05/13] Check the linting working by changing a yaml file Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .github/workflows/yaml_formatter.yaml | 12 ++++++++++-- .../cert-manager/cert-manager/base/cert-manager.yaml | 12 ++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/yaml_formatter.yaml b/.github/workflows/yaml_formatter.yaml index afa1b4c1b..d340756c2 100644 --- a/.github/workflows/yaml_formatter.yaml +++ b/.github/workflows/yaml_formatter.yaml @@ -54,7 +54,15 @@ jobs: run: cat changed_files_in_PR.txt - name: Run yamllint on changed files - if: steps.changed_files.outputs.changed_files != '' run: | - cat changed_files_in_PR.txt | xargs -I {} yamllint {} || echo "No changes needed for the YAML files." + if [ -s changed_files_in_PR.txt ]; then + cat changed_files_in_PR.txt | xargs -I {} yamllint {} || exit 1 + else + echo "No YAML files have changed in this PR." + fi + shell: bash + + - name: Check YAML lint results + if: success() + run: echo "No styling issues with YAML files." shell: bash diff --git a/common/cert-manager/cert-manager/base/cert-manager.yaml b/common/cert-manager/cert-manager/base/cert-manager.yaml index 3cbd60ba8..fbe330d61 100644 --- a/common/cert-manager/cert-manager/base/cert-manager.yaml +++ b/common/cert-manager/cert-manager/base/cert-manager.yaml @@ -22,12 +22,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: certificaterequests.cert-manager.io - labels: - app: 'cert-manager' - app.kubernetes.io/name: 'cert-manager' - app.kubernetes.io/instance: 'cert-manager' - # Generated labels - app.kubernetes.io/version: "v1.14.5" + labels: + app: 'cert-manager' + app.kubernetes.io/name: 'cert-manager' + app.kubernetes.io/instance: 'cert-manager' + # Generated labels + app.kubernetes.io/version: "v1.14.5" spec: group: cert-manager.io names: From b409d24bf8b3b26c3fb0ec2aab3fc59cb3860e24 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:49:47 +0530 Subject: [PATCH 06/13] Testing working of Bash linting Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .github/workflows/yaml_formatter.yaml | 9 +++++---- .../cert-manager/cert-manager/base/cert-manager.yaml | 12 ++++++------ hack/synchronize-istio-cni-manifests.sh | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/yaml_formatter.yaml b/.github/workflows/yaml_formatter.yaml index d340756c2..962f13d09 100644 --- a/.github/workflows/yaml_formatter.yaml +++ b/.github/workflows/yaml_formatter.yaml @@ -54,15 +54,16 @@ jobs: run: cat changed_files_in_PR.txt - name: Run yamllint on changed files + id: lint run: | - if [ -s changed_files_in_PR.txt ]; then - cat changed_files_in_PR.txt | xargs -I {} yamllint {} || exit 1 - else + if grep -q 'No YAML files have changed in this PR.' changed_files_in_PR.txt; then echo "No YAML files have changed in this PR." + else + cat changed_files_in_PR.txt | xargs -I {} yamllint {} || exit 1 fi shell: bash - name: Check YAML lint results - if: success() + if: success() && steps.lint.outcome == 'success' run: echo "No styling issues with YAML files." shell: bash diff --git a/common/cert-manager/cert-manager/base/cert-manager.yaml b/common/cert-manager/cert-manager/base/cert-manager.yaml index fbe330d61..3cbd60ba8 100644 --- a/common/cert-manager/cert-manager/base/cert-manager.yaml +++ b/common/cert-manager/cert-manager/base/cert-manager.yaml @@ -22,12 +22,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: certificaterequests.cert-manager.io - labels: - app: 'cert-manager' - app.kubernetes.io/name: 'cert-manager' - app.kubernetes.io/instance: 'cert-manager' - # Generated labels - app.kubernetes.io/version: "v1.14.5" + labels: + app: 'cert-manager' + app.kubernetes.io/name: 'cert-manager' + app.kubernetes.io/instance: 'cert-manager' + # Generated labels + app.kubernetes.io/version: "v1.14.5" spec: group: cert-manager.io names: diff --git a/hack/synchronize-istio-cni-manifests.sh b/hack/synchronize-istio-cni-manifests.sh index 1f8a22c3e..bbfb494d2 100644 --- a/hack/synchronize-istio-cni-manifests.sh +++ b/hack/synchronize-istio-cni-manifests.sh @@ -44,7 +44,7 @@ then fi # Create the branch in the manifests repository -if ! git show-ref --verify --quiet refs/heads/$BRANCH; then + if ! git show-ref --verify --quiet refs/heads/$BRANCH; then git checkout -b $BRANCH else echo "Branch $BRANCH already exists." From 1d1162026abb31762ba9ef8802657900b6a30dce Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Sat, 20 Jul 2024 13:50:59 +0530 Subject: [PATCH 07/13] Make some fix in formatting bash files Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .github/workflows/bash_formatter.yaml | 14 ++++++++++++-- hack/synchronize-istio-cni-manifests.sh | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bash_formatter.yaml b/.github/workflows/bash_formatter.yaml index 7c992f8ab..c2384f103 100644 --- a/.github/workflows/bash_formatter.yaml +++ b/.github/workflows/bash_formatter.yaml @@ -38,7 +38,17 @@ jobs: run: cat changed_files_in_PR.txt || echo "No bash files have changed in this PR." - name: Run ShellCheck on changed files - if: steps.changed_files.outputs.changed_files != '' + id: lint run: | - cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || echo "No changes needed for the bash files." + if grep -q 'No bash files have changed in this PR.' changed_files_in_PR.txt; then + echo "No bash files have changed in this PR." + else + cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || exit 1 + fi + shell: bash + + - name: Check Bash lint results + if: success() && steps.lint.outcome == 'success' + run: echo "No styling issues with Bash files." shell: bash + diff --git a/hack/synchronize-istio-cni-manifests.sh b/hack/synchronize-istio-cni-manifests.sh index bbfb494d2..3512da265 100644 --- a/hack/synchronize-istio-cni-manifests.sh +++ b/hack/synchronize-istio-cni-manifests.sh @@ -44,7 +44,7 @@ then fi # Create the branch in the manifests repository - if ! git show-ref --verify --quiet refs/heads/$BRANCH; then + if ! git show-ref --verify --quiet refs/heads/$BRANCH; then git checkout -b $BRANCH else echo "Branch $BRANCH already exists." From c234d37f5be781ad0e7e4356a8d890852691ab92 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Sat, 20 Jul 2024 13:53:24 +0530 Subject: [PATCH 08/13] checking functionalities of linting Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- hack/synchronize-istio-cni-manifests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/synchronize-istio-cni-manifests.sh b/hack/synchronize-istio-cni-manifests.sh index 3512da265..1f8a22c3e 100644 --- a/hack/synchronize-istio-cni-manifests.sh +++ b/hack/synchronize-istio-cni-manifests.sh @@ -44,7 +44,7 @@ then fi # Create the branch in the manifests repository - if ! git show-ref --verify --quiet refs/heads/$BRANCH; then +if ! git show-ref --verify --quiet refs/heads/$BRANCH; then git checkout -b $BRANCH else echo "Branch $BRANCH already exists." From 534793e32197b816f81f723573491e36ffe8cd13 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Sat, 20 Jul 2024 14:33:32 +0530 Subject: [PATCH 09/13] Combined Yaml,Bash and Python formatting yaml files into one workflow Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .../linting_bash_python_yaml_files.yaml | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 .github/workflows/linting_bash_python_yaml_files.yaml diff --git a/.github/workflows/linting_bash_python_yaml_files.yaml b/.github/workflows/linting_bash_python_yaml_files.yaml new file mode 100644 index 000000000..33e5e6914 --- /dev/null +++ b/.github/workflows/linting_bash_python_yaml_files.yaml @@ -0,0 +1,144 @@ +name: Proper linting on Bash, Python, and YAML files + +on: [push, pull_request] + +jobs: + format_python_files: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Python Files Formatting Guidelines + run: | + echo "### Python Files Formatting Guidelines ### + If there is a formatting error in your python files, + 1. First install black + It requires Python 3.8+ to run. + Install with 'pip install black' and if you use pipx, install Black with 'pipx install black'. + If you want to format Jupyter Notebooks, install with 'pip install black[jupyter]'. + + 2. Run the command + 'python -m black {source_file_or_directory}' or + 'black {source_file_or_directory}' + to format python files. + " + + - uses: psf/black@stable + with: + src: | + ./common + ./example + + format_YAML_files: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install yamllint + run: pip install yamllint + + - name: YAML Formatting Guidelines + run: | + echo "### YAML Formatting Guidelines ### + If there is a formatting error in your YAML file, you will see errors like the one below: + 'Error: 6:4 [indentation] wrong indentation: expected 2 but found 3' + + To fix these errors, refer to the YAML formatting rules at: + https://yamllint.readthedocs.io/en/stable/rules.html# + + Search for the keyword inside the brackets [] in the error message. In this example, it's 'indentation'. + + Note: Some rules have been customized in the '.yamllint.yaml' file. Below is the content of that file: + + extends: default + + rules: + document-start: + present: false + document-end: + present: false + indentation: + indent-sequences: false + line-length: + max: 400 + " + + - name: Fetch master branch + run: git fetch origin master + + - name: Set up changed files + id: changed_files + run: | + git diff --name-only origin/master...HEAD | grep -E '^common/.*\.ya?ml$|^example/.*\.ya?ml$' > changed_files_in_PR.txt || true + if [ ! -s changed_files_in_PR.txt ]; then + echo "No YAML files have changed in this PR." > changed_files_in_PR.txt + fi + + - name: Display changed files + run: cat changed_files_in_PR.txt + + - name: Run yamllint on changed files + id: lint + run: | + if grep -q 'No YAML files have changed in this PR.' changed_files_in_PR.txt; then + echo "No YAML files have changed in this PR." + else + cat changed_files_in_PR.txt | xargs -I {} yamllint {} || exit 1 + fi + shell: bash + + - name: Check YAML lint results + if: success() && steps.lint.outcome == 'success' + run: echo "No styling issues with YAML files." + shell: bash + + format_bash_files: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install ShellCheck + run: sudo apt install -y shellcheck + + - name: Bash Formatting Guidelines + run: | + echo "### Bash Files Formatting Guidelines ### + If there are errors and warnings regarding your bash files, + You can check the error code definitions at https://www.shellcheck.net/wiki/. + You can correct them using the https://www.shellcheck.net/ site. + You have to ignore disable errors in the .shellcheckrc file. + " + + - name: Fetch master branch + run: git fetch origin master + + - name: Set up changed files + id: changed_files + run: | + git diff --name-only origin/master...HEAD | grep -E '^.*\.sh$' | grep -v '^apps/' > changed_files_in_PR.txt || true + if [ ! -s changed_files_in_PR.txt ]; then + echo "No bash files have changed in this PR." + fi + + - name: Display changed files + if: always() # Always run this step + run: cat changed_files_in_PR.txt || echo "No bash files have changed in this PR." + + - name: Run ShellCheck on changed files + id: lint + run: | + if grep -q 'No bash files have changed in this PR.' changed_files_in_PR.txt; then + echo "No bash files have changed in this PR." + else + cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || exit 1 + fi + shell: bash + + - name: Check Bash lint results + if: success() && steps.lint.outcome == 'success' + run: echo "No styling issues with Bash files." + shell: bash From b2ce5f417db0f8c9037f868b868bd8977ced4dfe Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Sat, 20 Jul 2024 14:36:33 +0530 Subject: [PATCH 10/13] Deleted seperate files Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .github/workflows/bash_formatter.yaml | 54 ------------------- .github/workflows/python_formatter.yaml | 32 ------------ .github/workflows/yaml_formatter.yaml | 69 ------------------------- 3 files changed, 155 deletions(-) delete mode 100644 .github/workflows/bash_formatter.yaml delete mode 100644 .github/workflows/python_formatter.yaml delete mode 100644 .github/workflows/yaml_formatter.yaml diff --git a/.github/workflows/bash_formatter.yaml b/.github/workflows/bash_formatter.yaml deleted file mode 100644 index c2384f103..000000000 --- a/.github/workflows/bash_formatter.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Proper Formatting on bash files - -on: [push, pull_request] - -jobs: - format_bash_files: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install ShellCheck - run: sudo apt install -y shellcheck - - - name: Bash Formatting Guidelines - run: | - echo "### Bash Files Formatting Guidelines ### - If there are errors and warnings regarding your bash files, - You can check that error code definitions in https://www.shellcheck.net/wiki/ site. - You can correct them using the https://www.shellcheck.net/ site. - You have to ignore disable errors in .shellcheckrc file. - " - - - name: Fetch master branch - run: git fetch origin master - - - name: Set up changed files - id: changed_files - run: | - git diff --name-only origin/master...HEAD | grep -E '^.*\.sh$' | grep -v '^apps/' > changed_files_in_PR.txt || true - if [ ! -s changed_files_in_PR.txt ]; then - echo "No bash files have changed in this PR." - fi - - - name: Display changed files - if: always() # Always run this step - run: cat changed_files_in_PR.txt || echo "No bash files have changed in this PR." - - - name: Run ShellCheck on changed files - id: lint - run: | - if grep -q 'No bash files have changed in this PR.' changed_files_in_PR.txt; then - echo "No bash files have changed in this PR." - else - cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || exit 1 - fi - shell: bash - - - name: Check Bash lint results - if: success() && steps.lint.outcome == 'success' - run: echo "No styling issues with Bash files." - shell: bash - diff --git a/.github/workflows/python_formatter.yaml b/.github/workflows/python_formatter.yaml deleted file mode 100644 index ba470cad8..000000000 --- a/.github/workflows/python_formatter.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: Proper Formatting on Python files - -on: [push, pull_request] - -jobs: - format_python_files: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Python Files Formatting Guidelines - run: | - echo "### Python Files Formatting Guidelines ### - If there is a formatting errors in your python files, - 1. First install black - It requires Python 3.8+ to run. - Install with "pip install black" and if you use pipx, install Black with "pipx install black" - If you want to format Jupyter Notebooks, install with pip install "black[jupyter]" - - 2. Run the command - "python -m black {source_file_or_directory}" or - "black {source_file_or_directory}" - to format python files. - " - - - uses: psf/black@stable - with: - src: | - ./common - ./example - - \ No newline at end of file diff --git a/.github/workflows/yaml_formatter.yaml b/.github/workflows/yaml_formatter.yaml deleted file mode 100644 index 962f13d09..000000000 --- a/.github/workflows/yaml_formatter.yaml +++ /dev/null @@ -1,69 +0,0 @@ -name: Proper Formatting on YAML files - -on: [push, pull_request] - -jobs: - format_YAML_files: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install yamllint - run: pip install yamllint - - - name: YAML Formatting Guidelines - run: | - echo "### YAML Formatting Guidelines ### - If there is a formatting error in your YAML file, you will see errors like the one below: - 'Error: 6:4 [indentation] wrong indentation: expected 2 but found 3' - - To fix these errors, refer to the YAML formatting rules at: - https://yamllint.readthedocs.io/en/stable/rules.html# - - Search for the keyword inside the brackets [] in the error message. In this example, it's 'indentation'. - - Note: Some rules have been customized in the '.yamllint.yaml' file. Below is the content of that file: - - extends: default - - rules: - document-start: - present: false - document-end: - present: false - indentation: - indent-sequences: false - line-length: - max: 400 - " - - - name: Fetch master branch - run: git fetch origin master - - - name: Set up changed files - id: changed_files - run: | - git diff --name-only origin/master...HEAD | grep -E '^common/.*\.ya?ml$|^example/.*\.ya?ml$' > changed_files_in_PR.txt || true - if [ ! -s changed_files_in_PR.txt ]; then - echo "No YAML files have changed in this PR." > changed_files_in_PR.txt - fi - - - name: Display changed files - run: cat changed_files_in_PR.txt - - - name: Run yamllint on changed files - id: lint - run: | - if grep -q 'No YAML files have changed in this PR.' changed_files_in_PR.txt; then - echo "No YAML files have changed in this PR." - else - cat changed_files_in_PR.txt | xargs -I {} yamllint {} || exit 1 - fi - shell: bash - - - name: Check YAML lint results - if: success() && steps.lint.outcome == 'success' - run: echo "No styling issues with YAML files." - shell: bash From 60be547174eaf6a2df2af96dfbf91897d2f65845 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:38:55 +0530 Subject: [PATCH 11/13] Check the linting working by changing a yaml file Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .../cert-manager/cert-manager/base/cert-manager.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/cert-manager/cert-manager/base/cert-manager.yaml b/common/cert-manager/cert-manager/base/cert-manager.yaml index 3cbd60ba8..fbe330d61 100644 --- a/common/cert-manager/cert-manager/base/cert-manager.yaml +++ b/common/cert-manager/cert-manager/base/cert-manager.yaml @@ -22,12 +22,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: certificaterequests.cert-manager.io - labels: - app: 'cert-manager' - app.kubernetes.io/name: 'cert-manager' - app.kubernetes.io/instance: 'cert-manager' - # Generated labels - app.kubernetes.io/version: "v1.14.5" + labels: + app: 'cert-manager' + app.kubernetes.io/name: 'cert-manager' + app.kubernetes.io/instance: 'cert-manager' + # Generated labels + app.kubernetes.io/version: "v1.14.5" spec: group: cert-manager.io names: From 30a91c63d41bd49edec161d99603c417ea12f31f Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:49:47 +0530 Subject: [PATCH 12/13] Testing working of Bash linting Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- .../cert-manager/cert-manager/base/cert-manager.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/cert-manager/cert-manager/base/cert-manager.yaml b/common/cert-manager/cert-manager/base/cert-manager.yaml index fbe330d61..3cbd60ba8 100644 --- a/common/cert-manager/cert-manager/base/cert-manager.yaml +++ b/common/cert-manager/cert-manager/base/cert-manager.yaml @@ -22,12 +22,12 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: certificaterequests.cert-manager.io - labels: - app: 'cert-manager' - app.kubernetes.io/name: 'cert-manager' - app.kubernetes.io/instance: 'cert-manager' - # Generated labels - app.kubernetes.io/version: "v1.14.5" + labels: + app: 'cert-manager' + app.kubernetes.io/name: 'cert-manager' + app.kubernetes.io/instance: 'cert-manager' + # Generated labels + app.kubernetes.io/version: "v1.14.5" spec: group: cert-manager.io names: From 480b0ef9bece0e1c2a530b44694b879f4c9f39a1 Mon Sep 17 00:00:00 2001 From: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> Date: Mon, 22 Jul 2024 21:54:28 +0530 Subject: [PATCH 13/13] fix the mistake of changing unwanted file Signed-off-by: hansinikarunarathne <107214435+hansinikarunarathne@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b85df7d3..a94653e12 100644 --- a/README.md +++ b/README.md @@ -550,4 +550,4 @@ The Kubeflow security working group follows a responsible disclosure policy for - **Q:** What versions of Istio, Knative, Cert-Manager, Argo, ... are compatible with Kubeflow? \ **A:** Please refer to each individual component's documentation for a dependency compatibility range. For Istio, Knative, Dex, Cert-Manager and OIDC-AuthService, the versions in `common` are the ones we have validated. - **Q:** Can I use earlier version of Kustomize with Kubeflow manifests? - **A:** No, it is not supported anymore, although it might be possible with manual effort. + **A:** No, it is not supported anymore, although it might be possible with manual effort. \ No newline at end of file