Skip to content

fix: show save for editing tests in doc panel#1618

Merged
mdesmet merged 2 commits intomasterfrom
fix-update-test
Apr 20, 2026
Merged

fix: show save for editing tests in doc panel#1618
mdesmet merged 2 commits intomasterfrom
fix-update-test

Conversation

@saravmajestic
Copy link
Copy Markdown
Collaborator

@saravmajestic saravmajestic commented Mar 21, 2025

Overview

Problem

Describe the problem you are solving. Mention the ticket/issue if applicable.

Solution

Describe the implemented solution. Add external references if needed.

Screenshot/Demo

A picture is worth a thousand words. Please highlight the changes if applicable.

How to test

  • Steps to be followed to verify the solution or code changes
  • Mention if there is any settings configuration added/changed/deleted

Checklist

  • I have run this code and it appears to resolve the stated issue
  • README.md updated and added information about my change

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of unsaved changes in the documentation editor for test metadata modifications.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 21, 2025

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 296464de-19e4-41b6-a3a3-3ff779ced266

📥 Commits

Reviewing files that changed from the base of the PR and between d3165c6 and fccb88b.

📒 Files selected for processing (1)
  • webview_panels/src/modules/documentationEditor/utils.ts

Disabled knowledge base sources:

  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

The isStateDirty function in the documentation editor utils module was enhanced to perform additional dirty-state checks for specific test metadata types. It now compares kwargs.values arrays for ACCEPTED_VALUES tests and kwargs.to/kwargs.field properties for RELATIONSHIPS tests.

Changes

Cohort / File(s) Summary
Test Metadata Dirty-Check Enhancement
webview_panels/src/modules/documentationEditor/utils.ts
Added conditional logic to isStateDirty to compare kwargs.values (with empty array default) for ACCEPTED_VALUES tests and kwargs.to/kwargs.field for RELATIONSHIPS tests using existing comparison utilities.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • AdiGajbhiye
✨ 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 fix-update-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Join(",") can produce false matches for values containing commas.
Use the existing isArrayEqual helper for an element-wise comparison,
and rename relationships vars for brevity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mdesmet mdesmet marked this pull request as ready for review April 20, 2026 04:32
@mdesmet mdesmet merged commit c9c0a3b into master Apr 20, 2026
14 of 15 checks passed
@mdesmet mdesmet deleted the fix-update-test branch April 20, 2026 04:32
Comment on lines +188 to +192
if (
currentArgs.to !== incomingArgs.to ||
currentArgs.field !== incomingArgs.field
) {
return true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The code accesses properties on incomingTest.test_metadata without null checks, which can cause a runtime error if an incoming test lacks this optional metadata.
Severity: HIGH

Suggested Fix

Add guards to ensure incomingTest.test_metadata and its kwargs property are defined before attempting to access their nested properties. For example, check if incomingArgs is truthy before accessing incomingArgs.to or incomingArgs.field.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: webview_panels/src/modules/documentationEditor/utils.ts#L188-L192

Potential issue: The function compares a current test with an incoming test, matching
them by `key`. However, the `test_metadata` property is optional. The code proceeds to
access properties on `incomingTest.test_metadata.kwargs` (e.g., `incomingArgs.to` or
`.values`) without first verifying that `incomingTest.test_metadata` or its `kwargs`
property exist. If an incoming test is found that lacks this optional metadata, the
logic will attempt to read a property on `undefined`, causing a `TypeError` and breaking
the state comparison feature.

Did we get this right? 👍 / 👎 to inform future reviews.

@github-actions
Copy link
Copy Markdown

Bundle Size Report

darwin-arm64: 70.1 MB
Category Size Compressed Files
Native: altimate-core 35.1 MB 14.0 MB 1
Media assets 29.6 MB 25.8 MB 91
Webview JS bundles 26.1 MB 8.3 MB 343
Native: zeromq 20.5 MB 8.2 MB 15
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.5 MB 2
Python packages 2.0 MB 0.5 MB 95
Native: other node_modules 1.0 MB 0.2 MB 139
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 24 KB 14
Total 133.7 MB 69.9 MB 725
linux-x64: 71.8 MB
Category Size Compressed Files
Native: altimate-core 41.8 MB 15.1 MB 1
Media assets 29.6 MB 25.8 MB 91
Webview JS bundles 26.1 MB 8.3 MB 343
Native: zeromq 21.9 MB 8.7 MB 16
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.5 MB 2
Python packages 2.0 MB 0.5 MB 95
Native: other node_modules 1.0 MB 0.2 MB 139
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 24 KB 14
Total 141.8 MB 71.6 MB 726
win32-x64: 72.7 MB
Category Size Compressed Files
Native: altimate-core 50.3 MB 16.2 MB 1
Media assets 29.6 MB 25.8 MB 91
Webview JS bundles 26.1 MB 8.3 MB 343
Native: zeromq 20.0 MB 8.1 MB 15
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.5 MB 2
Native: other node_modules 2.3 MB 0.7 MB 147
Python packages 2.0 MB 0.5 MB 95
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 24 KB 14
Total 149.6 MB 72.6 MB 733

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