Commit graph

20 commits

Author SHA1 Message Date
Kevin Turcios
927cc99588
fix: correct regexes for removing empty benchmark sections in PR comments (#2495)
## Summary

- Fix regexes in `buildBenchmarkInfo` that strip empty improved/degraded
benchmark sections from PR comments
- The regexes didn't match the actual template text: wrong heading level
(`####` vs `###`), wrong emoji (`📉` vs `️`), and wrong wording —
causing `{benchmark_info_degraded}` to render literally when there are
no degraded benchmarks
- Add unit tests for improved-only, degraded-only, and empty benchmark
scenarios

## Test plan

- [x] All 33 tests in `pr-changes-utils.test.ts` pass
- [x] New tests verify template placeholders are fully removed when a
section is empty
2026-03-27 17:12:35 -05:00
HeshamHM28
e28d968fad
[CHORE] add trace_id to the pull request description comment (#2190)
Fixes cf-975
output:
https://github.com/HeshamHM28/my-best-repo/pull/15
2026-01-06 00:15:48 +00:00
Aseem Saxena
6f25848185
Add optimization review badge to dependent pr comment and pr comment body (#1938)
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2025-10-29 00:22:41 -07:00
Aseem Saxena
184bffbd8f
Feat/add optimization review details (#1910)
Co-authored-by: HeshamHM28 <HeshamMohamedFathy@outlook.com>
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2025-10-21 22:06:12 -07:00
Aseem Saxena
2082998386
Different UX for Optimization Impact (#1886)
At the moment, show it only for single hunk existing PR comments.
Changes made in a way to ensure ease in adding for new PRs too. Details
of optimization hidden from user at the moment.

---------

Co-authored-by: HeshamHM28 <HeshamMohamedFathy@outlook.com>
2025-10-14 17:43:07 -07:00
Sarthak Agarwal
c1148b93ae
change messaging font size for github dependant PR (#1802) 2025-09-11 20:09:12 +05:30
aseembits93
ee0e6829d8 almost there, some more tests to be fixed 2025-08-11 13:23:03 -07:00
Sarthak Agarwal
7da78da953
Invisible Meta data for Verify Optimization (#1714)
Adding : ```<!-- CODEFLASH_OPTIMIZATION:
{"function":"sorter","file":"cli/code_to_optimize/bubble_sort.py","speedup_pct":"30,125%","speedup_x":"301.25x","original_runtime":"9.03
seconds","best_runtime":"29.9
milliseconds","optimization_type":"algorithm","timestamp":"2025-07-23T08:59:04.218Z","version":"1.0"}
-->```
as metadata so that we can change github msgs without breaking verify
optimization regex.

Example: https://github.com/codeflash-ai/my-best-repo/pull/334
https://github.com/Saga4/my-best-repo/pull/7#discussion_r2224744802
2025-07-23 19:05:05 +05:30
Aseem Saxena
4916535aee
Edit prcomment (#1662)
Minor edits to the PR comment

---------

Co-authored-by: Saurabh Misra <misra.saurabh1@gmail.com>
2025-06-18 10:26:41 +05:30
HeshamHM28
602e08d164
Explanation and Details Section Collapsed for Inline Suggestions (#1598)
Made the inline suggestion collapsed in the PR comments
[Collapsed](https://github.com/Saga4/my-best-repo/pull/7) check the
comment
[Expanded](https://github.com/Saga4/my-best-repo/pull/8)

---------

Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2025-06-05 21:16:25 +00:00
Saurabh Misra
11ce0a3153
secure verify-existing-optimizations end point and remove the try catch logic (#1617)
Co-authored-by: Saga4 <sarthak.saga@gmail.com>
2025-05-31 04:45:18 +05:30
Sarthak Agarwal
d4067ca363
Approval flow with slack interface (#1600)
Ongoing Testing:
https://codeflash-ai.slack.com/archives/C07M7RMH6G6/p1747448113126809
2025-05-19 16:30:18 +05:30
davidgirdwood1
d399b07b7e
Hide percentage when it's over 1000 and just show the (x) muliplier number (#1488)
### **User description**
Passing 'speedup_x' through, and using that instead of percentage. (when
percentage is over 1000)


___

### **PR Type**
- Enhancement



___

### **Description**
- Added new parameter `speedup_x` to PR title builders.

- Modified functions to display multiplier when percentage exceeds 1000.

- Updated dependent PR title calls with additional arguments.

- Adjusted tests to verify new title logic.


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>create-pr.ts</strong><dd><code>Update create-pr
endpoint with new speedup_x parameter</code>&nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

js/cf-api/endpoints/create-pr.ts

<li>Added <code>speedup_x</code> argument in buildPrTitle call.<br> <li>
Minor formatting fix (removed extra semicolon).<br> <li> Updated branch
creation message to include additional parameters.


</details>


  </td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1488/files#diff-728a794bb81f944ae7db030f5e6ae1c1ba6888aa46e4be6846ebc5bd1ce12c2c">+7/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>suggest-pr-changes.ts</strong><dd><code>Update
suggest-pr-changes with new speedup_x parameter</code>&nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

js/cf-api/endpoints/suggest-pr-changes.ts

<li>Inserted <code>speedup_x</code> parameter in buildDependentPrTitle
call.<br> <li> Adjusted commit message composition.


</details>


  </td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1488/files#diff-b4a862986fd70827b8dabcb3157972bd0d5d507cf9c12e5fbf56f24979d073f3">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>

<summary><strong>create-pr-from-diffcontents.ts</strong><dd><code>Modify
PR creation functions for updated title parameters</code></dd></summary>
<hr>

js/cf-api/github/create-pr-from-diffcontents.ts

<li>Modified buildPrTitle call to include <code>speedup_x</code> and
<code>loop_count</code>.<br> <li> Updated buildDependentPrTitle call
with <code>speedup_x</code>.


</details>


  </td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1488/files#diff-b30d5e0c89beb70c0333a025726867aba5db7614911be3c46664bb59d1ab594a">+7/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>pr-changes-utils.ts</strong><dd><code>Update title
building utilities for speedup multiplier logic</code></dd></summary>
<hr>

js/cf-api/github/pr-changes-utils.ts

<li>Added <code>speedup_x</code> parameter to buildPrTitle and
buildDependentPrTitle.<br> <li> Implemented condition to use
<code>speedup_x</code> when percentage > 1000.<br> <li> Refactored title
functions for enhanced clarity.


</details>


  </td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1488/files#diff-ac6988771dc3fdb0666757d9bace579f70856f1f383ddd5db264484f1b6016e4">+12/-3</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Tests</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>pr-changes-utils.test.ts</strong><dd><code>Adjust tests
to support new title building parameters</code>&nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

js/cf-api/github/pr-changes-utils.test.ts

<li>Updated tests for buildPrTitle with additional
<code>speedup_x</code> parameter.<br> <li> Revised expected output
strings in dependent PR title tests.


</details>


  </td>
<td><a
href="https://github.com/codeflash-ai/codeflash-internal/pull/1488/files#diff-b724fe01559c8ff46177344dcaa3741bc56bbda2b14ec979558bb7cf6245951a">+5/-5</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-03-11 23:39:10 +00:00
Saga4
109e1d544c dedupe and pricing changes for period 2025-03-11 04:55:40 +05:30
davidgirdwood1
ab46a8496b CS-486 - update text 2025-02-24 14:16:53 -08:00
davidgirdwood1
c24b9ba295 CF-486b
test
2025-02-20 21:18:55 -08:00
davidgirdwood1
31148ee119 fix test 2025-02-13 19:22:45 -08:00
Sarthak Agarwal
4cda582594
PR description change (#1435)
![image](https://github.com/user-attachments/assets/3debfee0-80e3-45bb-af87-35eda2a7ed97)

Preview: https://github.com/codeflash-ai/my-best-repo/pull/120



[![Codeflash](https://img.shields.io/badge/Optimized%20with-Codeflash-yellow?style=flat&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MzIgMjgyIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTI4Ni43IDAuMzc4SDIwMS43NUw1MC45IDE0OC45MUgxMzUuODVMMC45NiAyODJIOTUuNDRMMjgyLjMyIDg5Ljk2SDE5Ni4zNUwyODYuNyAwLjM3OFoiIGZpbGw9IiNGRkMwNDMiLz48L3N2Zz4=)](https://codeflash.ai)
[![Discord](https://img.shields.io/badge/Discord-Join%20Our%20Community-7289DA)](https://codeflash.ai/discord)

closes
https://linear.app/codeflash-ai/issue/CF-520/github-pr-to-mention-optimized-with-codeflashai
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **Documentation**
- Updated test report generation to include a Codeflash optimization
badge.

- **Style**
  - Reformatted test cases for improved readability.
- Enhanced visual structure of test files without changing
functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-31 16:21:14 -08:00
Kevin Turcios
632ef8a862 apply review suggestions 2025-01-06 16:53:24 -05:00
Kevin Turcios
47cf5c3c30 relax regex
found during insomnia testing

refactor existing optimizations

Update verify-existing-optimizations.ts
2025-01-06 09:11:24 -05:00