Commit Graph
311 Commits
Author SHA1 Message Date
Bob QiuandClaude Sonnet 5.5 54e46851ff test(e2e): add insomnia-test Playwright framework and CI workflow [1/6] (#10594)
* feat: enhance accessibility and testing capabilities across UI components

- Added data-testid attributes to various components for improved testing.
- Updated mock-url-bar to include test IDs for method and path.
- Enhanced generate-code-modal with test IDs for dropdowns.
- Included test IDs in git-branches-modal and git-project-branches-modal for error messages.
- Added test IDs to import-modal header and input-vault-key-modal for error display.
- Enhanced new-workspace-modal with test IDs for mock server type options.
- Included test IDs in select-modal for the select element.
- Added test IDs in sync-merge-modal for merge conflict items.
- Enhanced visual-diff components with test IDs for better test coverage.
- Included test IDs in workspace-certificates-modal for CA certificate section.
- Enhanced workspace-environments-edit-modal with test IDs for environment icons.
- Added test IDs in pane-header for breadcrumbs.
- Included test IDs in request-result-card for runner results.
- Enhanced request-test-result-pane with test IDs for test result rows.
- Added test IDs in project-create-form for unknown fields warning.
- Enhanced AI settings with test IDs for toggle switches.
- Included test IDs in boolean-setting for settings labels.
- Enhanced scripting-settings with test IDs for rule toggles.
- Added test IDs in sidebar components for search fields and nodes.
- Enhanced spec-view with test IDs for method buttons.
- Included test IDs in tab components for tab titles.
- Enhanced tags with test IDs for size, time, and URL tags.
- Added test IDs in tag-editor for tag arguments.
- Enhanced toast-notification with test IDs for toast body and content.
- Included test IDs in response-headers-viewer for header rows and values.
- Enhanced event-log-view with test IDs for event rows and cells.

* feat: add remaining test ids for folder pane, staging button, drop indicator and test results

- folder-pane on the request group Tabs
- stage-this-file / unstage-this-file on the git staging preview button
- drop-indicator-folder-name and data-valid on the sidebar drop indicator
- test-result-case / test-result-error inside the test result name

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat: add data-selected attributes for improved testing and UI state indication

* fix: use unique test ids for graphql explorer root types

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix: make sidebar data-parent-id return the parent row id

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat: enhance accessibility and testing capabilities across UI components

- Added data-testid attributes to various components for improved testing.
- Updated mock-url-bar to include test IDs for method and path.
- Enhanced generate-code-modal with test IDs for dropdowns.
- Included test IDs in git-branches-modal and git-project-branches-modal for error messages.
- Added test IDs to import-modal header and input-vault-key-modal for error display.
- Enhanced new-workspace-modal with test IDs for mock server type options.
- Included test IDs in select-modal for the select element.
- Added test IDs in sync-merge-modal for merge conflict items.
- Enhanced visual-diff components with test IDs for better test coverage.
- Included test IDs in workspace-certificates-modal for CA certificate section.
- Enhanced workspace-environments-edit-modal with test IDs for environment icons.
- Added test IDs in pane-header for breadcrumbs.
- Included test IDs in request-result-card for runner results.
- Enhanced request-test-result-pane with test IDs for test result rows.
- Added test IDs in project-create-form for unknown fields warning.
- Enhanced AI settings with test IDs for toggle switches.
- Included test IDs in boolean-setting for settings labels.
- Enhanced scripting-settings with test IDs for rule toggles.
- Added test IDs in sidebar components for search fields and nodes.
- Enhanced spec-view with test IDs for method buttons.
- Included test IDs in tab components for tab titles.
- Enhanced tags with test IDs for size, time, and URL tags.
- Added test IDs in tag-editor for tag arguments.
- Enhanced toast-notification with test IDs for toast body and content.
- Included test IDs in response-headers-viewer for header rows and values.
- Enhanced event-log-view with test IDs for event rows and cells.

* feat: add remaining test ids for folder pane, staging button, drop indicator and test results

- folder-pane on the request group Tabs
- stage-this-file / unstage-this-file on the git staging preview button
- drop-indicator-folder-name and data-valid on the sidebar drop indicator
- test-result-case / test-result-error inside the test result name

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(insomnia-test): add Playwright E2E framework, CI workflow and write-insomnia-test skill

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(insomnia-test): add petstore fixture required by the echo server at startup

misc/echo-server.js reads misc/fixtures/petstore-swagger.json when it
starts, so the fixture must land together with the server; otherwise every
shard's webServer exits with ENOENT.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): address PR review comments

- bind mock-api and echo-server to 127.0.0.1
- remove per-test dataPath after use
- throw when setCodeMirrorValue does not hold after retries
- drop continue-on-error from the build job
- shorten cookie waitForPersisted docstring

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(insomnia-test): add mock servers referenced by constants and flows

Adds the event-stream, socket.io, ws-echo, mcp, grpc, git, oauth2 and
mock-bin servers (bound to 127.0.0.1), their proto/upload fixtures, npm
scripts and Playwright webServer entries, so flows that reference them
no longer fail with connection refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* chore(insomnia-test): fix lint errors

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): send mock-bin-server responses as text/plain with nosniff

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): don't echo exception text in mock-bin-server 500 response

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): break flow-manager/workspace.flow import cycle

