Skip to content

fix migration tests#2371

Merged
akshaydeo merged 1 commit intomainfrom
03-30-fix_migration_tests
Mar 29, 2026
Merged

fix migration tests#2371
akshaydeo merged 1 commit intomainfrom
03-30-fix_migration_tests

Conversation

@akshaydeo
Copy link
Copy Markdown
Contributor

@akshaydeo akshaydeo commented Mar 29, 2026

Summary

Adds support for new v1.4.17 database schema columns and fixes Perplexity provider validation expectations in migration tests.

Changes

  • Added open_ai_config_json column to config_providers table with OpenAI-specific configuration support
  • Added blacklisted_models_json column to config_keys table for per-key model deny lists
  • Added calendar_aligned field to budget configuration schema for calendar boundary reset alignment
  • Updated Perplexity provider validation to correctly expect no timestamps or model fields in responses
  • Enhanced migration test scripts with dynamic column handling for both PostgreSQL and SQLite databases

Type of change

  • Feature
  • Bug fix
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

Validate the migration tests and provider configurations:

# Core/Transports
go version
go test ./...

# Run migration tests specifically
./.github/workflows/scripts/run-migration-tests.sh

# Test Perplexity provider validation
go test ./core/internal/llmtests/... -v

The new configuration fields:

  • open_ai_config_json: Stores OpenAI-specific settings like organization and disable_store flags
  • blacklisted_models_json: Array of model names to exclude for specific API keys
  • calendar_aligned: Boolean flag for budget reset timing alignment

Screenshots/Recordings

N/A

Breaking changes

  • Yes
  • No

Related issues

N/A

Security considerations

The new blacklisted models feature enhances security by allowing fine-grained model access control per API key.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 29, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 891e017d-d033-4bd9-a8ea-81155d5698a1

📥 Commits

Reviewing files that changed from the base of the PR and between 52093ec and f0acd60.

📒 Files selected for processing (3)
  • .github/workflows/scripts/run-migration-tests.sh
  • core/internal/llmtests/validation_presets.go
  • transports/config.schema.json

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a new optional calendar_aligned configuration setting for governance budgets, enabling budget resets to align with calendar boundaries (day, week, month, or year start times).
  • Chores

    • Updated internal testing infrastructure for migration tests and validation presets.

Walkthrough

Three distinct modifications: migration test script updates faker seeds for OpenAI and Anthropic providers with new columns and backfill logic; validation preset changes Perplexity provider expectations for timestamp and model fields; governance budget schema adds optional calendar-aligned boolean property.

Changes

Cohort / File(s) Summary
Migration Test Seed Updates
.github/workflows/scripts/run-migration-tests.sh
Updated faker seeds for OpenAI provider configuration to include open_ai_config_json with organization test data; added blacklisted_models_json column to config keys inserts (gpt-4-32k for OpenAI, empty list for Anthropic); extended PostgreSQL and SQLite dynamic post-insert logic to backfill these new columns when present.
LLM Test Validation Presets
core/internal/llmtests/validation_presets.go
Modified Perplexity provider expectation overrides: ShouldHaveTimestamps and ShouldHaveModel changed from true to false; usage stats and latency expectations remain unchanged.
Config Schema Enhancement
transports/config.schema.json
Added optional boolean property calendar_aligned (default: false) to governance budget object schema with description indicating reset alignment to calendar boundaries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hopping through config and schemas we go,
Migration seeds planted, new columns in tow,
Perplexity's expectations gently adjust,
While budgets align to calendars—trust!
Changes cascade like fresh clover, so fine.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 03-30-fix_migration_tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

🧪 Test Suite Available

This PR can be tested by a repository admin.

Run tests for PR #2371

@akshaydeo akshaydeo marked this pull request as ready for review March 29, 2026 19:20
@akshaydeo akshaydeo merged commit 48a397d into main Mar 29, 2026
8 of 10 checks passed
@akshaydeo akshaydeo deleted the 03-30-fix_migration_tests branch March 29, 2026 19:20
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 29, 2026

Confidence Score: 4/5

Safe to merge for production; the migration script issue reduces test coverage for pre-v1.4.17 schemas but does not affect the migrations themselves.

The Go code changes (validation fix, schema addition) are straightforward and correct. The migration script has one concrete regression: new columns baked into static INSERTs will cause those INSERTs to fail on older schemas, silently reducing migration test coverage for those versions.

