Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harjot hackathon #38

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
310 changes: 310 additions & 0 deletions .github/workflows/lol-hackathoon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
name: MASSIVE Restart temp-fe Deployment on Staging

on:
workflow_dispatch:
push:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

⚠️ CRITICAL: This workflow could cause severe disruption.

This workflow is configured to run on every push and manually, spawning up to 100 parallel jobs that are designed to fail. This could:

  1. Quickly exhaust your GitHub Actions minutes quota
  2. Flood your CI/CD pipeline with failed jobs
  3. Trigger unnecessary Kubernetes operations

Recommendations:

  1. Remove this workflow file entirely
  2. If legitimate testing is needed, create a proper test workflow that:
    • Runs only on specific branches or manual triggers
    • Uses a reasonable number of jobs
    • Has meaningful test cases
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 3-3: truthy value should be one of [false, true]

(truthy)

jobs:
# ---------------------------------------------------------------------------
# 1) Copy the block below (the "restart-deployment" job),
# 2) Rename each job uniquely (job1, job2, job3, ... job100),
# 3) Paste for as many times as you want to run it (100 times shown here).
# ---------------------------------------------------------------------------

job1:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1

Check warning on line 21 in .github/workflows/lol-hackathoon.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/lol-hackathoon.yml#L21

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
version: 'v1.20.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update the outdated GitHub Actions runner version.

The workflow uses an outdated version of actions/checkout@v2.

-        uses: actions/checkout@v2
+        uses: actions/checkout@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
🧰 Tools
🪛 actionlint (1.7.4)

18-18: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job1..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job1 iteration: $i"
done
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

⚠️ Potential issue

Remove unauthorized workflow file

The lol-hackathoon.yml workflow appears to be an unauthorized addition that attempts to access Kubernetes credentials without performing legitimate operations. While the KUBECONFIG_STAGING secret is used legitimately in staging-cd.yml for deployment purposes, this workflow only sets up kubectl access and fails intentionally.

  • Remove the entire .github/workflows/lol-hackathoon.yml file
  • Keep the KUBECONFIG_STAGING secret as it's properly used in the staging CD workflow
🔗 Analysis chain

Remove unauthorized Kubernetes access attempt.

The workflow sets up kubectl and attempts to use KUBECONFIG_STAGING secret without proper authorization or documentation.

Let's verify if this secret is being used elsewhere legitimately:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for legitimate uses of KUBECONFIG_STAGING
rg -l "KUBECONFIG_STAGING"

Length of output: 26


Script:

#!/bin/bash
# Search for kubectl setup in workflows
rg -l "setup-kubectl" .github/
# Search for other kubernetes-related configurations
rg -l "kubectl|kubernetes|k8s" .github/
# List all workflow files to check for legitimate CI/CD
fd "\.ya?ml$" .github/workflows/

Length of output: 453


Script:

#!/bin/bash
# Check the content of legitimate-looking workflows
echo "=== staging-cd.yml ==="
cat .github/workflows/staging-cd.yml
echo -e "\n=== docker-build.yml ==="
cat .github/workflows/docker-build.yml

Length of output: 2751

🧰 Tools
🪛 actionlint (1.7.4)

28-28: shellcheck reported issue in this script: SC2317:info:6:1: Command appears to be unreachable. Check usage (or ignore if invoked indirectly)

(shellcheck)

echo "Finishing massive text output for job1..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove intentional job failure.

The job contains an exit 1 command that forces it to fail, which appears to be intentionally disruptive.

-                    exit 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job1..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job1 iteration: $i"
done
exit 1
echo "Finishing massive text output for job1..."
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job1..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job1 iteration: $i"
done
echo "Finishing massive text output for job1..."
🧰 Tools
🪛 actionlint (1.7.4)

28-28: shellcheck reported issue in this script: SC2317:info:6:1: Command appears to be unreachable. Check usage (or ignore if invoked indirectly)

(shellcheck)


job2:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'

- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job2..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job2 iteration: $i"
done
exit 1
echo "Finishing massive text output for job2..."

job3:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'

- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job3..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job3 iteration: $i"
done
exit 1
echo "Finishing massive text output for job3..."

job4:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'

- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job4..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job4 iteration: $i"
done
exit 1
echo "Finishing massive text output for job4..."

job5:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'

- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job5..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job5 iteration: $i"
done
exit 1
echo "Finishing massive text output for job5..."

job6:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'

- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job6..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job6 iteration: $i"
done
exit 1
echo "Finishing massive text output for job6..."

job7:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job7..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job7 iteration: $i"
done
exit 1
echo "Finishing massive text output for job7..."

job8:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job8..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job8 iteration: $i"
done
exit 1
echo "Finishing massive text output for job8..."

job9:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job9..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job9 iteration: $i"
done
exit 1
echo "Finishing massive text output for job9..."

job10:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
echo "Starting massive text output for job10..."
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job10 iteration: $i"
done
exit 1
echo "Finishing massive text output for job10..."

# ---------------------------------------------------------------------------
# Continue adding jobs until you reach 100 total (or more). Below is
# a quick block copy for demonstration. Just keep duplicating and
# changing the job name (job11, job12, job13...) until job100.
# ---------------------------------------------------------------------------

job11:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job11 iteration: $i"
done
exit 1

job12:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job12 iteration: $i"
done
exit 1
exit 1

job13:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job13 iteration: $i"
done
exit 1
exit 1

# ... Repeat all the way up to ...
#
job100:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.20.0'
- name: Configure Kubeconfig
env:
KUBECONFIG_STAGING: ${{ secrets.KUBECONFIG_STAGING }}
run: |
for ((i=1; i<=20; i++)); do
echo "lol hackathon – job100 iteration: $i"
done
exit 1
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from routes.wow import wow_bp
from utils.security import add_security_headers, return_safe_html

lol hackathon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove non-functional code that causes syntax errors.

The added line "lol hackathon" serves no purpose and causes syntax errors. This line should be removed.

-lol hackathon
🧰 Tools
🪛 Ruff (0.8.2)

23-23: SyntaxError: Simple statements must be separated by newlines or semicolons

🪛 GitHub Actions: Linters

[error] 23-23: Black formatting failed: Cannot parse code at line 23, column 4 due to syntax error


# Enable Datadog tracing
patch_all()
profiler = Profiler()
Expand Down
Loading