WorkspaceFlow now takes a structural RequestFlows dependency instead of
importing FlowManager, which removes the 3 new circular references.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): address Copilot review comments

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): rename Response model to ResponseView

The type represents the response pane (response data plus console, stream
events and script test results), not the network response, and clashed
with the insomnia-data Response name. Update flows, pages, specs, JSDoc
and the write-insomnia-test skill accordingly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): split overloaded Flow methods into explicit ones

WorkspaceFlow.create/duplicate/rename, ExportFlow.export and
EnvironmentFlow.create dispatched on argument types via typeof/instanceof
and casts, so a call site did not show which flow it triggered. Replace
them with explicitly named methods (createProject, openLocalGitFolder,
cloneGitProject, createCollection, duplicateRequest, renameCollection,
exportProject, createBaseEnvironment, ...) and update the
write-insomnia-test skill docs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): import expect directly from @playwright/test

Drop the pass-through re-exports of expect from misc/fixtures.ts and
misc/git-fixtures.ts, import it from @playwright/test in specs, and
update the write-insomnia-test skill accordingly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): rename certificate model and update imports

* fix: update watcherExclude settings in VSCode configuration

* chore: update .gitignore to remove test artifacts and add new file for insomnia-test

* feat: update electron-builder config for E2E testing and add eslint config for insomnia-test

* chore: remove unused file watcher exclusions from VSCode settings

* chore: reorder import statements for consistency in response.page.ts

* fix(insomnia-test): locate key/value rows by position to survive provisional key swap

setKeyValuePairs resolved the new row by its data-key, which changes from
the provisional pair-blank_* key to the persisted id once the name is
saved. The value editor locator then never resolved, timing out in
setCodeMirrorValue (template-tag header-name, http happy-path, query-params).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(request-page): ensure stable attribute before setting value to prevent data loss

* fix(request-page): locate rows by fixed position to prevent stale locators during value entry

* fix(insomnia-test): update shard count calculation to derive from test cases and improve node_modules handling

* fix(reference): update request state terminology and clarify enum references in documentation

* refactor(insomnia-test): consolidate framework changes into base PR

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(reference): update terminology from Response to ResponseView for consistency in documentation

* feat(insomnia-test): add response export, folder environment, environment picker, variable-source and prompt-tag helpers

Page/Flow helpers used by the HTTP, environment and template-tag specs:
- ResponsePage/HttpRequestFlow: export response (raw/prettified/HTTP debug), Save To File, export option state
- FolderPage/FolderFlow: set folder environment variables
- EnvironmentPage/EnvironmentFlow: environment pickers, Add Project Environment, collection sub-environment privacy
- VariableSourcePage/VariableSourceFlow: variable tooltip, source modal and Open navigation
- TemplateTagPage/TemplateTagFlow: Prompt tag answer/clear cache
- echo-server: /large-json route; PageManager passes the Electron app to ResponsePage

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(insomnia-test): add page/flow methods, enums, models and mock-server endpoints used by later specs

Framework-level additions moved from test/refactor_e2e_tests: git diff-view and
unknown-fields helpers, MCP capability/list helpers, cloud-sync commit dialog
helpers, upgrade fixture, MCP scriptable list server and custom-CA port,
cloud-sync seed-project endpoint, certs typings and cookie Expires parsing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Refactor code structure for improved readability and maintainability

* fix(insomnia-test): address code-scanning findings in mock servers and git-sync page

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(insomnia-test): add setParamsBulk to set request params via the bulk editor

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(insomnia-test): sync framework-layer page object and coverage fixes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): update SKILL.md and reference.md for linting and focus mode behavior

* test(insomnia-test): add requireItemNode with DEFAULT_TIMEOUT and descriptive error

Flows that dereference the tree lookup result with node! now use
requireItemNode, which waits up to DEFAULT_TIMEOUT and throws naming the
missing node. findItemNode keeps its short budget and undefined result for
absence checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci(insomnia-test): align workflow with test-e2e.yml

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(test): clarify comments on worker configuration and session handling

* feat(insomnia-test): add type-check script and workflow step

* fix(insomnia-test): update node setup to include GitHub package registry and scope

