{"id":14775079,"url":"https://github.com/test-prof/test-prof-aiptimize-action","last_synced_at":"2025-04-10T12:22:12.745Z","repository":{"id":257463966,"uuid":"844468792","full_name":"test-prof/test-prof-aiptimize-action","owner":"test-prof","description":"GitHub action to refactor Rails tests with TestProf and AI","archived":false,"fork":false,"pushed_at":"2025-02-13T18:01:09.000Z","size":10,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T11:08:42.841Z","etag":null,"topics":["github-action","peformance","rails","testing"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/test-prof.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-08-19T10:22:55.000Z","updated_at":"2025-02-13T18:01:12.000Z","dependencies_parsed_at":"2024-09-16T23:40:55.052Z","dependency_job_id":null,"html_url":"https://github.com/test-prof/test-prof-aiptimize-action","commit_stats":null,"previous_names":["test-prof/test-prof-aiptimize-action"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/test-prof%2Ftest-prof-aiptimize-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/test-prof%2Ftest-prof-aiptimize-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/test-prof%2Ftest-prof-aiptimize-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/test-prof%2Ftest-prof-aiptimize-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/test-prof","download_url":"https://codeload.github.com/test-prof/test-prof-aiptimize-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217115,"owners_count":21066633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["github-action","peformance","rails","testing"],"created_at":"2024-09-16T23:01:39.568Z","updated_at":"2025-04-10T12:22:12.719Z","avatar_url":"https://github.com/test-prof.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# TestProf AI GitHub Action\n\n\u003e 📖 Read also the [\"Dev tools AI‑fication 101: lessons from Martian robots\" blog post](https://evilmartians.com/chronicles/dev-tools-ai-fication-101-lessons-from-martian-robots).\n\nThis GitHub Action allows you to optimize Rails tests via [TestProf][] and [Claude AI][Claude].\n\nThe action performs the given test file profiling and refactors it to speed up the execution (using `let_it_be` and `before_all` helpers from TestProf). It opens a PR and shares the refactoring progress as it executes.\n\n## Requirements\n\n- **Configured testing environment**. This action runs your tests during the refactoring (to verify the correctness), so you must configure it as for regular tests.\n\n- **GitHub token permissions**. This action uses the default `GITHUB_TOKEN` provided by GitHub Actions. You must configure its permissions (Settings -\u003e Actions -\u003e Workflow permissions): enable \"Read and write permissions\" and \"Allow GitHub Actions to create and approve pull requests\".\n\n## Inputs\n\n- **api-key** (required): you API key to communicate with Claude API.\n- **issue-number**: GitHub issue number to read the task from (the issue must contain the path to the test file to refactor).\n- **test-file-path**: Path to test file to refactor. **IMPORTANT:** one of the `issue-number` or `test-file-path` must be specified.\n- **base-branch** (optional, default: main): Base Git branch to open a PR against.\n- **test-command** (optional, default: `bundle exec rspec`): Command to execute a test file.\n- **example-patch-path** (optional): Path to the example Git patch to use by AI's prompt.\n- **custom-prompt-path** (optional): Path to the custom AI prompt file.\n\n## Example\n\nWe suggest to use GitHub Issues to initiate refactoring tasks. Here is an example workflow:\n\n```yml\nname: TestProf AI\n\non:\n  issues:\n    types: [labeled]\n\njobs:\n  optimize:\n    # IMPORTANT: Only run this workflow for explicitly labeled issues\n    if: github.event.label.name == 'test-prof'\n    runs-on: ubuntu-latest\n\n    env:\n      RAILS_ENV: test\n      # ... here goes your environment setup\n\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - name: Prepare app\n        run: |\n          bundle exec rails db:test:prepare\n\n      - name: Run TestProf AI\n        uses: test-prof/test-prof-aiptimize-action@main\n        with:\n          api-key: ${{ secrets.CLAUDE_API_KEY }}\n          issue-number:  ${{ github.event.issue.number }}\n```\n\nHere is also an example [issue template](./ISSUE_TEMPLATE/test_prof.yml).\n\n[TestProf]: https://github.com/test-prof/test-prof\n[Claude]: https://claude.ai\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftest-prof%2Ftest-prof-aiptimize-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftest-prof%2Ftest-prof-aiptimize-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftest-prof%2Ftest-prof-aiptimize-action/lists"}