{"id":31727233,"url":"https://github.com/iris-ting/ai-in-action","last_synced_at":"2026-04-13T01:33:33.126Z","repository":{"id":316646515,"uuid":"1003848860","full_name":"iris-ting/ai-in-action","owner":"iris-ting","description":"CI/CD - Automatically generate test scripts by Vertex AI","archived":false,"fork":false,"pushed_at":"2025-09-25T20:14:38.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T01:32:50.371Z","etag":null,"topics":["ci-cd","gitlab","llm","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iris-ting.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-17T19:00:16.000Z","updated_at":"2025-12-15T23:26:21.000Z","dependencies_parsed_at":"2025-09-25T22:28:20.937Z","dependency_job_id":"bc855ad6-a81a-4c82-b207-02098630d482","html_url":"https://github.com/iris-ting/ai-in-action","commit_stats":null,"previous_names":["iris-ting/ai-in-action"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iris-ting/ai-in-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-ting%2Fai-in-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-ting%2Fai-in-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-ting%2Fai-in-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-ting%2Fai-in-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iris-ting","download_url":"https://codeload.github.com/iris-ting/ai-in-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iris-ting%2Fai-in-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31736723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T22:19:12.206Z","status":"ssl_error","status_checked_at":"2026-04-12T22:18:33.088Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-cd","gitlab","llm","yaml"],"created_at":"2025-10-09T06:19:28.774Z","updated_at":"2026-04-13T01:33:33.118Z","avatar_url":"https://github.com/iris-ting.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Inspiration\n\nModern software testing is time-consuming, and writing good test cases often falls behind rapid development cycles. We were inspired to leverage AI to **automatically generate high-quality test cases** based on user code commits — helping developers move faster while maintaining code integrity. Our goal was to build a **seamless, CI-integrated AI test assistant** that generates, validates, and logs test scripts based on real-time code changes.\n\n---\n\n## What It Does\n\n**Gen Test** is an AI-powered test generation system that:\n\n- Provides a **web interface** for user login via Firebase\n- Tracks **code changes in GitLab** through `.gitlab-ci.yml`\n- Automatically sends modified code files to **Vertex AI (Gemini)** for test generation\n- Validates the AI-generated test code and stores metadata in **Firestore**\n- Displays test results and code output in the **frontend dashboard**\n\n---\n\n## How We Built It\n\n- **Frontend**: A simple web UI that handles user login (via Firebase) and shows test results stored in Firestore.\n- **Backend**: A Flask microservice deployed on **Google App Engine** that:\n  - Sends customized prompts to **Vertex AI (Gemini)** to generate test scripts\n  - Validates returned code with Python AST parsing\n  - Stores results (including success flag and test script) in **Firestore**\n- **CI/CD Integration**:\n  - `.gitlab-ci.yml` runs `get_difference.py` to identify modified Python files\n  - Modified files are sent to our Flask endpoint for test generation and validation\n- **Database**: **Firestore** stores each test record with metadata including:\n  - Filename\n  - Test code\n  - Validation status\n  - User role\n  - Test Focus\n  - Test Environment\n  - Timestamp\n\n---\n\n## Challenges We Ran Into\n\n- Stabilizing interactions with **Vertex AI**, particularly with respect to prompt formatting and auth\n- Implementing **custom user metadata and access control** via Firebase and Firestore\n- Configuring **GitLab CI/CD pipelines** to trigger our service smoothly\n- Ensuring that generated test code was **not only valid Python, but semantically correct and runnable**\n- Designing a prompt system that could dynamically adapt to user-specific strategies like \"edge case coverage\" or \"robust input validation\"\n\n\n---\n\n## Accomplishments That We're Proud Of\n\n- A fully functional **end-to-end pipeline** from code commit to validated test generation and web display\n- Seamless integration between **GitLab, Vertex AI, Firebase**, and Flask\n- Custom prompts that adapt to **user roles** and other metadata\n- 100% of test scripts from AI passed syntax and unittest-style validation\n\n---\n\n## What We Learned\n\n- Prompt engineering is critical — phrasing impacts AI behavior significantly\n- Vertex AI’s Gemini models are reliable for generating structured Python code, given the right context\n- CI/CD workflows can become **AI-enhanced** with minimal effort when done right\n- Firebase + Firestore are perfect for combining real-time updates with document-based querying\n\n---\n\n## What's Next for AI in Action\n\n- Add support for **multi-language test generation** (e.g., JavaScript, Java, Go)\n- Allow users to define **test strategies** like boundary testing, fuzzing, or contract-based tests\n- Track prompt effectiveness using **validation feedback loops**\n- Package our system as a **DevOps-ready open-source toolkit**\n- Expand compatibility beyond GitLab (e.g., GitHub Actions, Bitbucket Pipelines)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firis-ting%2Fai-in-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firis-ting%2Fai-in-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firis-ting%2Fai-in-action/lists"}