Skip to content

Mohammed A#5

Open
mohammedalfakih-dev wants to merge 4 commits into
HackYourAssignment:mainfrom
mohammedalfakih-dev:week5/mohammed-alfakih
Open

Mohammed A#5
mohammedalfakih-dev wants to merge 4 commits into
HackYourAssignment:mainfrom
mohammedalfakih-dev:week5/mohammed-alfakih

Conversation

@mohammedalfakih-dev

Copy link
Copy Markdown

Summary

  • Containerized the Week 4 Pandas transformation pipeline
  • Added environment variable based configuration
  • Added unit tests for pipeline functions
  • Added Ruff linting and formatting checks
  • Created Docker image for the pipeline
  • Added GitHub Actions workflow for testing, building, and pushing the image
  • Configured Azure authentication using environment variables

@github-actions

This comment has been minimized.

@mohammedalfakih-dev mohammedalfakih-dev changed the title Containerize week 4 pipeline with Docker, CI and tests Mohammed A Jun 2, 2026
@github-actions

This comment has been minimized.

GitHub withholds AZURE_CREDENTIALS from pull_request runs that originate
from a fork (security default), which made the Azure login step fail with
"client-id and tenant-id are supplied". Guarding the Azure login, ACR
login, and image push with `if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.fork == false` skips them on fork PRs
so CI stays green, while still running them on pushes to main and on
PRs opened inside the assignment repo itself.

The Task 7 ACR-push deliverable (assets/acr_push_week5.png) is unaffected
since it is produced from a local push, not from CI.
@github-actions

This comment has been minimized.

@lassebenni lassebenni closed this Jun 3, 2026
@lassebenni lassebenni reopened this Jun 3, 2026
@github-actions

This comment has been minimized.

@lassebenni lassebenni closed this Jun 3, 2026
@lassebenni lassebenni reopened this Jun 3, 2026
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Image pushed to ACR

hyfregistry.azurecr.io/mohammedalfakih-dev-pipeline:8aec1d7868f30df8bfbd4f7355c3c0f2b999c1f0

Browse the registry in the Azure Portal: https://portal.azure.com/#@hackyourfuture.nl/resource/subscriptions/1120c89d-2a5f-4a15-a582-2ea34f0bb5c3/resourceGroups/rg-hyf-data/providers/Microsoft.ContainerRegistry/registries/hyfregistry/repository

Task 7 verification: your Dockerfile built and pushed cleanly from commit 8aec1d7.

@HackYourAssignment HackYourAssignment deleted a comment from github-actions Bot Jun 3, 2026
…-week-5 into week5/mohammed-alfakih

# Conflicts:
#	.github/workflows/ci.yml
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

📝 HackYourFuture auto grade

Assignment Score: 100 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 60
🧪 The auto grade is experimental and still being improved

Test Details

=== Week 5 Autograder ===
  PASS: Level 1: required files (15/15 pts)
  PASS: Dockerfile uses python:3.11-slim base image
  PASS: Dockerfile copies requirements before source (cache-friendly)
  PASS: Dockerfile has a CMD instruction
  PASS: Level 2: Dockerfile (15/15 pts)
  PASS: tests/test_pipeline.py has 5 test functions (≥2 required)
  PASS: tests/test_pipeline.py has no NotImplementedError stubs remaining
  PASS: Level 3: unit tests (10/10 pts)
  PASS: requirements.txt has 7 pinned package(s)
  PASS: requirements.txt pins satisfied (no uv.lock needed)
  PASS: Level 4: pinned dependencies (10/10 pts)
  PASS: ci.yml triggers on pull_request
  PASS: ci.yml triggers on push to main
  PASS: ci.yml runs ruff check (lint)
  PASS: ci.yml runs ruff format (format check)
  PASS: ci.yml runs pytest
  PASS: ci.yml runs docker build
  PASS: Level 5: CI workflow (20/20 pts)
  PASS: pipeline.py reads config from os.environ/os.getenv
  PASS: pipeline.py has no NotImplementedError stubs remaining
  PASS: Level 6: env-var config (15/15 pts)
  PASS: assets/acr_push_week5.png present and non-trivial (268310 bytes)
  PASS: Level 7: ACR screenshot (10/10 pts)
  PASS: AI_ASSIST.md has all three required sections
  PASS: AI_ASSIST.md is filled in (1124 chars, no TODO placeholders)
  PASS: Level 8: AI report (5/5 pts)
  PASS: .gitignore correctly excludes __pycache__/, *.pyc, and .env

Score: 100 / 100  (passing: 60)  pass=true

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Image pushed to ACR

hyfregistry.azurecr.io/mohammedalfakih-dev-pipeline:122d8811feca26dac32ce799b8439009d8a4aab5

Browse the registry in the Azure Portal: https://portal.azure.com/#@hackyourfuture.nl/resource/subscriptions/1120c89d-2a5f-4a15-a582-2ea34f0bb5c3/resourceGroups/rg-hyf-data/providers/Microsoft.ContainerRegistry/registries/hyfregistry/repository

Task 7 verification: your Dockerfile built and pushed cleanly from commit 122d881.

@AgneseGi AgneseGi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Technically strong, but less aligned with the Week 5 starter. The pipeline now requires GITHUB_USERNAME instead of the expected API_KEY, so the README Docker command would fail. It also depends on Azure/data access by default, which makes the container less reproducible.

Comment thread src/pipeline.py
def get_config() -> dict:
"""
Return configuration read from environment variables.
github_username = os.getenv("GITHUB_USERNAME")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This changes the assignment contract from API_KEY to GITHUB_USERNAME. The Week 5 starter and README expect the container to run with something like docker run --rm -e API_KEY=test ..., but this implementation would fail unless GITHUB_USERNAME is provided

Comment thread src/pipeline.py
raise NotImplementedError("Task 1: return at least one sample record")
logger.info("Starting Week 4 Pandas pipeline")

download_inputs(data_dir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Calling download_inputs() unconditionally means the container depends on Azure access by default. For this assignment, the pipeline should be easy to run in a container with simple environment config. You could eg make the Azure download optional or supporting local/sample input data for reproducible Docker runs

Comment thread AI_ASSIST.md
<!-- Paste the exact prompt you gave to an LLM (ChatGPT, Claude, Copilot, etc.). -->

TODO: paste your prompt here.
<!-- After building the Docker image successfully, I received authentication errors when running the container. The pipeline worked locally, but inside Docker Azure authentication failed with DefaultAzureCredential. why Docker could not access the Azure data -->

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This answer is still inside an HTML comment, so it is hidden in rendered Markdown

Comment thread AI_ASSIST.md
ChatGPT first suggested using local sample CSV files instead of downloading data from Azure Blob Storage.

```python
# TODO: paste the AI-generated code here

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is still a TODO placeholder inside the code block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants