## Summary
- **Fix CI build failure**: Auth0Client crashes during Next.js
prerendering when env vars aren't set. Returns a no-op stub (`getSession
→ null`) when domain is missing — semantically correct for static
generation
- **Lazy-load markdown libs (~260kb)**: ReactMarkdown, remarkGfm, and
react-syntax-highlighter were eagerly imported in monaco-diff-viewer but
only rendered when user expands "Generated Tests". Extracted into a
dynamic component
- **Parallelize repo detail query**: `getRepositoryById` ran the
activity count sequentially after the repo lookup. Since `repoId` is
already available, all three queries now run in parallel
## Test plan
- [ ] CI `build` check passes (was failing since #2598)
- [ ] Trace page still renders generated tests correctly when expanded
- [ ] Repository detail page loads correctly with activity status
# Pull Request Checklist
## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets
## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes
## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code
## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---
## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
## Summary
Adds a line-by-line performance profiler visualization to the webapp,
allowing users to compare execution times between original and optimized
code.
## Changes
### New Line Profiler View
- **`LineProfilerView.tsx`**: Side-by-side comparison component showing:
- Line-by-line execution times with heat map visualization
- Syntax highlighting using `prism-react-renderer`
- Collapsible function blocks
- Light/dark mode support
- Heat legend (cold → hot based on % time)
- **`lineProfilerParser.ts`**: Parser utilities for line profiler data:
- `parseLineProfilerResults()` - parses markdown table output from
Python's line_profiler
- `formatTime()` - converts timer units to human-readable format (ns,
µs, ms, s)
- `getHeatLevel()` - determines heat coloring based on % time
- **`/review-optimizations/[traceId]/profiler/page.tsx`**: New route for
the profiler view
### API Changes
- **`create-pr.ts`**: Adds "📊 Performance Profile" link to PR
description when profiler data exists
- **`github-app.ts`**: Removes line profiler data from metadata when PR
is closed/merged
- **`create-staging.ts`**, **`suggest-pr-changes.ts`**: Handle line
profiler data in staging
- **`staging-storage-strategy.ts`**: Interface updates for line profiler
fields
### Webapp Integration
- **`page.tsx`**: Added "Performance Profile" button (only visible when
profiler data exists)
- **`action.ts`**: Sends line profiler data when creating PR from webapp
Fixes CF-1018
https://codeflash-ai.slack.com/files/U08MSR1UN6L/F0A9YVDJY75/screen_recording_2026-01-21_at_10.03.18___pm.movhttps://github.com/HeshamHM28/my-best-repo/pull/21
linked to https://github.com/codeflash-ai/codeflash/pull/1139
---------
Co-authored-by: Aseem Saxena <aseem.bits@gmail.com>
Fixes cf-1001
# Pull Request Checklist
## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets
## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes
## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code
## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---
## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
# Pull Request Checklist
## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets
## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes
## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code
## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---
## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
# Remove automatic secret setup from GitHub Actions workflow
installation
This PR removes the automatic repository secret setup functionality from
the GitHub Actions workflow installation process.
## Changes
- **Removed automatic secret setup**: The `setup-github-actions`
endpoint no longer automatically creates the `CODEFLASH_API_KEY`
repository secret. Users will need to manually add this secret in their
repository settings if needed.
- **Removed unused endpoint**: Deleted the `check-workflow-file-exists`
endpoint that was not being used anymore.
- **Updated permissions documentation**: Removed `secrets: write` from
the required GitHub App permissions since it's no longer needed.
- **Improved error messages**: Added installation URL to 403 error
responses to help users install the GitHub App when needed.
## Organization Feature
This PR introduces a new **Organization** feature that allows users to:
- Create organizations and add members
- Manage repositories within organizations
- Allow organization members to access and view shared repository data
---
## How to Test
### 1. Setup
- Apply the latest **database migrations**.
- Build the **common** package, then **pack** and **install** it in
both:
- `cf-webapp`
- `cf-api`
### 2. Create an Organization
- You can create an organization **manually** in the database, **or**
- Use the **GitHub webhook** to add it automatically.
### 3. Test Scenarios
Prepare the following:
- **Two users:**
- **User A** – has access to the organization and its repositories.
- **User B** – a regular user.
- **Two repositories:**
- One under the **organization**.
- One under **User A’s personal account**.
### 4. Verification Steps
1. Log in to **cf-webapp** as **User A**.
2. Confirm both the **personal account** and **organization** appear.
3. Try optimizing code and ensure **statistics** display correctly.
4. Switch between **personal** and **organization** accounts to verify
data accuracy.
5. From the **personal account**:
- Open a specific repository.
- Add a new member by **GitHub username**.
- Log in as that member (**User B**) and verify access.
6. From the **organization**:
- Add members to the organization by **GitHub username**.
- Log in as the added member and confirm they have access to
organization repositories.
- Update the member’s **role** and ensure changes are applied correctly.
---
---------
Co-authored-by: ali <mohammed18200118@gmail.com>
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
When a new installation happens in a repo, we save the repo in the
database and link it with the sender. The problem is that the sender is
not in the database, so we upsert the sender to ensure they are added. I
also added a new role to identify the sender’s role