.github/workflows/scripts/run-migration-tests.sh — static INSERT column lists and the empty-string dynamic update for open_ai_config_json.

Important Files Changed

Filename Overview
.github/workflows/scripts/run-migration-tests.sh Adds v1.4.17 column coverage for open_ai_config_json and blacklisted_models_json. The static INSERTs now include these new columns, which will fail entirely for pre-v1.4.17 schemas (inconsistent with the established azure_scopes pattern); the dynamic update also uses an empty string instead of NULL for the non-OpenAI provider.
core/internal/llmtests/validation_presets.go Corrects Perplexity test expectations: sets ShouldHaveTimestamps and ShouldHaveModel to false, matching the actual Perplexity API response shape which omits the created timestamp and model field.
transports/config.schema.json Adds calendar_aligned boolean field to the budget configuration object; correctly typed, has a sensible default, and is marked optional (not in required).

Reviews (1): Last reviewed commit: "fix migration tests" | Re-trigger Greptile

Comment on lines +484 to 488
INSERT INTO config_providers (name, send_back_raw_request, send_back_raw_response, network_config_json, concurrency_buffer_json, proxy_config_json, custom_provider_config_json, open_ai_config_json, budget_id, rate_limit_id, config_hash, created_at, updated_at)
VALUES
('openai', false, false, '{"timeout": 30}', '{"buffer_size": 100}', NULL, NULL, '{"organization": "org-test"}', 'budget-migration-test-1', 'ratelimit-migration-test-1', 'provider-hash-openai', $now, $now),
('anthropic', true, true, '{"timeout": 60}', '{"buffer_size": 200}', '{"url": "http://proxy.test"}', NULL, NULL, NULL, NULL, 'provider-hash-anthropic', $now, $now)
ON CONFLICT DO NOTHING;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 New columns in static INSERT break pre-v1.4.17 schema tests

open_ai_config_json (and blacklisted_models_json in config_keys) are now listed in the static INSERT column list. When the migration test runs against any schema older than v1.4.17 — where these columns don't yet exist — PostgreSQL will throw ERROR: column "open_ai_config_json" of relation "config_providers" does not exist, causing the entire INSERT to fail. All subsequent config_keys INSERTs that SELECT … FROM config_providers WHERE name = 'openai' will then silently insert zero rows as well.

The existing pattern for exactly this scenario is the azure_scopes treatment (see the NOTE comment on the config_keys INSERT): keep the new column out of the static INSERT and supply its value only inside append_dynamic_columns_postgres/sqlite guarded by column_exists_*. That way the static INSERT succeeds on all older schemas, and the extra data is only emitted when the column actually exists.

The same fix applies to the two config_keys INSERTs that now include blacklisted_models_json.

Comment on lines +1205 to +1206
echo "UPDATE config_providers SET open_ai_config_json = '{\"disable_store\":false}' WHERE name = 'openai';" >> "$output_file"
echo "UPDATE config_providers SET open_ai_config_json = '' WHERE name = 'anthropic';" >> "$output_file"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Empty string stored in JSON field for non-OpenAI provider

open_ai_config_json is a text column (not json/jsonb), so PostgreSQL accepts an empty string without a type error. The application-side deserialization logic (in tables/provider.go) treats "" and NULL identically, so this is functionally correct. However, the static INSERT already stores NULL for 'anthropic'; the dynamic UPDATE then overwrites it with ''. Using NULL in both places would be consistent.

The same applies to the SQLite dynamic section at line ~1672.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

