Skip to content

Commit

Permalink
Merge pull request #6889 from TouK/release1.17-to-staging-merge
Browse files Browse the repository at this point in the history
Release 1.17 -> staging merge
  • Loading branch information
arkadius authored Sep 18, 2024
2 parents 3f1e660 + 9d36b31 commit 0c5ee69
Show file tree
Hide file tree
Showing 41 changed files with 277 additions and 307 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ jobs:
if-no-files-found: ignore
- name: Create Pull Request
id: update_snapshots
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v7
if: always() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
env:
HASH: ${{ format('#{0}', github.event.number) }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
openapi: "3.0.0"
info:
title: Simple API overview
version: 2.0.0
paths:
/customer:
post:
summary: Returns ComponentsBykeys.
requestBody:
description:
Keys of the Customers.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MultiKeys'
responses:
'201':
description:
OK
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'

components:
schemas:
MultiKeys:
type: array
minItems: 1
items:
type: object
properties:
primaryKey:
type: string
additionalKey:
type: string
validFor:
type: integer
format: int64
minimum: 1
maximum: 2592000
required:
- primaryKey
- additionalKey
Customer:
type: object
properties:
name:
type: string
category:
type: string
id:
type: integer
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import pl.touk.nussknacker.engine.api.typed.TypedMap
import pl.touk.nussknacker.engine.build.ScenarioBuilder
import pl.touk.nussknacker.engine.flink.test.FlinkSpec
import pl.touk.nussknacker.engine.graph.expression.Expression
import pl.touk.nussknacker.engine.spel
import pl.touk.nussknacker.engine.util.test.{ClassBasedTestScenarioRunner, RunResult, TestScenarioRunner}
import pl.touk.nussknacker.openapi.enrichers.SwaggerEnricher
import pl.touk.nussknacker.openapi.parser.SwaggerParser
Expand Down Expand Up @@ -53,6 +54,11 @@ class OpenApiScenarioIntegrationTest
test(prepareScenarioRunner(port, sttpBackend, _.copy(allowedMethods = List("POST"))))
}

def withRequestBody(sttpBackend: SttpBackend[Future, Any])(test: ClassBasedTestScenarioRunner => Any) =
new StubService("/enrichers-with-optional-fields.yaml").withCustomerService { port =>
test(prepareScenarioRunner(port, sttpBackend, _.copy(allowedMethods = List("POST"))))
}

val stubbedBackend: SttpBackendStub[Future, Any] = SttpBackendStub.asynchronousFuture.whenRequestMatchesPartial {
case request =>
request.headers match {
Expand Down Expand Up @@ -93,6 +99,21 @@ class OpenApiScenarioIntegrationTest
)
}

it should "call enricher with request body" in withRequestBody(stubbedBackend) { testScenarioRunner =>
// given
val data = List("10")
val scenario =
scenarioWithEnricher((SingleBodyParameter.name, """{{additionalKey:"sss", primaryKey:"dfgdf"}}""".spel))

// when
val result = testScenarioRunner.runWithData(scenario, data)

// then
result.validValue shouldBe RunResult.success(
TypedMap(Map("name" -> "Robert Wright", "id" -> 10L, "category" -> "GOLD"))
)
}

