Not every project needs to be a platform. Sometimes the most useful thing is a small service you can read in five minutes, containerise in ten, and use to practise the whole path from code to Kubernetes. This is one of those.

The GitHub Code Analyzer & DevOps Assistant takes a public GitHub repository URL. It pulls the repo’s metadata from the GitHub REST API and returns a short list of DevOps recommendations.

Repo: github.com/Willey2003/my-project

What it does

The whole service is one file, app.py, with three endpoints:

Method Path Purpose
GET /health Liveness check
GET /ready Readiness check (static response for now)
POST /analyze Analyse a repo: {"repo_url": "https://github.com/owner/repo"}

/analyze returns the repo’s name, description, primary language, star count and open-issue count, plus a devops_recommendations list. The rules are deliberately simple:

  • Python repos get a reminder to include requirements.txt or pyproject.toml, and a suggested slim base image.
  • More than 50 open issues triggers a suggestion to automate issue triage with GitHub Actions. (GitHub’s open-issue count includes pull requests.)
  • No GitHub Actions workflows triggers a suggestion to add CI. The service checks this live against the repository’s workflows endpoint. If that call fails or hits a rate limit, it skips the recommendation rather than give misleading advice.

Run it

git clone https://github.com/Willey2003/my-project.git && cd my-project pip install -r requirements.txt python app.py # listens on port 8080; override with PORT curl -X POST localhost:8080/analyze -H "Content-Type: application/json" \ -d '{"repo_url":"https://github.com/octocat/Hello-World"}' 

Calls to the GitHub API are unauthenticated, so the usual anonymous rate limit applies.

The DevOps parts

The application is small on purpose. What I was really practising is everything around it:

  • Dockerfile: python:3.11-slim base, running as a non-root user (UID 1000).
  • Kubernetes manifest (devops-assistant.yaml): a dedicated namespace, two replicas with a rolling-update strategy, liveness and readiness probes, CPU and memory requests and limits, a read-only root filesystem, no privilege escalation, all capabilities dropped, and a ClusterIP Service.
  • CI: GitHub Actions runs six pytest tests on every push. They cover the health endpoints, URL parsing and input validation, using FastAPI’s TestClient, with no network calls.

Planned next: a CD pipeline that builds and pushes the image and triggers a rollout restart (a draft sits in the repo but is not enabled yet), a GitHub token to lift the rate limit, a real dependency check behind /ready, and more recommendation rules beyond Python.

Get it

The code is at github.com/Willey2003/my-project. If you are learning to take a service from a single Python file to a hardened Kubernetes deployment, this is a small, complete example to fork and extend.