Commit graph

1502 commits

Author SHA1 Message Date
afik.cohen
d399ab2fdb More PR feedback, bump openai version 2024-03-06 15:48:17 -08:00
RD
daea52ea3a
Merge branch 'main' into strictest-mypy-settings 2024-03-05 23:27:12 -08:00
renaud
5f526ef352 The type annotations must flow. 2024-03-05 22:56:10 -08:00
afik.cohen
4de98d94ca Parse isorted code to make sure it's valid 2024-03-05 19:40:03 -08:00
afik.cohen
30642de662 Parse optimized candidate into CST and pass CST instead of code strings through all postprocess pipeline functions 2024-03-05 19:29:33 -08:00
afik.cohen
f33df70996 Merge remote-tracking branch 'origin/afik/aiservice_dedup_sort_imports' into afik/aiservice_dedup_sort_imports 2024-03-05 17:45:31 -08:00
afik.cohen
c2369a56a8 Fix names 2024-03-05 17:45:27 -08:00
Afik
259ae2dc33
Merge branch 'main' into afik/aiservice_dedup_sort_imports 2024-03-05 17:01:13 -08:00
Afik
d5652dd1bc
Merge pull request #370 from codeflash-ai/afik/aiservice_fixes
Use UvicornWorker with lifespan='off' CF-180
2024-03-05 16:36:10 -08:00
afik.cohen
aed3f853ae Sort imports for generated tests too, also try adding some tests to test this, but spent an hour trying to get the django test runner to work and couldn't get it to find the tests, so punting for now 2024-03-05 16:33:50 -08:00
afik.cohen
07e24d3d57 Use isort to deduplicate and sort imports in generated candidates 2024-03-05 11:40:27 -08:00
RD
57a306241e
Merge branch 'main' into CF-181 2024-03-05 01:53:39 -08:00
renaud
61f0bf6873 Adding missing argument to format_code call in main. 2024-03-04 20:08:04 -08:00
ihitamandal
21facd2fc1 Resolve merge conflicts 2024-03-04 16:24:46 -08:00
Saurabh Misra
2a8816766c
Merge branch 'main' into seed-random-tests 2024-03-05 05:06:52 +05:30
afik.cohen
37dded13cd Use UvicornWorker with lifespan='off', because Django does not
(and probably will not https://code.djangoproject.com/ticket/31508)
    support Lifespan protocol.
2024-03-04 15:02:19 -08:00
Saurabh Misra
49d49b632d fix test 2024-03-04 15:42:15 +05:30
Saurabh Misra
10eff93d91 Minor cosmetic fix tests 2024-03-04 15:40:19 +05:30
Saurabh Misra
82c31fc1fa Seed correctly and add tests 2024-03-04 15:37:42 +05:30
Saurabh Misra
1dd43dd055 WIP changes to seed each test case to remove flakiness when generated test has randomness in it. 2024-03-04 04:04:52 +05:30
afik.cohen
21312cae74 Add sentry to aiservice 2024-02-29 17:55:12 -08:00
afik.cohen
51e1512ebf Standardize posthog logging and env variable usage 2024-02-29 17:29:17 -08:00
RD
9ad552e0af
Merge branch 'main' into CF-45 2024-02-28 17:25:03 -08:00
renaud
3408ef43f1 Fixed all the tests. All of them. 2024-02-28 10:44:12 -08:00
RD
b760e7b253
Merge branch 'main' into CF-45 2024-02-26 21:15:52 -08:00
ihitamandal
2ed7821fd4 Merge remote-tracking branch 'origin/main' into parametrized-tests 2024-02-26 14:19:06 -08:00
renaud
554bc091c4 Fixed all the tests. All of them. 2024-02-26 11:34:31 -08:00
renaud
38ebeb8558 Handling instrumentation for methods. 2024-02-26 01:49:17 -08:00
renaud
c6c7496070 Top level function instrumentation for input mutation. 2024-02-25 05:56:18 -08:00
Saurabh Misra
35c9f1999b
Merge branch 'main' into docstring-fix 2024-02-24 17:27:16 +05:30
Saurabh Misra
af6a04e4d9 update test name 2024-02-24 17:25:24 +05:30
Saurabh Misra
b77e52a5ca Improve docstring replacer 2024-02-24 17:19:08 +05:30
ihitamandal
ee4430616e Add instrumentation for generated tests 2024-02-23 16:01:50 -08:00
renaud
98cbc8e8cf Building most of the new instrumented test file. 2024-02-22 11:07:28 -08:00
renaud
30738647a5 Fixing imports 2024-02-22 03:16:53 -08:00
renaud
f09e2264e7 Django tests 2024-02-22 02:51:13 -08:00
Saurabh Misra
605098fa51 Fix docstring in optimized functions 2024-02-21 20:01:05 +05:30
renaud
724b24696c Test for current level of test instrumentation as baseline. 2024-02-21 06:24:23 -08:00
renaud
9fdd5d078a Fixing FunctionToOptimize definition bug. 2024-02-20 21:34:01 -08:00
renaud
edb74265a5 Fixing FunctionToOptimize definition bug. 2024-02-20 21:32:15 -08:00
Saurabh Misra
e8a84fd0f0 Clean up the explanation message 2024-02-14 13:57:57 -08:00
renaud
406b7c41f2 Cleaning up code, adding tests. 2024-02-13 05:52:22 -08:00
renaud
34ea691711 Postprocess checking for optimized code. 2024-02-12 20:21:26 -08:00
renaud
bc8a21051d Merge remote-tracking branch 'origin/main' into CF-96
# Conflicts:
#	cli/codeflash/result/create_pr.py
#	django/aiservice/testgen/instrumentation/edit_generated_test.py
#	django/aiservice/testgen/instrumentation/tests/test_edit_generated_test.py
2024-02-08 14:00:43 -08:00
afik.cohen
550bc807c1 Remove some empty generated files 2024-02-07 19:29:30 -08:00
afik.cohen
8a241f7520 Move authapp, optimizer and testgen into sister apps of aiservice 2024-02-07 18:52:15 -08:00
afik.cohen
d21e6257b8 Merge remote-tracking branch 'origin/main' into reorganize-aiservice 2024-02-07 18:27:20 -08:00
afik.cohen
d0edb7e83c Add dev to allowed hosts 2024-02-07 18:16:39 -08:00
afik.cohen
6e2944cc85 Try zip deployment 2024-02-06 20:00:32 -08:00
Saurabh Misra
63d3b73fec Fix Error responses with aiservice 2024-02-06 19:45:01 -08:00
afik.cohen
ed70bba518 Reorganize all siervice code into the aiservice package 2024-02-06 19:22:03 -08:00
renaud
c0f4d30c55 Clean up django code surgery utilities 2024-02-04 18:58:49 -08:00
renaud
7852560483 Generalizing parse tree editing to any named statement (function, class). 2024-02-02 11:23:03 -08:00
afik.cohen
75c223d522 Fix testgen and optimizer response schemas 2024-02-01 20:50:08 -08:00
afik.cohen
78093d7acf Merge remote-tracking branch 'origin/aiservice-fixes' into aiservice-fixes 2024-02-01 19:55:34 -08:00
afik.cohen
7e9415beb1 Bump openai version and use OPENAI_API_TYPE as the env var to decide between azure and openai 2024-02-01 19:55:29 -08:00
afik.cohen
a42d5a1d3d Merge remote-tracking branch 'origin/main' into aiservice-fixes 2024-02-01 19:54:04 -08:00
Saurabh Misra
31d66e78cc
Merge branch 'main' into aiservice-fixes 2024-02-01 19:35:54 -08:00
Saurabh Misra
e3bd9cfcf3 Merge remote-tracking branch 'origin/aiservice-fixes' into aiservice-fixes
# Conflicts:
#	django/aiservice/optimizer/optimizer.py
2024-02-01 19:34:03 -08:00
Saurabh Misra
ea8199fc52 Fix Optimizer Error Response Schema 2024-02-01 19:31:48 -08:00
afik.cohen
be13067ba4 Add more posthog logging for openai usages 2024-02-01 19:31:21 -08:00
Saurabh Misra
d5b717d229 fix 2024-02-01 18:34:01 -08:00
Saurabh Misra
d4db8b4442 will break everything 2024-02-01 18:32:56 -08:00
Saurabh Misra
378c5822d6 Remove unnecessary admin portal and middleware from django server 2024-02-01 18:26:44 -08:00
afik.cohen
e385cba5ce Hardcode posthog api key for aiservice 2024-02-01 18:01:51 -08:00
Afik
9a2c879aea
Merge pull request #206 from codeflash-ai/dependabot/pip/django/aiservice/uvicorn-tw-0.27.0
Update uvicorn requirement from ^0.25.0 to ^0.27.0 in /django/aiservice
2024-01-31 12:04:47 -08:00
dependabot[bot]
4da3166553
Update black requirement from ^23.3.0 to ^24.1.1 in /django/aiservice
Updates the requirements on [black](https://github.com/psf/black) to permit the latest version.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/23.3.0...24.1.1)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 19:38:41 +00:00
dependabot[bot]
2a001a652b
Update uvicorn requirement from ^0.25.0 to ^0.27.0 in /django/aiservice
Updates the requirements on [uvicorn](https://github.com/encode/uvicorn) to permit the latest version.
- [Release notes](https://github.com/encode/uvicorn/releases)
- [Changelog](https://github.com/encode/uvicorn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/uvicorn/compare/0.25.0...0.27.0.post1)

---
updated-dependencies:
- dependency-name: uvicorn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 19:38:00 +00:00
renaud
96cf7c78ca Made the prompt agnostic to the chosen testing library 2024-01-30 18:19:48 -08:00
renaud
e54b8db118 Edited prompt to forbid mocks or stubs during test generation 2024-01-30 12:26:32 -08:00
Saurabh Misra
c7eda167d5 Test generator should not mock things 2024-01-30 12:24:27 -08:00
Saurabh Misra
fba6246512
Merge branch 'main' into optimize-all-validation 2024-01-26 17:03:34 -08:00
renaud
0c203ae237 Move test_edit_generated_test to django/aiservice/injectperf_tests 2024-01-26 16:47:33 -08:00
afik.cohen
8286afd088 Merge remote-tracking branch 'origin/main' into optimize-all-validation 2024-01-26 16:36:03 -08:00
renaud
1b2c59d657 Remove the definition of the function to optimize from the generated test file, replacing it with a statement.
Some checks are pending
CodeFlash / Optimize new code in this PR (pull_request) Waiting to run
end-to-end-test / bubble-sort-optimization (pull_request) Waiting to run
unit-tests / unit-tests (3.10.13) (pull_request) Waiting to run
unit-tests / unit-tests (3.11.6) (pull_request) Waiting to run
unit-tests / unit-tests (3.12.1) (pull_request) Waiting to run
unit-tests / unit-tests (3.9.18) (pull_request) Waiting to run
2024-01-26 05:52:22 -08:00
Saurabh Misra
8d290b0f08 Merge remote-tracking branch 'origin/optimize-all-validation' into optimize-all-validation 2024-01-25 16:50:56 -08:00
Saurabh Misra
4df7e25561 Remove unnecessary django middlewares 2024-01-25 16:50:50 -08:00
afik.cohen
0f0e287a98 Add support for changing aiservice to azure vs openai via USE_AZURE_OPENAI_SERVICE env var, and add some printing to aiservice if it's not running in prod 2024-01-25 16:40:56 -08:00
Saurabh Misra
3443b4906b update the test-key format 2024-01-22 16:26:32 -08:00
afik.cohen
44a2eee85d Update usages of aimodels and use gpt-4-0613 azure deployment for optimizer 2024-01-19 11:42:27 -08:00
afik.cohen
4f5b14f320 Revert "Revert "Change openai usages to AzureOpenAI service and bump to v1.8.0 which fixes debugging under python3.12""
This reverts commit eff6be9b7b.
2024-01-19 11:28:56 -08:00
RD
38ad1f19e4
Merge pull request #107 from codeflash-ai/CF-59
Clean up generated test file (CF-59)
2024-01-17 06:17:34 -08:00
renaud
0f2857485d Remove the definition of the function to optimize from the generated test file, replacing it with an import. 2024-01-17 06:04:12 -08:00
Saurabh Misra
320ad2a470 Minor fix 2024-01-16 20:44:50 -08:00
Saurabh Misra
a3cd498f00 Remove all logging calls that could leak customer info 2024-01-16 20:42:41 -08:00
Saurabh Misra
bc706060e0 Remove all possible customer info from aiservice 2024-01-16 20:39:23 -08:00
Saurabh Misra
f05db78477 Remove Python 3.8 hacks. Also fix all the tests. 2024-01-13 22:18:18 -08:00
afik.cohen
7761039323 Use aget instead of get 2024-01-12 20:07:00 -08:00
afik.cohen
70d630c012 Use env var for posthog api key 2024-01-12 20:04:05 -08:00
afik.cohen
08bfae235f Add analytics to testgen endpoint 2024-01-12 19:44:44 -08:00
afik.cohen
d5b62a28b9 Implement Posthog and userid for apikey for aiservice, pass userid down to endpoints, add analytics to /optimize endpoint 2024-01-12 19:27:38 -08:00
afik.cohen
23d715d8ca Add some print statements to testgen 2024-01-12 16:28:41 -08:00
afik.cohen
e24a918f64 Del unused run tmp file from aiservice 2024-01-12 13:58:48 -08:00
Saurabh Misra
0226561190 Move the definition of the run_tmp_dir away from server side and into client side. 2024-01-11 20:36:05 -08:00
afik.cohen
91e65f3734 Fix bug merging generated tests instead of instrumented tests 2024-01-11 19:23:09 -08:00
afik.cohen
d858872ae1 Merge endpoints 2024-01-11 10:50:47 -08:00
afik.cohen
d2ed3f9e42 Close CF-46 Move the generated test instrumentation to backend as new endpoint /injectperf 2024-01-09 19:55:46 -08:00
Saurabh Misra
6e7514602a Remove the ast parse check for test gen 2024-01-04 22:28:54 -08:00
afik.cohen
0e036d8ef0 Add deploy script and update shebang 2024-01-03 19:08:58 -08:00
afik.cohen
656fbcdf48 Remove init from django folder 2024-01-02 17:25:12 -08:00
afik.cohen
7cd4ebbb16 Move aiservice to django/aiservice 2024-01-02 16:55:24 -08:00
afik.cohen
be0aa544e8 Move codeflash python code base to cli/ 2023-12-29 18:37:49 -08:00