* chore(insomnia-test): address review cleanup items (#17-#27)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): update SKILL.md for improved test case writing guidance and remove outdated reference.md

* feat: add mock servers for various protocols and OAuth2 support

- Introduced `mock-bin-server.ts` for handling mock API requests and responses.
- Added `oauth2-server.ts` to simulate OAuth2 authorization flows with in-memory token management.
- Implemented `socket-server.ts` for WebSocket communication with authentication.
- Created `ws-echo-server.ts` for echoing WebSocket messages.
- Updated `upgrade-fixture.ts` to use `import.meta.dirname` for path resolution.
- Modified `package.json` to switch script files from `.js` to `.ts` for TypeScript compatibility.
- Adjusted Playwright configuration to reference TypeScript files for mock servers.
- Enhanced cloud sync mock to reflect changes in file extensions.
- Updated TypeScript configuration to allow importing TypeScript extensions.

* refactor(insomnia-test): migrate electron-builder config to TypeScript and remove outdated CJS version

* fix(insomnia-test): update ESLint config to include electron-builder.config.ts and clarify root config error

* refactor: update button locators to use role and test ID selectors

- Replaced various button locators using text matching with role and test ID selectors across multiple pages for improved accessibility and maintainability.
- Updated methods in GitSyncPage, GrpcRequestPage, HttpRequestPage, ImportPage, InvitePage, McpClientPage, MockServerPage, PreferencesPage, ProjectSettingsPage, RequestPage, ResponsePage, RunnerPage, ScriptTabComponent, SocketIORequestPage, TemplateTagPage, VariableSourcePage, and WorkspacePage.
- Enhanced code readability and consistency by standardizing locator strategies.

* feat: add step instrumentation for flow methods

- Introduced a new `step` decorator to enhance method reporting in flows.
- Removed the old step instrumentation logic from `step-instrumentation.ts`.
- Updated various flow classes to utilize the new `@step()` decorator for method tracking.
- Simplified page manager by removing the instrumentWithSteps function.
- Adjusted tests to ensure compatibility with the new step reporting mechanism.

* refactor: remove module type from package.json and update environment type handling

* test: verify logging of after-response script in HTTP request flow

* fix: make Insomnia binary and helper executables executable to prevent EACCES errors

* feat: add shard matrix job to dynamically calculate test distribution for parallel execution

* fix: improve tree row expansion logic to handle re-rendering issues

* fix: enhance expandAllCollapsed method documentation for clarity on toggle behavior

* refactor: update RequestAuthentication imports and definitions for consistency across models

* feat: add new components for UI interactions and refactor existing pages

- Introduced `TabsComponent`, `StatusTagComponent`, `PillTagComponent`, `ToastComponent`, `ToggleButtonComponent`, `PressedToggleComponent`, `EnabledLabelToggleComponent`, `SwitchComponent`, `CheckboxComponent`, `RadioGroupComponent`, `TooltipComponent`, and `TreeComponent` to enhance UI testing capabilities with Playwright.
- Refactored `AuthTabComponent`, `BasePage`, `CertificatesPage`, `CloudSyncPage`, `EnvironmentPage`, `HttpRequestPage`, `MockServerPage`, `RequestPage`, `ResponsePage`, `TabPanelPage`, and `WorkspacePage` to utilize new components for improved readability and maintainability.
- Updated methods for toggling states, reading values, and interacting with UI elements to leverage the new component structure.
- Enhanced test reliability by ensuring interactions are properly awaited and validated.

* refactor: sync product test ids and e2e framework changes from test/refactor_e2e_tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat: add data-selected attributes for improved testing and UI state indication

* feat: add Preferences dialog pages for AI settings, credentials, plugins, and vault management

- Implemented GitHistoryDialogPage for managing git history modal interactions.
- Created PreferencesAiPage for handling AI settings, including backend configuration and model selection.
- Developed PreferencesCredentialsPage for managing Git and cloud credentials.
- Added PreferencesPluginsPage for plugin management, including installation and sandbox settings.
- Introduced PreferencesVaultPage for vault key generation and management.
- Established PreferencesTabPage as a base class for shared functionality across preferences pages.

* refactor: simplify requireItemNode and related methods by removing unnecessary polling

* feat: implement flow and page registries for improved lazy loading of instances

* feat: refactor data handling and polling mechanisms for improved stability and performance

* feat: refactor flow management to use SessionContext for improved state handling

* refactor: read graphql root types via unique test ids

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix: use unique test ids for graphql explorer root types

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor: drop pinned-request special case when rebuilding sidebar tree

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor: update selection logic to use data-selected attribute for diff view and primitive selection

* refactor: replace NeDB file access with database queries for improved reliability

* refactor: update import paths to use absolute imports from @package

- Changed import statements across multiple files to use absolute paths from the @package alias instead of relative paths.
- This improves code readability and maintainability by standardizing the import structure.

* docs: add README for insomnia-test with E2E testing details

* refactor: update import paths for constants and fixtures in happy-path.spec.ts

* refactor: streamline file dialog stubbing across components and flows

* refactor: enhance GitHub Actions permissions and add artifact cleanup step

* refactor: simplify Playwright test execution and enhance coverage report handling

* ci(insomnia-test): print playwright --list output when test count cannot be determined

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor: replace createSubEnvironment with addAndRenameSubEnvironment for improved clarity and functionality

* refactor(insomnia-test): organise ResponseView by response pane areas

Replace the AppResponse-derived fields with statusBar, preview, headers,
console, events and tests so assertions map to what the user sees.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): use @package alias for cross-directory imports

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* style(insomnia-test): sort imports after switching to @package alias

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): replace hardcoded IDs with constants in mock-api

* refactor(insomnia-test): update SKILL.md for improved clarity and consistency in framework facts

* refactor(insomnia-test): enhance listbox locator in SelectComponent and improve textarea selection in VariableSourcePage