it should "call enricher returning string" in withPrimitiveReturnType(
SttpBackendStub.asynchronousFuture.whenRequestMatchesPartial { case _ =>
Response.ok((s""""justAString""""))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object ParametersExtractor {
ParameterWithBodyFlag(
Parameter(
ParameterName(propertyName),
swaggerType.typingResult,
SwaggerTyped.typingResult(swaggerType, resolveListOfObjects = false),
editor = swaggerType.editorOpt,
validators = List.empty,
defaultValue = None,
Expand Down
7 changes: 2 additions & 5 deletions defaultModel/src/main/resources/defaultModelConfig.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
split: {
docsUrl: ${baseDocsUrl}"BasicNodes#split"
}
input {
builtin-input {
docsUrl: ${baseDocsUrl}"Fragments#inputs"
}
fragmentInputDefinition {
docsUrl: ${baseDocsUrl}"Fragments#inputs"
}
fragmentOutputDefinition {
builtin-output {
docsUrl: ${baseDocsUrl}"Fragments#outputs"
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions designer/client/cypress/e2e/counts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ describe("Counts", () => {
});

it("should be available via button and modal", () => {
// There is no other way to make this test works as expected since we cannot mock dynamic date here,
// and blackout or response mock has a little no sense in this case
const maxDiffThreshold = 0.02;
cy.viewport("macbook-15");

// Collapse toolbar to make counts button visible
Expand All @@ -20,7 +23,7 @@ describe("Counts", () => {

cy.get("[data-testid=window]").contains("Quick ranges").should("be.visible");
cy.contains(/^latest deploy$/i).should("not.exist");
cy.get("[data-testid=window]").matchImage();
cy.get("[data-testid=window]").matchImage({ maxDiffThreshold });
cy.get("[data-testid=window]")
.contains(/^cancel$/i)
.click();
Expand All @@ -29,7 +32,7 @@ describe("Counts", () => {
cy.get("@button").click();
cy.get("[data-testid=window]").contains("Quick ranges").should("be.visible");
cy.contains(/^latest deploy$/i).should("be.visible");
cy.get("[data-testid=window]").matchImage();
cy.get("[data-testid=window]").matchImage({ maxDiffThreshold });
cy.get("[data-testid=window]")
.contains(/^cancel$/i)
.click();
Expand All @@ -44,7 +47,7 @@ describe("Counts", () => {
cy.contains(/^previous deployments...$/i)
.should("be.visible")
.click();
cy.get("[data-testid=window]").matchImage();
cy.get("[data-testid=window]").matchImage({ maxDiffThreshold });
cy.get("[data-testid=window]").contains("no refresh").should("be.visible");
cy.get("[data-testid=window]").contains("Latest deploy").click();
cy.get("[data-testid=window]").contains("10 seconds").should("be.visible");
Expand Down
13 changes: 7 additions & 6 deletions designer/client/cypress/e2e/fragment.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("Fragment", () => {
});

beforeEach(() => {
cy.viewport(1440, 1200);
cy.viewport("macbook-16");
});

it("should allow adding input parameters and display used fragment graph in modal", () => {
Expand Down Expand Up @@ -424,12 +424,13 @@ describe("Fragment", () => {
},
force: true,
});

cy.viewport("macbook-16");
cy.layoutScenario();

cy.get("@sendSms")
.parent()
.matchImage({
maxmaxDiffThreshold: 0.015,
screenshotConfig: { padding: 16 } });
cy.get('[joint-selector="layers"]').matchImage({
maxmaxDiffThreshold: 0.015,
screenshotConfig: { padding: 16 },
});
});
});
5 changes: 0 additions & 5 deletions designer/client/cypress/support/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ const mockWindowDate = () => {
// let originalDate: DateConstructor;

cy.on("window:before:load", (win) => {
// originalDate = win.Date;
Object.assign(win, { Date: FakeDate });
});

// cy.on("window:before:unload", (win) => {
// Object.assign(win, { Date: originalDate });
// });
};

Cypress.Commands.add("mockWindowDate", mockWindowDate);
Expand Down
14 changes: 7 additions & 7 deletions designer/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion designer/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@touk/federated-component": "1.0.0",
"@touk/window-manager": "1.9.0",
"ace-builds": "1.34.2",
"axios": "1.7.4",
"axios": "1.7.5",
"d3-transition": "3.0.1",
"d3-zoom": "3.0.0",
"dagre": "0.8.5",
Expand Down
8 changes: 7 additions & 1 deletion designer/client/src/components/modals/SaveProcessDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import { displayCurrentProcessVersion, displayProcessActivity, loadProcessToolba
import { PromptContent } from "../../windowManager";
import { CommentInput } from "../comment/CommentInput";
import { ThunkAction } from "../../actions/reduxTypes";
import { getScenarioGraph, getProcessName, getProcessUnsavedNewName, isProcessRenamed, getScenarioLabels } from "../../reducers/selectors/graph";
import {
getScenarioGraph,
getProcessName,
getProcessUnsavedNewName,
isProcessRenamed,
getScenarioLabels,
} from "../../reducers/selectors/graph";
import HttpService from "../../http/HttpService";
import { ActionCreators as UndoActionCreators } from "redux-undo";
import { visualizationUrl } from "../../common/VisualizationUrl";
Expand Down
16 changes: 8 additions & 8 deletions designer/submodules/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion designer/submodules/packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@mui/material": "5.15.7",
"@mui/x-data-grid": "6.18.5",
"@types/chance": "1.1.3",
"axios": "1.7.4",
"axios": "1.7.5",
"chance": "1.1.8",
"copy-to-clipboard": "3.3.1",
"history": "5.3.0",
Expand Down
13 changes: 12 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@

(Not available yet)

### 1.17.0 (Not released yet)
### 1.17.1 (Not released yet)

* [#6880](https://github.com/TouK/nussknacker/pull/6880) Performance optimization of generating Avro messages with unions
- shorter message in logs

* [#6877](https://github.com/TouK/nussknacker/pull/6877) Fix application crash on edit node details window open

### 1.17.0 (12 September 2024)

* [#6658](https://github.com/TouK/nussknacker/pull/6658) Bump up circe-yaml lib to 0.15.2
* [#6398](https://github.com/TouK/nussknacker/pull/6398) Added possibility to define hint texts for scenario properties in config.
Expand Down Expand Up @@ -125,6 +132,10 @@
* From now on it is possible to pass an array as a parameter of type List - e.g. `T(java.lang.String).join(',', #array)`.
* Fix result type of projection (`.!`) - e.g. `#array.![#this]` returns a type array instead of a type List.
* [#6685](https://github.com/TouK/nussknacker/pull/6685) Fixed an issue with dictionary parameter editor language being set to spel when no default value was present.
* [#6797](https://github.com/TouK/nussknacker/pull/6797) [#6815](https://github.com/TouK/nussknacker/pull/6815) Performance optimization of Avro processing
* [#6578](https://github.com/TouK/nussknacker/pull/6578) Introduced support for displaying a docsUrl with an icon in scenario properties. This feature is based on the processingType and is configurable via the model.conf file.
* [#6725](https://github.com/TouK/nussknacker/pull/6725) Resolved an issue where properties were not saving when a fragment was in a different group than other fragments.
* [#6697](https://github.com/TouK/nussknacker/pull/6697) Fix unhandled error when open survey

## 1.16

Expand Down
6 changes: 5 additions & 1 deletion docs/MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To see the biggest differences please consult the [changelog](Changelog.md).
are registered based on class of Serializer instead of instance of Serializer. If you have values that were
serialized by these Serializers in some state, the state won't be restored after upgrade.

## In version 1.17.0 (Not released yet)
## In version 1.17.0

### Code API changes

Expand Down Expand Up @@ -112,6 +112,10 @@ To see the biggest differences please consult the [changelog](Changelog.md).
### Configuration changes
* [#6635](https://github.com/TouK/nussknacker/pull/6635) `globalParameters.useTypingResultTypeInformation` parameter was removed.
Now we always use TypingResultTypeInformation
* [#6797](https://github.com/TouK/nussknacker/pull/6797) `AVRO_USE_STRING_FOR_STRING_TYPE` environment variable
is not supported anymore - we always use String for String type in Avro. If you didn't set up this
environment variable, no action is needed


## In version 1.16.3

Expand Down
Loading

0 comments on commit 0c5ee69

Please sign in to comment.