diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..cfd5421d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,57 @@ + +name: Lint + +on: # yamllint disable-line rule:2 + push: null + pull_request: null + +permissions: { } + +jobs: + build: + name: Lint + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + - name: Super-linter + uses: super-linter/super-linter@v6 # x-release-please-version + env: + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + YAML_ON_ERROR_WARNING: true + VALIDATE_ALLCODEBASE: false + VALIDATE_SHELL_SMFT: false + VALIDATE_CHECKOV: false + VALIDATE_BASH: false + VALIDATE_BASH_EXEC: false + VALIDATE_CSS: false + VALIDATE_GOOGLE_JAVA_FORMAT: false + VALIDATE_JAVA: false + VALIDATE_JAVASCRIPT_STANDARD: false + VALIDATE_JSCPD: false + VALIDATE_KUBERNETES_KUBECONFORM: false + VALIDATE_MARKDOWN: false + VALIDATE_NATURAL_LANGUAGE: false + VALIDATE_PYTHON_BLACK: false + VALIDATE_PYTHON_PYLINT: false + VALIDATE_FLAKE8: false + VALIDATE_ISORT: false + VALIDATE_PYTHON_RUFF: false + VALIDATE_SHELL_SHFMT: false + VALIDATE_TERRAFORM_FMT: false + VALIDATE_TERRAFORM_TFLINT: false + VALIDATE_YAML: false + BASH_SEVERITY: error diff --git a/MtdrSpring/backend/src/main/frontend/src/index.css b/MtdrSpring/backend/src/main/frontend/src/index.css index 04e76843..77f4339c 100644 --- a/MtdrSpring/backend/src/main/frontend/src/index.css +++ b/MtdrSpring/backend/src/main/frontend/src/index.css @@ -9,8 +9,8 @@ body { background-color: #3A3632; /* Set the background color */ width: 100%; color: #FEF9F2; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, + Ubuntu, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -19,7 +19,7 @@ body { align-items: center; } -.App { +.app { background: #201E1C; /* Background color for the app */ color: #FEF9F2; display: flex; @@ -29,7 +29,7 @@ body { margin: 1em auto; /* Center the .App container vertically and horizontally */ padding: 1rem; position: relative; - box-shadow: 0 10px 18px 0 rgba(0, 0, 0, 0.2), 0 4.5rem 8rem 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 10px 18px 0 #0003, 0 4.5rem 8rem 0 #0000001a; border-radius: 0.5rem; width: 100%; /* Full width */ max-width: 50rem; /* Max width, adjust as needed */ @@ -59,7 +59,7 @@ div#newinputform form { margin: 0 auto; } -table#itemlistNotDone, table#itemlistDone { +table#itemlist-not-done, table#itemlist-done { margin-bottom: 2rem; /* Uniform bottom margin for tables */ } @@ -95,12 +95,12 @@ input, button, input[type="text"] { padding-left: 10px; } -button.AddButton, button.DeleteButton, button.DoneButton { +button.add-button, button.delete-button, button.done-button { font-size: max(8px, min(2vw, 12px)); padding: 1.5em 0.5em; background-color: #5F7D4F; /* Primary button background color */ } -button.AddButton:hover, button.DeleteButton:hover, button.DoneButton:hover { +button.add-button:hover, button.delete-button:hover, button.done-button:hover { background-color: #6F915D; /* Hover color for buttons */ } diff --git a/MtdrSpring/backend/undeploy.sh b/MtdrSpring/backend/undeploy.sh deleted file mode 100644 index ccddf385..00000000 --- a/MtdrSpring/backend/undeploy.sh +++ /dev/null @@ -1,3 +0,0 @@ -echo delete frontend deployment and service... -kubectl -n mtdrworkshop delete deployment todolistapp-springboot-deployment -kubectl -n mtdrworkshop delete service todolistapp-springboot-service \ No newline at end of file diff --git a/MtdrSpring/env.sh b/MtdrSpring/env.sh deleted file mode 100644 index 2d03c03b..00000000 --- a/MtdrSpring/env.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# Copyright (c) 2022 Oracle and/or its affiliates. -# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. - -# Make sure this is run via source or . -if ! (return 0 2>/dev/null); then - echo "ERROR: Usage 'source env.sh'" - exit -fi - -# POSIX compliant find and replace -function sed_i(){ - local OP="$1" - local FILE="$2" - sed -e "$OP" "$FILE" >"/tmp/$FILE" - mv -- "/tmp/$FILE" "$FILE" -} -export -f sed_i - - -#set mtdrworkshop_location -export MTDRWORKSHOP_LOCATION="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -cd $MTDRWORKSHOP_LOCATION -echo "MTDRWORKSHOP_LOCATION: $MTDRWORKSHOP_LOCATION" - - -# Java Home -# -d true if file is a directory, so it's testing if this directory exists, if it does -# we are on Mac doing local dev -if test -d ~/graalvm-ce-java11-20.1.0/Contents/Home/bin; then - # We are on Mac doing local dev - export JAVA_HOME=~/graalvm-ce-java11-20.1.0/Contents/Home; -else - # Assume linux - export JAVA_HOME=~/graalvm-ce-java11-20.1.0 -fi -export PATH=$JAVA_HOME/bin:$PATH - -#state directory -if test -d ~/mtdrworkshop-state; then - export MTDRWORKSHOP_STATE_HOME=~/mtdrworkshop-state -else - export MTDRWORKSHOP_STATE_HOME=$MTDRWORKSHOP_LOCATION -fi -echo "MTDRWORKSOP_STATE_HOME: $MTDRWORKSHOP_STATE_HOME" -#Log Directory -export MTDRWORKSHOP_LOG=$MTDRWORKSHOP_STATE_HOME/log -mkdir -p $MTDRWORKSHOP_LOG - -source $MTDRWORKSHOP_LOCATION/utils/state-functions.sh - -# SHORTCUT ALIASES AND UTILS... -alias k='kubectl' -alias kt='kubectl --insecure-skip-tls-verify' -alias pods='kubectl get po --all-namespaces' -alias services='kubectl get services --all-namespaces' -alias gateways='kubectl get gateways --all-namespaces' -alias secrets='kubectl get secrets --all-namespaces' -alias ingresssecret='kubectl get secrets --all-namespaces | grep istio-ingressgateway-certs' -alias virtualservices='kubectl get virtualservices --all-namespaces' -alias deployments='kubectl get deployments --all-namespaces' -alias mtdrworkshop='echo deployments... ; deployments|grep mtdrworkshop ; echo pods... ; pods|grep mtdrworkshop ; echo services... ; services | grep mtdrworkshop ; echo secrets... ; secrets|grep mtdrworkshop ; echo "other shortcut commands... most can take partial podname as argument, such as [logpod front] or [deletepod order]... pods services secrets deployments " ; ls $MTDRWORKSHOP_LOCATION/utils/' - -export PATH=$PATH:$MTDRWORKSHOP_LOCATION/utils/ diff --git a/MtdrSpring/utils/python-scripts/generate-unique-key.py b/MtdrSpring/utils/python-scripts/generate_unique_key.py similarity index 85% rename from MtdrSpring/utils/python-scripts/generate-unique-key.py rename to MtdrSpring/utils/python-scripts/generate_unique_key.py index 47678b95..0a029a01 100644 --- a/MtdrSpring/utils/python-scripts/generate-unique-key.py +++ b/MtdrSpring/utils/python-scripts/generate_unique_key.py @@ -1,11 +1,12 @@ import random import string + def get_random_key(length): letters = string.ascii_lowercase digits = string.digits - length = length result_str = ''.join(random.choice(letters + digits) for i in range(length)) print(result_str) -get_random_key(5) \ No newline at end of file + +get_random_key(5) diff --git a/MtdrSpring/utils/python-scripts/process-cluster-ocid-json.py b/MtdrSpring/utils/python-scripts/process_cluster_ocid_json.py similarity index 84% rename from MtdrSpring/utils/python-scripts/process-cluster-ocid-json.py rename to MtdrSpring/utils/python-scripts/process_cluster_ocid_json.py index 19c64185..b7e7d566 100644 --- a/MtdrSpring/utils/python-scripts/process-cluster-ocid-json.py +++ b/MtdrSpring/utils/python-scripts/process_cluster_ocid_json.py @@ -1,5 +1,5 @@ -import sys import json +import sys # This simple python file reads JSON and tries to access the lab_oke_cluster_id value # and prints the OCID for processing. The JSON is expected @@ -10,9 +10,9 @@ try: OCID = system_input["lab_oke_cluster_id"]["value"] print(OCID) -except KeyError as e: +except KeyError: print("Error: Failed to access expected JSON key lab_oke_cluster_id or value") -except json.decoder.JSONDecodeError as e: +except json.decoder.JSONDecodeError: print("Error: Failed to decode JSON") -except Exception as e: +except Exception: print("Error: Encountered unexpected error")