From 263b8981a6ea07308e0a74d7671397da5197b83d Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 13 Feb 2026 09:26:45 -0800 Subject: [PATCH 1/7] Update README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 93b0628..daa25a0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # test Test Repository for various GitHub actions + +# Github Actions tested on this repository +Here is a list of Github Actions tested on this repo: +- Code reviewer using [NRPs LLMs](https://nrp.ai/documentation/userdocs/ai/llm-managed/#api-access-to-llms-via-envoy-gateway): https://github.com/marketplace/actions/chatgpt-codereviewer \ No newline at end of file From a045987e181b2169e7bbedeab15bf32709216c1c Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 13 Feb 2026 09:35:16 -0800 Subject: [PATCH 2/7] Add api --- api/Dockerfile | 21 +++++++++++++++++++++ api/app.py | 6 ++++++ api/requirements.txt | 4 ++++ 3 files changed, 31 insertions(+) create mode 100644 api/Dockerfile create mode 100644 api/app.py create mode 100644 api/requirements.txt diff --git a/api/Dockerfile b/api/Dockerfile new file mode 100644 index 0000000..d959ac2 --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.9 + +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive apt install -y \ + git \ + htop \ + make \ + tzdata \ + vim \ + && \ + rm -rf /var/lib/apt/lists/* + +# set time zone +ENV TZ America/Los_Angeles +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +WORKDIR /api +COPY app.py app.py +COPY requirements.txt requirements.txt + +RUN pip install -r requirements.txt +CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8000", "app:app"] diff --git a/api/app.py b/api/app.py new file mode 100644 index 0000000..575cdb3 --- /dev/null +++ b/api/app.py @@ -0,0 +1,6 @@ + +from fastapi import FastAPI +app = FastAPI() +@app.get("/") +def root(): + return {"Hello": "World"} \ No newline at end of file diff --git a/api/requirements.txt b/api/requirements.txt new file mode 100644 index 0000000..1b63fdb --- /dev/null +++ b/api/requirements.txt @@ -0,0 +1,4 @@ +fastapi==0.71.0 +gunicorn==20.1.0 +requests==2.27.1 +uvicorn==0.16.0 \ No newline at end of file From 2d06d0a5d6f93549879028d0e99f0272d824c9b6 Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 13 Feb 2026 09:36:14 -0800 Subject: [PATCH 3/7] Turn off github models --- .github/workflows/cr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml index 9765723..c52e8bd 100644 --- a/.github/workflows/cr.yml +++ b/.github/workflows/cr.yml @@ -3,7 +3,7 @@ name: Code Review permissions: contents: read pull-requests: write - models: true # if you choose use github models, set this to be true + models: false # if you choose use github models, set this to be true on: pull_request: From 203ddd9b9ce6e6d85cb0ef71700824d85da3b754 Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 13 Feb 2026 09:38:53 -0800 Subject: [PATCH 4/7] Remove github models param --- .github/workflows/cr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml index c52e8bd..1eed3fc 100644 --- a/.github/workflows/cr.yml +++ b/.github/workflows/cr.yml @@ -3,7 +3,6 @@ name: Code Review permissions: contents: read pull-requests: write - models: false # if you choose use github models, set this to be true on: pull_request: From 56f169f5bdbc9364ba0e3de8a90ea5208532d7fb Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 13 Feb 2026 09:44:54 -0800 Subject: [PATCH 5/7] Update api to include more endpoints and better example --- api/app.py | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/api/app.py b/api/app.py index 575cdb3..36d3ee5 100644 --- a/api/app.py +++ b/api/app.py @@ -1,6 +1,70 @@ +from fastapi import FastAPI, HTTPException, Query +from pydantic import BaseModel, Field +from typing import List, Optional +from uuid import uuid4 + +app = FastAPI(title="Example Items API", version="1.0.0") + +class ItemBase(BaseModel): + name: str = Field(..., min_length=1, max_length=100) + description: Optional[str] = None + price: float = Field(..., gt=0) + in_stock: bool = True + +class ItemCreate(ItemBase): + pass + +class Item(ItemBase): + id: str + +items_db: dict[str, Item] = {} -from fastapi import FastAPI -app = FastAPI() @app.get("/") def root(): - return {"Hello": "World"} \ No newline at end of file + return {"message": "Welcome to the Items API"} + +@app.get("/health") +def health_check(): + return {"status": "ok"} + +@app.post("/items", response_model=Item, status_code=201) +def create_item(item: ItemCreate): + item_id = str(uuid4()) + new_item = Item(id=item_id, **item.dict()) + items_db[item_id] = new_item + return new_item + +@app.get("/items", response_model=List[Item]) +def list_items( + min_price: Optional[float] = Query(None, gt=0), + in_stock: Optional[bool] = None, +): + results = list(items_db.values()) + if min_price is not None: + results = [i for i in results if i.price >= min_price] + if in_stock is not None: + results = [i for i in results if i.in_stock == in_stock] + return results + +@app.get("/items/{item_id}", response_model=Item) +def get_item(item_id: str): + if item_id not in items_db: + raise HTTPException(status_code=404, detail="Item not found") + return items_db[item_id] + +@app.put("/items/{item_id}", response_model=Item) +def update_item(item_id: str, updated_item: ItemCreate): + if item_id not in items_db: + raise HTTPException(status_code=404, detail="Item not found") + + item = Item(id=item_id, **updated_item.dict()) + items_db[item_id] = item + return item + +@app.delete("/items/{item_id}", status_code=204) +def delete_item(item_id: str): + if item_id not in items_db: + raise HTTPException(status_code=404, detail="Item not found") + + del items_db[item_id] + return From 871d360288070da1b60eddaeac3f3677e26290ed Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 13 Feb 2026 11:30:56 -0800 Subject: [PATCH 6/7] Return item not found for more details of the error --- api/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app.py b/api/app.py index 36d3ee5..5a2da4f 100644 --- a/api/app.py +++ b/api/app.py @@ -64,7 +64,7 @@ def update_item(item_id: str, updated_item: ItemCreate): @app.delete("/items/{item_id}", status_code=204) def delete_item(item_id: str): if item_id not in items_db: - raise HTTPException(status_code=404, detail="Item not found") + raise HTTPException(status_code=404, detail=f"Item not found: {item_id}") del items_db[item_id] return From eca3ab3bf9c97ecd7b893c8e617af491bad0b660 Mon Sep 17 00:00:00 2001 From: iperezx Date: Fri, 13 Feb 2026 11:37:52 -0800 Subject: [PATCH 7/7] Bump up version for fast api --- api/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/requirements.txt b/api/requirements.txt index 1b63fdb..1cfeaa5 100644 --- a/api/requirements.txt +++ b/api/requirements.txt @@ -1,4 +1,4 @@ -fastapi==0.71.0 +fastapi==0.129.0 gunicorn==20.1.0 requests==2.27.1 uvicorn==0.16.0 \ No newline at end of file