* refactor(insomnia-test): update timeout handling in Tree class to use LONG_TIMEOUT for better reliability

* feat(insomnia-test): add resolving-proxy-server mock facility

Forward proxy on :4095 that maps insomnia.test to 127.0.0.1 (http directly,
https via CONNECT). Lets specs reach the local mock servers without using
`localhost`, which Insomnia treats as a secure context for Secure cookies.
Started automatically through playwright.config.ts webServer.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): move cloud-sync-mock helper into misc

It wraps mock-api admin endpoints like the other shared helpers in misc/,
and tests/ should only hold specs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): update locators to use `Locator` type and improve dialog handling

* fix(insomnia-test): fix lint errors and warnings in page objects

Add a CommonJS override for plugin fixtures, drop force clicks and waitForTimeout from page objects, and avoid expect().catch().

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): enhance editable name handling with retry logic for stability

* refactor(insomnia-test): update shard calculation to cap at MAX_SHARDS for better resource management

* refactor(insomnia-test): update parallel-test job description for clarity on shard usage

* refactor(insomnia-test): update timeout handling and constants for improved stability and resource management

* feat(tests): add various E2E tests for cloud sync and workspace functionalities

* feat(tests): add E2E tests for spectral lint error handling in JSON and YAML specs

* feat(tests): enhance spectral lint error tests with project node verification

* test(insomnia-test): move unused page objects, components and models to e2e-2

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(insomnia-test): keep only members referenced by e1 tests in components/enums/flows/models/pages

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(insomnia-test): drop empty flow/page classes and tidy blank lines

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(insomnia-test): move cloud-sync and document specs out of e2e-1 and prune unused code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(insomnia-test): drop page registry entries, pages and members not used by e2e-1 specs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(insomnia-test): drop non-HTTP request models and unions unused by e2e-1 specs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor: reorganize FlowContext imports and introduce SessionContext for shared state management

* fix: limit response delay to maximum threshold in delayResponse function

* chore: move write-insomnia-test skill to test/refactor_e2e_tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* chore: move insomnia-test README to test/refactor_e2e_tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix: add permissions for package access and improve dependency installation in shard matrix job

* fix: streamline delayResponse function to ensure valid delay handling

* refactor: simplify ContextMenuItem enum by removing comments and consolidating labels

* fix: remove baseUrl from tsconfig.json to streamline module resolution

* refactor(insomnia-test): prune misc code not used by e2e-1 tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): address review feedback on deps, coverage and video

- align dependency versions with the rest of the monorepo (express ^4,
  zod ^3, graphql ^16, @types/node ^24, @modelcontextprotocol/sdk ^1.17.5)
  and regenerate package-lock.json
- make CI coverage on-demand: always on for develop pushes, opt-in via the
  workflow_dispatch `coverage` input otherwise
- drop video recording (and the ffmpeg install); start Electron window
  tracing explicitly and attach trace.zip on failure instead

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): replace the standalone mock servers with the smoke-test mock server

Remove the misc/*-server.ts scripts and their per-server webServer entries.
Run a single mock server (misc/server), copied from insomnia-smoke-test and
adapted to native-ESM node (import.meta.dirname, .ts imports, generated
certs, no cross-package imports).

Additions on top of the smoke server: misc/server/mock-api.ts (account and
session state, _admin hooks, Cloud Sync GraphQL, vault, collaborators; runs
as middleware and falls through), an httpbin-style /post, a catch-all 200 {}
and socket.io moved to :3000. HTTP_SERVER now points at the single server.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor: replace hardcoded authorization header with dynamic base64 encoding

* fix(insomnia-test): address code-scanning alerts in the mock server

- send text/plain and JSON responses instead of reflecting user input as HTML
- use a constant format string when logging GraphQL operations
- rate limit the git routes that touch the file system
- document why the mTLS test server skips client cert rejection

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): bump express-rate-limit to drop vulnerable ip-address

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* refactor(insomnia-test): move shared tab panes and preferences dialog to components

Address review feedback: auth-tab, script-tab and tab-panel are reused by
several pages, and the Preferences dialog is reachable from any page, so
they belong in the component layer rather than pages.

- TabPanelPage -> TabPanelComponent (RequestPage now composes it)
- AuthTabComponent / ScriptTabComponent move to components/
- Preferences{,Tab,Credentials,Plugins,Ai}Page -> *Component, registered
  in PageManager under preferences / preferencesCredentials / ...

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(insomnia-test): set response type to text/plain for delay endpoint

* chore(insomnia-test): remove unused fixture files

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 14:16:28 +08:00
Jay WuandClaude Sonnet 5.5 d94f8dbf72 ci: apply macOS stapling workaround before packaging app (#10661)
The pfctl rule that blocks QUIC (UDP 443) was only applied before the
Inso CLI stapling step. The app packaging step also staples through
https://api.apple-cloudkit.com and hits the same issue, so run the
workaround before "Package app (MacOS only)" instead.

Ref: actions/runner-images#14924

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 06:03:42 +00:00
Jay Wu 61922aea77 fix(ci): work around macOS stapling issue in release build (#10647)
Block outgoing UDP on port 443 before stapling the Inso CLI installer,
as a workaround for actions/runner-images[#14924](https://github.com/actions/runner-images/issues/14924).
2026-10-22 21:56:08 +08:00
kwburns-kong 19b4875499 fix: pin kong/release-script docker action to a digest (#10449)
The .deb upload step uses the mutable:latest tag instead of a pinned digest, swapping the action to use the digest.
2026-10-15 16:58:40 +00:00
Bart Smykla 14ea6d0f59 ci(ksai): start a KSAI run only for people who can write to the repository (#10578)
* ci(ksai): start a KSAI run only for people who can write to the repository

A comment or review now starts the KSAI run job only when its author
can write to this repository. A new authorize job reads the author's
permission with the workflow token, and the run job needs it. A
dispatched run starts as before.

Signed-off-by: Bart Smykla <bartek@smykla.com>

* ci(ksai): fail the authorize step when the permission read fails

A failed permission read used to answer writes=false with a green
job, so a writer's comment started nothing and the log said nothing.
The step now fails on a read error, the run job still does not start,
and the log names the error. An author who cannot write still reads
as writes=false.

Signed-off-by: Bart Smykla <bartek@smykla.com>

---------

Signed-off-by: Bart Smykla <bartek@smykla.com>
2026-10-09 07:04:27 +08:00
Bart Smykla bcaac3c08a ci(ksai): add KSAI through the public mirror (#10551)
A public repository cannot call a reusable workflow in the internal
KSAI repository, so the setup workflow fails before any job starts
with "workflow was not found". Call the published snapshot instead,
pinned to the current release and following its consumer template,
with every command enabled and a review on each opened pull request.

The snapshot names no model gateway of its own, so the call passes the
organization's gateway variable. It runs on GitHub-hosted runners,
because the Kong runner pool serves no public repository, and with no
GitHub App at all: push_as_app is false and no key is passed, so every
read and write goes through GITHUB_TOKEN.

Signed-off-by: Bart Smykla <bartek@smykla.com>
2026-09-24 16:50:31 +08:00
yaoweiprcandClaude Opus 5 f697cd847c chore(ci): make the cycle check runnable on Windows and report drift honestly (#10548)
Two independent papercuts in the circular reference check, both hit while
investigating a failure on another PR.

`npm run check-cycle-references` could not run on Windows at all. It spawned
the extensionless `node_modules/.bin/depcruise` shim through `execFileSync`,
which Windows cannot launch; the `.cmd` sibling does not help either, since
Node >=18 refuses to spawn `.cmd` without a shell (CVE-2024-27980). Resolve
dependency-cruiser's own entry point and run it with `process.execPath`
instead — no shell, works everywhere.

The check also fails on baseline drift (cycles recorded in the baseline that
no longer exist), which is correct: the baseline is a ratchet, and leaving a
fixed cycle in it would silently keep permitting its reintroduction. But CI
labelled every non-success outcome "New circular references detected", so a PR
that *removed* two cycles was reported as having added some. That cost real
debugging time.

Give the script distinct exit codes — 1 for a new cycle, 2 for drift alone —
and have the workflow capture and map them to separate messages. The failure
behaviour is unchanged; only the wording is now accurate. Renamed the final
step to match what it actually gates on.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-24 02:58:59 +00:00
Bingbing f08d65b45e chore: replace madge circular-reference check with dependency-cruiser (#10468)
## Summary

- Replaces the madge-based `check-cycle-references` with a `dependency-cruiser`-based check, cruised once per npm workspace package.
- Keeps the checker, dependency-cruiser config, and known-cycle baseline together under `scripts/circular-references/`.
- Uses a committed baseline to grandfather existing cycles while failing on new cycles and stale baseline entries.
- Cleans the existing `insomnia-inso` type cycle by using `insomnia-data`'s `AllTypes` instead of importing the database container type.
- CI explicitly uses Bash for correct `tee`/pipeline failure propagation, safely handles skipped checks, and posts a PR report.
- Dropped `madge`/`.madgerc`, added `dependency-cruiser`.
2026-09-10 16:11:43 +08:00
Bingbing 7c334de276 chore: remove KSAI workflow (#10478)
KSAI's reusable workflow at Kong/ksai isn't accessible from this repo, causing every run to fail with "workflow was not found".
2026-09-07 08:22:26 +00:00
Bingbing 1a5281c60f chore: add KSAI workflow (#10474) 2026-09-07 02:50:04 +00:00
amy-kong-hq 4c114c449f feat: e2e re-run only fails (#10457)
* debug: make case fail to test rerun last fail

* fix: last-run json not found

* fix: revert debug test steps
2026-09-02 08:17:14 +00:00
kwburns-kong 20b29355b3 fix: set persist-credentials: false on non-pushing actions/checkout steps (#10447)
actions/checkout steps across CI workflows leaves GITHUB_TOKEN persisted in git config after checkout. None of these steps perform a git push using that persisted credential, disable credential persistence on the actions.
2026-09-01 14:28:44 +00:00
kwburns-kong 31aac79c3a fix(release): resolve previous tag by semver precedence (#10408)
* fix(release): resolve previous tag by semver precedence, not publish order

GitHub's auto-detected previous tag for release notes ignores per-line
release branches, so out-of-order alpha/beta/hotfix tags can pull PRs
from an unrelated release into the notes. Compute the previous core@ tag
via real semver precedence instead, excluding a stable release's own
prereleases so it diffs against the prior stable release.

* fix(release): let ncipollo/release-action generate notes directly

Pass generateReleaseNotesPreviousTag to the release action instead of
calling GitHub's generate-notes API manually via curl - the action
already wraps the same endpoint with identical previous_tag_name
semantics, so this drops the redundant step.
2026-08-18 10:42:06 +08:00
Jack Kavanagh 9981c91156 fix(ci): skip circular refs PR comment when count is unchanged (#10391)
* fix(ci): skip circular refs PR comment when count is unchanged

Avoids noisy comment creation/updates on the circular references check
when the PR introduces no change vs the base branch.

* fix(ci): delete stale circular refs comment when count returns to no-change

Prevents a stale "warning" comment lingering on a PR after circular
references introduced earlier are fixed and the count matches base again.
2026-08-17 10:33:10 +08:00
Jay WuandVivek Thuravupala afaaec6f8d fix(build): macos latest (#10400)
* Revert "fix: revert electron-builder to previous version to fix macos build (#10394)"

This reverts commit 34c5010a81.

* use macos-15-large

---------

Co-authored-by: Vivek Thuravupala <2700229+godfrzero@users.noreply.github.com>
2026-08-14 06:26:12 -07:00
kwburns-kong a45f9688dd Add harden-runner to all CI workflows (#10300) 2026-08-04 19:18:10 +02:00
Jay Wu a91fe13859 fix: resolve cloudsmith auth error (#10321) 2026-08-03 14:18:04 +08:00
Jack Kavanagh 3842690f60 feat(templating): vetted npm libraries in the sandbox — uuid + ajv (M3) (#10244) 2026-07-16 12:53:23 +03:00
Fares Osman f70cda4366 chore: emit and upload junit test results per shard (#10253)
* chore: emit junit reports per e2e tests shard

* chore: include retries in junit reporter

* chore: test some stuff

* chore: test again

* chore: revert test
2026-07-15 13:49:26 -04:00
Pavlos Koutoglou a81ac68c39 feat: publish Insomnia file JSON Schema [INS-2794] (#10154)
* Modify the script in package.json

* Add script to generate the schema

* Schema generation docs

* Add CI check

* Generate the schema
2026-07-02 14:21:42 -04:00
Jay Wu b9a6d46728 feat(ci): add release_build check option to publish workflow (#10195)
* check release_build has been triggered before publishing

* address feedback
2026-07-01 11:35:43 +08:00
Jay Wu 01dacacd6b fix(ci): change release build workflow to manual trigger (#10139) 2026-06-23 17:56:46 +08:00
Jay Wu 58787017ba fix(ci): preventing duplicate E2E runs (#10077) 2026-06-17 11:31:26 +08:00
Vivek Thuravupala 4d0901f111 chore: bump/inline actions off of Node 20 runtime (#9983)
* chore: bump easily bumpable actions off of Node 20 runtime

* chore: bump remaining actions or replace with inline logic where Node 24 versions are unavailable

* refactor: remove variable interpolation in run blocks as flagged by Semgrep
2026-06-09 06:16:27 +00:00
Ryan Willis 7f609226ac fix: packaged inso segfault patch via pkg-safe consola reporter (#10035) 2026-06-08 19:30:58 +00:00
Jack KavanaghandClaude Sonnet 4.6 79c544238b feat: disable nodeIntegration in renderer mainWindow, remove Node import check tooling (#9996)
* Add vault-crypto/mime utilities and remove heavyweight third-party imports

- Add AES-GCM vault-crypto utility with tests (replaces node-forge usage)
- Add common/mime.ts to replace mime-types package dependency
- Replace tough-cookie import in response-cookies-viewer with inline parser
- Replace @grpc/grpc-js status import in grpc-status-tag with inline constant
- Replace electron.ipcRenderer in auth.clear-vault-key with showToast()
- Remove unused analytics call from window-utils

* Fix impure Date.now() key on CodeEditor; use setValue via ref instead

Replace key={Date.now()} with a useEffect that calls editorRef.current.setValue(snippet)
whenever snippet changes, keeping the editor mounted. Also apply prettier fixes from quick-check.

* fix: address Copilot review comments on PR #9992

- vault-crypto: replace forge-in-renderer with IPC bridge (main process
  retains forge; renderer calls window.main.vault.{en,de}cryptSecretValue)
- mime.ts: expand lookup table to 48 entries (webp, wasm, mp4, docx, xlsx,
  fonts, audio/video, etc.) and fix remaining mime-types import in send route
- response-viewer: move charset alias map to module level; normalise iconv-lite
  alias names (utf8, latin1, win1252, …) to WHATWG labels for TextDecoder
- auth.clear-vault-key: fix typo "all you local" → "all your local"

* fix: sort imports in send route

* feat: disable nodeIntegration in renderer mainWindow, remove import check tooling

- Set nodeIntegration:false and contextIsolation:true on mainWindow webPreferences
  (hidden window keeps nodeIntegration:true for user script execution)
- Split script-security-rules.ts out of script-security-policy.ts so the renderer
  can import display-only constants without pulling in require-interceptor
- Add templating/renderer-safe.ts with Node-free render/reload/getTagDefinitions;
  update all renderer callers to import from it instead of templating/index
- Split insomnia-testing generate.ts: move generateToFile to generate-to-file.ts
  so generate() has no Node imports; expose generateToFile from new entry point
- Move runTests execution to main process via IPC (run-tests channel) so the
  renderer routes no longer import the Mocha-backed test runner directly
- Delete vite-plugin-electron-node-require.ts, check-renderer-node-imports.ts,
  renderer-node-import-baseline.json and all related scripts/plugins now that the
  renderer bundle is free of Node built-in imports

* fix: sort imports, use static TestResults type, remove unused analytics import

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* remove mime stuff

* remove ci step

* update plan

* insomnia testing adapter

* use export method

* trick react router ssr

* add renderer errors

* globalThis

* improve error

* move plugin types

* ipc validate proto

* fix import

* plugin types

* polyfill events for jshint

* restore node require plugin

* vault adapter

* add crypto bridges

* tough-cookie ipc

* util stub

* split cookie into network adapter

* assert

* fix plugin index import

* serialise cookie

* decouple renderer from scripting

* Fix rebase conflicts and import path issues

- Fix incorrect ~/insomnia-data imports (should be insomnia-data package)
- Remove non-existent mime utility imports and provide simple fallback
- Remove incorrect analytics call from main process
- Remove unused imports (Settings, Cookie)
- Fix Response type annotation for getResponseBodyBuffer

* lint

* fix tests

* fix: use dynamic import for crypt in session.ts for main process compatibility

The session.ts module is used in both renderer and main process contexts (via sync.invoke IPC handlers). When running in the main process, window.main is undefined, causing TypeError when trying to access window.main.crypt.decryptAES().

Changes:
- Use dynamic import of crypt module (only loaded in main process context)
- In renderer: window.main.crypt is always available so dynamic import never executes
- In main process: dynamic import loads crypt with node:crypto support
- Protect loginStateChange() calls with window existence checks

This avoids bundling node:crypto in the Vite renderer build while still supporting both execution contexts.

Fixes E2E test failures in sync operations (remoteBackendProjects, _assertSession, etc.) caused by disabled nodeIntegration.

* fix: add aria-label to template tag preview and browser-safe encoding fallback

- Add aria-label="Live Preview" to textarea in TagEditor for better Playwright accessibility
- Add atob() fallback for decodeEncoding in browser contexts where Buffer isn't available
- Fixes smoke test element discovery for template tag preview modal

* fix: add explicit waits for element stability in environment test

Add toBeEnabled() and toBeVisible() waits before clicking elements in the
'kv pair environment can be updated' test. This prevents timeout errors from
unstable/flickering elements during modal interactions, especially in
high-concurrency shard execution.

* remove unused

* add autocomplete generate test step

* fix lint

* put analytics back in

* combine vault and crypto adapter

* remove unused export split

* remove insomnia-testing cruft, addressing feedback

* fix: use direct imports in insomnia-inso after insomnia-testing index.ts removal

* fix circular reference

* fix: move createElectronNotifier to main process to fix SSR error

Move the electron-dependent createElectronNotifier function from repo-file-watcher.ts
to git-service.ts to prevent electron imports from being evaluated in the renderer/SSR context.

* export har ipc bridge

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 13:40:44 +08:00
Jay Wu d61526496e fix(e2e): run e2e for release branches (#10004) 2026-06-03 00:40:24 +00:00
Jay Wu 40282dea66 chore: comment out smctl credentials save in workflow (#9898)
the command is no longer executed while keeping it in place for future reference.
2026-05-06 17:42:58 -07:00
kwburns-kong c8bdd6b1b7 chore: Security update for dependencies and github workflows (#9884)
* chore: resolves INS-2457, INS-2458, INS-2459, and INS-2460.
2026-05-01 09:45:33 -07:00
Jay Wu e68fb4db48 chore: decouple releases (#9842)
* INS-2145 Decouple releases

* fix security error

* fix

* check version
2026-04-23 17:27:44 +08:00
Ryan Willis d109903243 chore: resolve GHA warning annotations and reduce CI time [INS-2312] (#9839) 2026-04-22 10:44:47 -07:00
kwburns-kong 812611c38d chore: applied PoLP to workflows (#9840) 2026-04-22 16:56:10 +00:00
Jack Kavanagh 3ec916e436 Chore: ratchet renderer nodejs calls (#9803)
* limit new nodejs calls

* plan

* ignore tests

* perf

* clean up
2026-04-13 13:33:57 +00:00
kwburns-kong 02213242fe chore: restrict GITHUB_TOKEN permissions in test-cli and test-e2e workflows (#9779) 2026-04-03 20:43:53 -04:00
Ryan Willis bbf8150091 chore: bump GHA steps to latest major (#9745) 2026-03-24 15:59:58 -07:00
Ryan Willis e6c51d59c1 chore: upgrade to electron 41.0.3 and node 24.14.0 (#9734)
* chore: upgrade to electron 41.0.3 and node 24.14.0
2026-03-24 15:05:41 -07:00
Balu George 15bafdfb44 Bump container image scan action to v6.1.0 (#9690) 2026-03-04 08:13:58 +00:00
Kent Wang 01c512ae34 feat: Allow empty credential configs to work with cloud providers (#9499)
* support empty credential config
* update plugin package
* update yaml for fix test error
2025-12-26 10:18:37 +08:00
Bingbing a4250a53e3 chore: add circular reference check (#9065) 2025-12-23 02:44:40 +00:00
Jay Wu ef229e6176 chore: pin external github ations to commit SHA (#9417) 2025-12-16 06:26:52 +00:00
Balu George b553c62a63 Modify client cert path 2025-12-12 22:14:36 +05:30
Balu George 1562c71aa7 Hardcode cert path for release 2025-12-12 19:08:48 +05:30
Balu George 92b186510c Decrypt keypair before trust manager setup (#9478) 2025-12-12 14:41:51 +05:30
Balu George 7f0ff46f8d Fix Insomnia windows build signing and path for inso.exe signing (#9474)
* Fix incorrect path for inso.exe

* Fix windows build
2025-12-12 14:12:06 +05:30
Balu George 12b54b0ae7 Modify the windows app signing process to use the new certificate (#9472) 2025-12-12 07:33:00 +00:00
Jack Kavanagh 2f4e3a8e65 run prettier (#9431) 2025-11-26 11:19:07 +00:00
Curry Yang 24b4251ad1 fix: nuget version 2025-11-14 16:25:04 +08:00
Curry Yang 0990a46f6a feat: add squirrel windows sign check - [INS-1338] (#9361)
* feat: add windows sign check

* fix: dir

* feat: sign check in CI

* add comment

* fix
2025-11-14 11:38:08 +08:00
1b6c776214 feat: LLM integrations + preferences (#9296)
* feat: integrate AI plugin and configure LLMs in preferences (#9192)

* poc: LLM configuration

* fix formatting + tidy script

* fix openpath type send method

* exempt node_modules from vitest

* reset package-lock for inso build

* switch from send/on to invoke/handle

* switch to pluginData

* remove unnecessary animation

* remove extraneous external defs in frontend bundle config

* rebase fix

* feat: mock server gen (#9201)

* add ipc handler methods in front of llm config service (#9202)

* feat: gemini first class config support (#9209)

* feat: add gemini as a backend

* fix: save api key the first time

* chore: call plugin from utility process (#9210)

* feat: additional mock server event tracking (#9215)

* feat(Git Commit): Automatically generate commits (#9164)

* feat: add AI-generated commit message functionality in staging modal

* feat: enhance AI commit message generation with error handling and improved UI

* fix: update button icon and text for commit generation state in staging modal

* feat: add diff functionality to Git service and integrate with AI commit message generation

* feat: update isomorphic-git to version 1.33.1 and add stash functionality to Git VCS

* feat: implement multiple commit functionality for Git VCS and integrate with staging modal

* feat: add validation for staged changes before generating commit messages

* feat: implement generateCommitsFromDiff functionality for AI commit message generation

* Cleanup staging modal and use tree data for reordering and submitting multiple commits

* Revert "feat: update isomorphic-git to version 1.33.1 and add stash functionality to Git VCS"

This reverts commit b731372debdfb07ac118d84900c2cecb635a34b4.

* feat: update type definitions for diff changes in Git VCS

* refactor: remove console logs and commented code from staging modal and AI commit generation

* feat: implement git commit generation process using a separate utility process for improved error handling and performance

* fix: improve error handling messages in AI commit generation

* chore: update optional dependency for AI plugin to alpha version 1.0.3

* fix: ensure data dir exists prior to reading (#9220)

* fix: ensure data dir exists prior to reading

* rename handler

* feat: mock server gen ux improvements (#9221)

* fix: include mockgen script in build (#9222)

* feat: add git commit generation process to build script (#9226)

* fix: set min height for git folder selector (#9242)

* chore: ai plugin 1.0.4 (#9243)

* feat: toggle ai features (#9232)

* feat: track commit generation and saving events for analytics (#9293)

* feat: add analytics tracking for commit message generation events

* fix: update segment event names to camelCase for consistency

* Update package-lock with the plugin modules

* fix(build): add x64ArchFiles option back (#9297)

* fix: autoselect self hosted mock when cloud mock disabled (#9299)

* fix: hide ai settings from scratch pad user (#9300)

---------

Co-authored-by: Shelby Moore <13246465+shelby-moore@users.noreply.github.com>
Co-authored-by: James Gatz <jamesgatzos@gmail.com>
2025-10-23 10:41:39 +02:00
Curry Yang bec951ee5d fix: sentry sourcemap - [INS-1255] (#9249)
* fix: sentry sourcemap

* fix: publish sentry

* use Wildcard Pattern for sub path
2025-10-16 16:17:57 +02:00