Repository navigation
chore(release): promote release to master - #42656
Conversation
…e type and error bugs found in testing (#42639) ## Description This PR has five parts. 1. **Driver upgrade.** The SQL Server plugin moves from `mssql-jdbc` 11.2.4.jre11 to 13.6.2.jre11, the latest stable release. Later SQL Server authentication work needs it. Per-user Microsoft Entra tokens need `accessTokenCallback` (12.4), and Kerberos on Java 23 and later needs 12.9. The image runs Java 25. 2. **Host check.** The host goes into the JDBC URL as it is. So a host such as `db;authenticationScheme=NTLM` could add connection properties. `validateDatasource` and `createConnectionPool` now refuse a host with `;`, `=`, `{`, `}` or a control character. The database name already had this check. A named instance (`host\SQLEXPRESS`) is still accepted. 3. **Column types that always failed.** Any SELECT that included a `rowversion` or `datetimeoffset` column failed, on the old driver and the new one, and so did a `sql_variant` holding a `datetimeoffset`. All now return a value. 4. **Errors from later statements.** In a query with several statements, an error after the first statement was hidden. The query reported success and the first statement's count, while earlier statements committed. It now fails with the error. 5. **Bound time values.** `WHERE time_col = {{…}}` with prepared statements on failed ("time and datetime are incompatible"). The URL now sets `sendTimeAsDatetime=false`. Parts 3 to 5 were found by testing every SQL Server type, with prepared statements on and off. Each was the same on 11.2.4 and 13.6.2. The full test plan and results are in Notion: [SQL Server driver upgrade test plan](https://app.notion.com/p/41bfe271b0e2818fb151c2f1ef3096a1), sections 10 to 12. The driver is declared only in `mssqlPlugin/pom.xml`. Each plugin loads with its own class loader, and 13.6.2 adds no required dependencies, so no other integration is affected. Fixes https://linear.app/appsmith/issue/APP-16536 Fixes https://linear.app/appsmith/issue/APP-14437 (`rowversion`: "The conversion from timestamp to DATE is unsupported") Fixes https://linear.app/appsmith/issue/APP-15393 (`datetimeoffset`: "Java 8 date/time type `java.time.OffsetDateTime` not supported") ### Changes | File | Change | | -- | -- | | `mssqlPlugin/pom.xml` | `mssql-jdbc` 11.2.4.jre11 to 13.6.2.jre11 | | `MssqlPlugin.java` | Adds `vectorTypeSupport=off;` to the URL, so a `vector` column (SQL Server 2025, Azure SQL) still comes back as a JSON string. Adds the host check in `validateDatasource` and before the URL is built. | | `MssqlErrorMessages.java` | New `DS_INVALID_HOST_ERROR_MSG` | | `MssqlExecuteUtils.java` | Returns `rowversion` as hex and `datetimeoffset` as ISO 8601 text with its offset | | `MssqlDriverBehaviourTest.java` (new) | Pins the JSON value of each column type, `affectedRows`, the failed-login message, the vector setting, and the `rowversion` and `datetimeoffset` formats (NULL, offset 0, a negative offset, no fraction, a view). Values for the other types were recorded on 11.2.4. Every case runs with prepared statements on and off. | | `MssqlHostValidationTest.java` (new) | Accepted and refused hosts, in validation and in `datasourceCreate` | ### Behavior changes - **A multi-statement query now fails when any statement fails.** The message is "A statement in this query failed. Other statements in the query may already have run. <SQL Server message>". Statements that already ran are not undone. An app whose success handler ran for such a query will now get its error handler. `affectedRows` is still the first statement's count. - **A bound time value is sent as `time`.** A time filter works. A bound time written into a `datetime` column gets the date 1900-01-01, not 1970-01-01. Time-like text bound into a `varchar` column is stored as `13:45:30.0000000`, not `Jan 1 1970 1:45PM`. - **`affectedRows` for an insert that fires a trigger, with prepared statements off.** It is now the insert's own count. Before, it was the trigger's count. For example, an insert of 1 row whose trigger writes 3 rows now reports 1, not 3. With prepared statements on (the default), it still reports 3. No driver setting restores the old value. A trigger with `SET NOCOUNT ON` has no count of its own, so it is not affected. - **A host with `;`, `=`, `{`, `}` or a control character is refused** with "Invalid host: the host must not contain ';', '=', '{', '}' or control characters." A saved datasource with such a host now fails Test configuration and queries until the host is fixed. - **Test configuration fails faster.** A wrong database, a refused port or an unknown host now fails in about 1 second, not about 30. An unreachable address fails in about 9 seconds, not about 31. The error messages are the same. Everything else matched on both drivers: every column type, the other update counts, error messages, a query longer than 30 seconds, and a connection reused after sitting idle. ### `rowversion` and `datetimeoffset` (fixed in this PR) The column-type handling in `MssqlExecuteUtils` matched Postgres type names, so on both drivers: - **`rowversion`** failed with "The conversion from timestamp to DATE is unsupported". SQL Server reports it as `timestamp`, and the plugin read the 8 bytes as a date. It now comes back as hex, such as `0x0000000000000FA1`, as SQL Server Management Studio shows it. - **`datetimeoffset`** failed because the plugin returned the driver's `DateTimeOffset` object, which the JSON mapper cannot write. It now comes back as ISO 8601 text that keeps the offset and every fractional digit, such as `2024-02-29T13:45:30.1234567+05:30`. Notes for reviewers and users: - Offset 0 prints as `Z`, and trailing zeros in the fraction are dropped. For example, `13:45:30.1200000 +00:00` becomes `2024-02-29T13:45:30.12Z`. - `rowversion` is hex, while `varbinary` stays base64. `rowversion` is a version token, and hex is how SQL Server shows it. - **To pass a `rowversion` back into a query, convert it.** With prepared statements on, the value is sent as text, and SQL Server does not read text as hex. So `UPDATE … WHERE rv = {{Table1.selectedRow.rv}}` never matches and **silently updates 0 rows, with no error**. This is the usual optimistic-locking pattern, where 0 rows normally means "someone else changed the row", so the mistake is easy to miss. Use `WHERE rv = CONVERT(binary(8), {{Table1.selectedRow.rv}}, 1)`. This is not a regression, because the column could not be read before. It needs to go into the SQL Server page of the docs. - A `datetimeoffset` value inside a `sql_variant` column still fails the query, before and after this PR. A `sql_variant` that holds any other type works. - No app could depend on the old behavior, because these SELECTs always failed. ### Rollback - **A driver problem:** revert only the version line in `mssqlPlugin/pom.xml`. That keeps the host check. On 11.2.4, with every other change in place, all tests pass except the trigger counts above. 11.2.4 accepts `vectorTypeSupport`. - Reverting the whole PR also removes the host check. - No saved data changes. Fresh installs and upgrades need no configuration change. ### Next The "Enabled, verify certificate" SSL mode is the follow-up PR ([APP-16551](https://linear.app/appsmith/issue/APP-16551)). ## Automation /ok-to-test tags="@tag.All" ## Testing - [ ] Client unit tests - [x] Server unit tests - [x] Cypress - [ ] Playwright - [x] Deploy preview - [ ] Not applicable Local runs (SQL Server 2022, Testcontainers, Java 25): - 13.6.2: 98 of 98 plugin tests pass, 69 of them new, on SQL Server 2019, 2022 and 2025 (`-Dmssql.test.image=…`). The type snapshot also passes in UTC and in America/Los_Angeles. - `MssqlDataTypeMatrixTest` pins about 60 type cases: a literal insert, a bound insert with prepared statements on and off, a read in both modes, and a bound filter in both modes. Results: `src/test/resources/mssql-data-type-matrix.txt`. The file is the same on 2019, 2022 and 2025. - On SQL Server 2025, `json` and `vector` work. Without `vectorTypeSupport=off`, `vector` comes back as unreadable bytes, so the setting is needed. - 11.2.4 with every other change in place (pom-only rollback): everything passes except the trigger count and 2 matrix lines. On 11.2.4, a `datetimeoffset` of 0001-01-01 comes back 2 days early, and 13.6.2 fixes that. - With the old `MssqlExecuteUtils`, the type snapshot fails with "The conversion from timestamp to DATE is unsupported". - A local script compared error messages, failure times, a 35-second query and idle reuse on both drivers. - OSV lists no vulnerabilities for either driver version. Deploy preview (https://ce-42639.dp.appsmith.com, built from 2112465) against **Azure SQL** (`Microsoft SQL Azure (RTM) - 12.0.2000.8`, AdventureWorksLT): - An existing app with a generated CRUD page works. - The schema browser lists the tables and columns. - `rowversion` returns `0x0000000000000FA1`, and `datetimeoffset` returns `2024-02-29T13:45:30.1234567+05:30`. Offset 0 returns `2024-02-29T13:45:30.12Z`, and `SYSDATETIMEOFFSET()` returns a value. - With prepared statements on, `binary = {{"0x0000000000000FA1"}}` gives no match, and `binary = CONVERT(binary(8), {{"0x0000000000000FA1"}}, 1)` gives a match. This confirms the note above. Deploy preview (built from 3df0a34) against Azure SQL, round 2: - A test table with 20 column types, including `json` and `vector(3)`. Created, written with literals and with bindings, and read back with prepared statements on and off. - Bound filters on `time`, `date`, `datetimeoffset`, lower-case `uniqueidentifier`, `nvarchar` with Japanese and emoji, `datetime`, `bigint` as text, and `rowversion` with `CONVERT`. All match. - A multi-statement query with a failing second statement now fails with the new message, with prepared statements on and off. - Trigger count: 3 with prepared statements on, 1 with them off. The same as locally. SQL Server 2019 now runs in the automated tests. The cases not yet run are listed in the test plan, section 11. Suggested Cypress tags or specs: `@tag.Datasource` (MsSQL_Basic_Spec, MsSQLDataSourceStub_spec, Port_Number_Placeholder_Spec) ## Communication Should the DevRel and Marketing teams inform users about this change? - [x] Yes - [ ] No Release note: the SQL Server driver is upgraded. A query with several statements now fails when any statement fails, instead of reporting success. A bound time value can now filter a `time` column. Queries that return `rowversion` or `datetimeoffset` columns now work: `rowversion` comes back as hex (`0x…`), and `datetimeoffset` as ISO 8601 text with its offset. With prepared statements off, `affectedRows` for an insert that fires a trigger now counts the insert's rows. Hosts containing `;`, `=`, `{` or `}` are refused. A `sql_variant` holding a `datetimeoffset` now works too. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/44195328704> > Commit: 38fd1b8 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=44195328704&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Tue, 17 Nov 2026 23:40:40 UTC <!-- end of auto-generated comment: Cypress test results --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…42623) Co-authored-by: Amelia <101268423+amelia-c0n@users.noreply.github.com>
Problem: `Hubspot_spec.ts` ran its queries against the live Hubspot API through release cloud-services. Since 15:37 UTC on 2026-11-17, Hubspot has answered `403 Forbidden` for the test token. Every PR run that includes the spec fails, on every retry, in both repositories. The fix: Tests 2, 3 and 5 stub `POST /api/v1/actions/execute` with fixtures, so no test in the spec calls Hubspot. The spec now checks Appsmith's own behavior: the datasource form, the query editor, the response pane, the error pane, widget binding and deploy. Tradeoff: No Cypress run, nightly included, proves that a Hubspot query works end to end through cloud services. Nobody can maintain that path today, because the Hubspot account that owns the test token is not documented. Linear: https://linear.app/appsmith/issue/APP-16554 ## Changes - `Hubspot_spec.ts`: - Tests 2, 3 and 5 stub the execute endpoint and keep the `postExecute` alias. The same pattern is in `DataSources.ts`, in `StartInterceptRoutesForMongo()`. - Test 2 asserts that the response pane shows the table. Test 5 asserts that the error pane shows the downstream 401 message. - The retry loop and the comments about Hubspot connection resets are removed. They existed only for the live call. - Test 1 fills the form with a placeholder token. Saving a Hubspot datasource makes no call to Hubspot. - `hubspot_POST_Execute.json`: a HubDB table response for `appsmith1`. - `hubspot_POST_Execute_Unauthorized.json`: a failed execution with `pluginErrorDetails`. The editor shows plugin error details, not the body, for REMOTE plugins such as Hubspot. ## Related - This change supersedes #42590, which adds a retry for a Hubspot connection reset in test 3. That PR can close when this one merges. - The spec no longer reads `HUBSPOT_TOKEN`. Removing the secret from the four `ci-test-*.yml` workflows and `DataManager.ts` is a separate change. ## Automation /ok-to-test tags="@tag.Hubspot" 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/44198112990> > Commit: 1eb751e > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=44198112990&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Hubspot` > Spec: > <hr>Tue, 17 Nov 2026 23:32:22 UTC <!-- end of auto-generated comment: Cypress test results --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…run (#42654) ## Description A re-run of a Cypress workflow run fails in shards that passed in an earlier attempt, and in shards that failed before Cypress ran. Today the only way out is a new push. Fixes https://linear.app/appsmith/issue/APP-16570 ### Cause `ci-test-custom-script.yml` stores each shard's result in the Actions cache under one key per shard (`<run_id>-ci-test-<shard>`). A cache entry cannot be overwritten, so the first result stays for the whole run. 1. **A shard that passed fails on "Re-run all jobs".** Its stored result is `success`, so the setup steps (including `yarn install`) are skipped. `Run the cypress test` had no condition, so Cypress still ran without dependencies: `Cannot find module '@simonsmith/cypress-image-snapshot/plugin'`. 2. **A shard that failed before Cypress ran never recovers.** Any failure stored `failedtest`, even an image-pull timeout. Every later attempt took the splitter's re-run path (`CYPRESS_RERUN=true`), found no failed specs for the previous attempt, and threw "The previous attempt recorded no results for this runner". "Re-run all jobs" does not help, because it reads the same cache entry. ### Change - **One cache entry per attempt.** The key is `<run_id>-ci-test-<shard>-<attempt>`. `actions/cache/restore` returns the newest earlier entry by prefix. The trailing `-` keeps shard 1 from matching shard 10. `actions/cache/save` stores the entry at the end of the job on every outcome. - **Three results:** | Result | When | Next attempt | |---|---|---| | `success` | Cypress step passed | Skips the shard | | `failedtest` | Cypress step failed | Runs only the specs this attempt recorded as failed (unchanged) | | `incomplete` | Cypress did not run, or spec allocation failed (the splitter's `Spec allocation failed for this runner.` line is in `cy-repeat-output.txt`) | Runs the full shard | - **The splitter points back.** A comment on the `Spec allocation failed for this runner.` line in `cypress-split-static.ts` names the workflow that reads it. - **A shard that already passed skips the work.** The image load/pull, Chrome install, Cypress, and the two `always()` docker-log steps now skip when the previous result is `success`. The docker-log steps would otherwise fail, because no `appsmith` container exists. ### How a skipped shard is read - `ci-test-result` (in `pr-cypress.yml`) reads `needs.ci-test.result`, and a skipped shard ends green. - Its DB query covers failed specs of the current attempt only, and a skipped shard adds none. ### Out of scope - **Siblings.** `ci-test-limited.yml` and `ci-test-limited-with-count.yml` keep cause 2, and `ci-test-hosted.yml` keeps both causes. Each one is built differently, so each needs its own design and test run. Follow-up: https://linear.app/appsmith/issue/APP-16571 - **Splitter re-run lookup.** The splitter reads attempt `N-1`, not the attempt that stored `failedtest`. A shard that did not run in attempt `N-1` records `incomplete` and recovers one attempt later. This predates the change. - **Old runs.** A re-run uses the workflow file of the original run, so runs started before this merges keep the old behaviour. ### Impact on existing instances None. This is a CI-only change. ### EE The change was validated first in the EE repository. This PR carries all of it except one EE-only line, the skip guard on an EE-only step, which lands in EE after this PR syncs. ### PR score **87/100** (commit `2cc32cc3f8`). Fixes both root causes in APP-16570. The main deduction: no Actions re-run has tested the new cache and result logic yet. <details> <summary>Score breakdown (87/100 raw points)</summary> | Parameter | Score | Notes | |---|---|---| | Intent & Mental Model Alignment | 25/25 | Matches all three fix bullets in APP-16570: one cache entry per attempt restored by prefix, a condition on `Run the cypress test`, and `success` / `failedtest` / `incomplete` from `steps.run_cypress.outcome`. No unrelated changes. | | Completeness & Blast Radius | 23/25 | Every step that prepares for Cypress or reads its container is guarded. All three callers (`pr-cypress.yml`, `build-client-server.yml`, `test-build-docker-image.yml`) are covered. -2: the three sibling workflows keep related defects (APP-16571). | | Code Quality & Simplicity | 17/20 | Small and clear; the outcome reaches the shell through `env:`. -2: `incomplete` relies on a literal splitter log line, kept in step only by comments on both sides. -1: the splitter's "re-run the whole workflow" advice is now stricter than needed. | | Test Efficacy & Verification | 12/20 | `actionlint` reports nothing new. -8: no Actions re-run has exercised the prefix restore, the skip path or the `incomplete` path yet. | | Performance & Operational Safety | 10/10 | No `${{ }}` inside `run:`, tiny cache entries, and passed shards skip the image pull, `yarn install` and Chrome install on a re-run. | </details> ## Automation /ok-to-test tags="@tag.All" ## Testing - [ ] Client unit tests - [ ] Server unit tests - [x] Cypress - [ ] Playwright - [ ] Deploy preview - [ ] Not applicable Validation plan: run Cypress on this PR. Then use "Re-run all jobs" and check that shards that passed restore an earlier attempt's key, skip Cypress and end green, and that `ci-test-result` passes. `actionlint` reports no new findings; the two removed were in deleted steps. ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/44374487566> > Commit: 2cc32cc > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=44374487566&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Wed, 18 Nov 2026 19:31:56 UTC <!-- end of auto-generated comment: Cypress test results --> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
| try (ResultSet laterRows = statement.getResultSet()) { | ||
| while (laterRows != null && laterRows.next()) { | ||
| // Nothing to keep. | ||
| } |
There was a problem hiding this comment.
AIP-FD-38: Unbounded discarded MSSQL result traversal can exhaust execution resources
MssqlExecuteUtils.drainRemainingResults reads every row in every later JDBC result set even though those rows are discarded. An attacker must have permission to execute an MSSQL action whose query produces a large later result set. The loop has no row, byte, or result-set budget, and the blocking callable has no JDBC cancellation hook when the reactive timeout fires. The concrete result is avoidable CPU, network, JDBC-driver, worker, and pooled-connection consumption that can reduce availability for other actions.
Steps to Reproduce
-
In an isolated test workspace, grant a test account permission to execute an MSSQL action and configure that action to return a small first result followed by a later result set with a large, test-controlled row count.
-
Trigger the action through the normal Appsmith action-execution flow while monitoring the MSSQL connection pool and plugin worker activity. Check that the response contains only the first result and that execution continues while the later rows are traversed.
-
Trigger the same action concurrently from the permitted test account. Check whether available MSSQL pool connections and plugin workers remain occupied until the later result traversal completes or the JDBC operation is cancelled.
-
Repeat the control with an action that returns only the first result set. Compare the worker and connection occupancy of the two actions.
Fix with AI
A security vulnerability was found by Hacktron.
File: app/server/appsmith-plugins/mssqlPlugin/src/main/java/com/external/plugins/utils/MssqlExecuteUtils.java
Lines: 173-176
Severity: medium
Vulnerability: Unbounded discarded MSSQL result traversal can exhaust execution resources
Description:
MssqlExecuteUtils.drainRemainingResults reads every row in every later JDBC result set even though those rows are discarded. An attacker must have permission to execute an MSSQL action whose query produces a large later result set. The loop has no row, byte, or result-set budget, and the blocking callable has no JDBC cancellation hook when the reactive timeout fires. The concrete result is avoidable CPU, network, JDBC-driver, worker, and pooled-connection consumption that can reduce availability for other actions.
Proof of Concept:
**Steps to Reproduce**
1. In an isolated test workspace, grant a test account permission to execute an MSSQL action and configure that action to return a small first result followed by a later result set with a large, test-controlled row count.
2. Trigger the action through the normal Appsmith action-execution flow while monitoring the MSSQL connection pool and plugin worker activity. Check that the response contains only the first result and that execution continues while the later rows are traversed.
3. Trigger the same action concurrently from the permitted test account. Check whether available MSSQL pool connections and plugin workers remain occupied until the later result traversal completes or the JDBC operation is cancelled.
4. Repeat the control with an action that returns only the first result set. Compare the worker and connection occupancy of the two actions.
Affected Code:
try {
while (true) {
if (statement.getMoreResults()) {
// A later SELECT can fail while its rows are read, for example on a divide by zero in row 5.
// Step through its rows (they are not returned) so that error surfaces too.
try (ResultSet laterRows = statement.getResultSet()) {
while (laterRows != null && laterRows.next()) {
// Nothing to keep.
}
}
} else if (statement.getUpdateCount() == -1) {
break;
}
}
} catch (SQLException e) {
Acceptance criteria:
- Acceptance is defined by the **actual reported behavior**, not by tests passing.
- Reproduce the issue, or narrow the exact code path that produces it, *before* changing code. State what you confirmed.
- Fix the underlying cause. Mitigations that paper over the reported behavior do not count as a fix.
- Add a regression test that fails on the unpatched code and passes on the fix. If a regression test is genuinely impractical (e.g. race condition, infra-level issue), say so and explain why.
- Existing tests passing is **not** the bar. Do not declare done on tests-pass theatre.
Only change what is necessary to fix this vulnerability. Do not refactor adjacent code or modify unrelated files.
Triage: Reply !fp <reason> (false positive), !valid (confirmed), !accepted_risk <reason>, or !fixed (resolved). Any other reply is saved as a triage note.
Reason is optional but improves future scans — e.g. !fp internal endpoint, not user-facing.
There was a problem hiding this comment.
Subrata Dey Pappu commented:
cc: @U07PGE3DJ74
Description
Promote
releasetomaster.Commits
Automation
/ok-to-test tags=""
Warning
Tests have not run on the HEAD a93a40e yet
Thu, 19 Nov 2026 05:34:29 UTC