akshaydeo added a commit that referenced this pull request Mar 30, 2026
* v1.4.17-release-cut (#2368)

* fixed helm schema fix (#2369)

## Summary

Remove Bullfrog security monitoring from GitHub Actions workflows and update Helm chart schema validation requirements.

## Changes

- Removed `bullfrogsec/bullfrog@7bc9b6e13e2dd9cbe5861f33bc26dc6bdb9d9ed2` action with `egress-policy: audit` from all GitHub Actions workflows
- Updated Helm chart values schema to only require `dimension` field instead of `dimension`, `keys`, and `provider` for config objects

## Type of change

- [ ] Bug fix
- [ ] Feature
- [x] Refactor
- [ ] Documentation
- [x] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (Next.js)
- [ ] Docs

## How to test

Verify that GitHub Actions workflows execute successfully without the Bullfrog security step:

```sh
# Trigger any workflow to ensure it runs without errors
# Check that Helm chart validation accepts configs with only dimension field
helm lint helm-charts/bifrost/
```

## Screenshots/Recordings

N/A

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

This change removes network egress monitoring from CI/CD pipelines. Ensure alternative security measures are in place if network monitoring is still required.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* fix migration tests (#2371)

* framework: bump core to v1.4.15 --skip-pipeline

* plugins/governance: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* plugins/jsonparser: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* plugins/litellmcompat: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* plugins/logging: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* plugins/maxim: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* plugins/mocker: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* plugins/otel: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* plugins/semanticcache: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* plugins/telemetry: bump core to v1.4.15 and framework to v1.2.34 --skip-pipeline

* test fixes (#2374)

## Summary

Adds support for testing streaming multiple tool calls functionality across LLM providers. This addresses the need to differentiate between providers that support multiple tool calls in streaming mode versus those that only return one tool call at a time during streaming.

## Changes

- Added `MultipleToolCallsStreaming` field to `TestScenarios` struct to track streaming multiple tool calls capability
- Updated all provider test configurations to enable the new streaming multiple tool calls feature
- Added conditional test skipping in multiple tool calls streaming tests when providers don't support this functionality
- Refined streaming response validation expectations to handle consolidated responses from chunks more accurately
- Updated provider-specific validation expectations for Cohere and Parasail to reflect their actual response formats

## Type of change

- [x] Feature
- [x] Refactor

## Affected areas

- [x] Core (Go)
- [x] Providers/Integrations

## How to test

Run the LLM provider tests to validate streaming multiple tool calls functionality:

```sh
# Core/Transports
go version
go test ./...

# Test specific provider streaming multiple tool calls
go test ./core/providers/openai -v -run TestOpenAI
go test ./core/providers/anthropic -v -run TestAnthropic
```

The tests will automatically skip streaming multiple tool calls scenarios for providers that don't support this feature.

## Screenshots/Recordings

N/A - Backend testing enhancement only.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

No security implications - this is a testing infrastructure enhancement.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* transports: update dependencies --skip-pipeline

* Adds changelog for v1.4.18 --skip-pipeline

* [StepSecurity] Apply security best practices (#2372)

* [StepSecurity] Apply security best practices

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>

* Update .github/workflows/codeql.yml

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* cr fixes

* fixed cr comments 2

---------

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Co-authored-by: Akshay Deo <akshay@akshaydeo.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* removed codeql to fallback on default setup (#2376)

## Summary

Removes the CodeQL security analysis workflow from the GitHub Actions configuration. This eliminates automated static code analysis for Go, JavaScript, and Python languages that was previously running on pushes, pull requests, and weekly schedules.

## Changes

- Deleted `.github/workflows/codeql.yml` which contained the complete CodeQL workflow configuration
- Removed automated security scanning for Go, JavaScript, and Python codebases
- Eliminated the scheduled weekly security analysis runs

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (Next.js)
- [ ] Docs

## How to test

Verify that CodeQL workflow is no longer present in the repository:

```sh
# Confirm the workflow file has been removed
ls -la .github/workflows/
# Should not show codeql.yml

# Check GitHub Actions tab to ensure CodeQL runs are no longer scheduled
# Navigate to repository Actions tab and verify no CodeQL workflows appear
```

## Screenshots/Recordings

N/A

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

This change removes automated security analysis from the CI/CD pipeline. The repository will no longer benefit from CodeQL's static analysis capabilities for detecting security vulnerabilities, code quality issues, and potential bugs in Go, JavaScript, and Python code. Consider alternative security scanning solutions if this workflow was providing valuable security insights.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* Update snyk.yml (#2380)

* fips base image (#2310)

## Summary

Updates the transports Docker configuration to use a FIPS-compliant base image and removes the built-in health check mechanism.

## Changes

- Replaced `alpine:3.23.3` base image with `dhi.io/alpine-base:3.23-alpine3.23-fips` for FIPS compliance
- Removed the Docker HEALTHCHECK directive that was monitoring the `/health` endpoint

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

## Affected areas

- [ ] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (Next.js)
- [ ] Docs

## How to test

Verify the Docker image builds successfully with the new base image and that the application starts correctly without the health check.

```sh
# Build the Docker image
docker build -t transports-test ./transports

# Run the container
docker run -p 8080:8080 transports-test

# Verify the application is running
curl http://localhost:8080/health
```

## Screenshots/Recordings

N/A

## Breaking changes

- [x] Yes
- [ ] No

The removal of the Docker HEALTHCHECK may affect container orchestration systems that rely on Docker's built-in health checking. External health monitoring will need to be configured if required.

## Related issues

N/A

## Security considerations

This change enhances security by adopting a FIPS-compliant base image, which provides cryptographic modules that meet Federal Information Processing Standards.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

* fixed snyk failure and enterprise update (#2382)

## Summary

Enhances the model catalog to extract and cache max output tokens from pricing data, improves Snyk workflow reliability by checking for SARIF file existence before upload, and updates security documentation to reflect full SHA pinning for the enterprise repository.

## Changes

- Added `MaxOutputTokens` field to `PricingEntry` struct to capture model parameter limits from pricing datasheet
- Implemented `populateModelParamsFromPricing()` function to extract max output tokens and populate the model params cache
- Refactored model name extraction logic into reusable `extractModelName()` utility function
- Enhanced Snyk workflow conditions to only upload SARIF files when they exist, preventing upload failures
- Updated security documentation to reflect that bifrost-enterprise now uses full SHA pinning (100% coverage)

## Type of change

- [x] Feature
- [x] Chore/CI
- [x] Documentation

## Affected areas

- [x] Core (Go)
- [x] Docs

## How to test

Verify model catalog functionality and pricing data processing:

```sh
# Core functionality
go version
go test ./framework/modelcatalog/...

# Test pricing sync with max_output_tokens
go test -v ./framework/modelcatalog/ -run TestSyncPricing

# Verify Snyk workflow changes in CI
# Check that SARIF upload steps only run when files exist
```

## Screenshots/Recordings

N/A

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

- Improves CI security by preventing potential failures in SARIF upload steps
- Documents enhanced security posture with full SHA pinning in enterprise repository

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* fix snyk failures (#2385)

## Summary

Improves Docker container security and reliability by migrating from custom base image to standard Alpine, adding health checks, and enhancing Snyk security scanning.

## Changes

- **Docker base image migration**: Replaced `bifrosthq/dhi-alpine-base:3.22-fips_bifrost-v27032026` with standard `alpine:3.23.3` for better security and maintainability
- **Added health checks**: Implemented HTTP health check endpoint monitoring with 30s intervals and proper retry logic
- **Enhanced user management**: Consolidated user creation and permission setup into single RUN command for better layer optimization
- **Improved Snyk scanning**: Added build step before security scanning and excluded `examples` and `tests/scripts` directories from vulnerability analysis
- **Runtime dependencies**: Explicitly installed required CGO runtime libraries (musl, libgcc, ca-certificates, wget)

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [x] Chore/CI

## Affected areas

- [ ] Core (Go)
- [x] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (Next.js)
- [ ] Docs

## How to test

Validate Docker builds and container health:

```sh
# Build and test standard Dockerfile
docker build -f transports/Dockerfile -t bifrost:test .
docker run -d --name bifrost-test -p 8080:8080 bifrost:test
docker ps  # Should show healthy status after ~35s
curl http://localhost:8080/health  # Should return 200 OK

# Build and test local development Dockerfile
docker build -f transports/Dockerfile.local -t bifrost:local .
docker run -d --name bifrost-local -p 8081:8080 bifrost:local
docker ps  # Should show healthy status after ~35s

# Test Snyk workflow
make build  # Verify build step works
# Run Snyk scan (requires SNYK_TOKEN)
```

## Screenshots/Recordings

N/A

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

- Migrated from custom base image to well-maintained Alpine Linux for better security patching
- Enhanced Snyk scanning excludes test directories to focus on production code vulnerabilities
- Health check endpoint provides better container monitoring capabilities
- Explicit runtime dependency management reduces attack surface

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* fix: add explicit type="button" to navigation and action buttons (#2353)

## Summary

Added explicit `type="button"` attributes to Button components in log detail sheets and plugin sequence forms to prevent unintended form submissions when these buttons are clicked.

## Changes

- Added `type="button"` to navigation buttons (Previous/Next) in log detail sheets
- Added `type="button"` to dropdown menu trigger buttons in log detail sheets  
- Added `type="button"` to the Save Sequence button in plugin sequence sheet
- Added `type="button"` to the Copy button in CEL rule builder

This prevents these buttons from accidentally triggering form submissions when used within forms, ensuring they only perform their intended click actions.

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (Next.js)
- [ ] Docs

## How to test

Verify that buttons in log detail sheets and plugin forms work correctly without triggering form submissions:

1. Open log detail sheets and test navigation buttons
2. Test dropdown menu triggers in log sheets
3. Test plugin sequence save functionality
4. Test CEL rule builder copy button

```sh
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

N/A - This is a behavioral fix without visual changes.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

None - this change only affects button behavior to prevent unintended form submissions.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* fix: prevent edit mode activation when clicking interactive elements in message views (#2377)

## Summary

Prevents edit mode from being triggered when clicking on interactive elements (buttons, links, or elements with button role) within message views. This fixes the issue where clicking on buttons or links inside messages would unintentionally activate edit mode.

## Changes

- Added event target checking in onClick handlers for assistant, system, and user message views
- Modified click handlers to check if the clicked element is within a button, link, or element with button role using `closest()` method
- Restructured conditional logic for better readability and early returns

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (Next.js)
- [ ] Docs

## How to test

1. Navigate to a message view with interactive elements (buttons, links)
2. Click on buttons or links within the message content
3. Verify that edit mode is not triggered when clicking interactive elements
4. Click on non-interactive areas of the message to confirm edit mode still works
5. Test across all message types (assistant, system, user)

```sh
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

N/A

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

No security implications - this is a UI interaction improvement.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* refactor: extract copy-to-clipboard logic into reusable hook (#2379)

## Summary

Refactored clipboard copy functionality across the UI by creating a reusable `useCopyToClipboard` hook to replace duplicate clipboard handling code.

## Changes

- Created a new `useCopyToClipboard` hook that provides consistent clipboard functionality with customizable success/error messages and automatic reset of copied state
- Replaced inline clipboard handling code across 11 components with the new hook
- Removed direct `navigator.clipboard.writeText()` calls and manual toast notifications
- Added support for customizable messages and reset delays in the hook

## Type of change

- [ ] Bug fix
- [ ] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (Next.js)
- [ ] Docs

## How to test

Test clipboard functionality across the affected components:

```sh
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

1. Navigate to API Keys page and test copying curl examples
2. Open log details and test copying request IDs and request bodies
3. Test copy functionality in routing rules CEL builder
4. Test copy functionality in virtual keys table
5. Test copy functionality in Prometheus configuration
6. Verify all copy actions show appropriate toast messages

## Screenshots/Recordings

No visual changes - functionality remains the same with improved code organization.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

No security implications - maintains existing clipboard functionality without changes to security model.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* refactor: replace lazy query with polling query and fix overflow in log details sheet (#2381)

## Summary

Improves log detail sheet reliability by switching from lazy loading to automatic polling for failed log fetches and fixes UI overflow issues in the sheet header.

## Changes

- Replaced `useLazyGetLogByIdQuery` with `useGetLogByIdQuery` for automatic data fetching when the sheet opens
- Added polling mechanism that retries every 2 seconds when log fetch fails, stopping when successful
- Fixed horizontal overflow issues in the sheet header by adding `overflow-x-hidden` classes
- Exported `useGetLogByIdQuery` hook from the logs API

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (Next.js)
- [ ] Docs

## How to test

1. Open the logs page and click on a log entry to view details
2. Verify the log details load automatically without manual triggering
3. Test with network issues or slow responses to confirm polling retry behavior
4. Check that long request IDs don't cause horizontal overflow in the sheet header

```sh
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

N/A

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

N/A

## Security considerations

None - this change only affects UI data fetching patterns and styling.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [x] I verified the CI pipeline passes locally if applicable

* merge-branch-main-into-v-1-5-0 resolve

* merge-branch-main-into-v-1-5-0 resolve

---------

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Co-authored-by: Akshay Deo <akshay@akshaydeo.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: StepSecurity Bot <bot@stepsecurity.io>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants