Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated to jetty 11.0.24 #17

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8554d30
Migrated to th2 gradle plugin `0.1.6` based on bom: `4.9.0`
Nikita-Smirnov-Exactpro Dec 16, 2024
89dc0d1
Migrated to jetty `11.0.24`
Nikita-Smirnov-Exactpro Dec 16, 2024
511ec61
Use compound-java for running integration tests
Nikita-Smirnov-Exactpro Dec 16, 2024
a0d5dd4
Bump rebuild
Nikita-Smirnov-Exactpro Dec 16, 2024
919d3ff
Test disable integration test
Nikita-Smirnov-Exactpro Dec 16, 2024
6077d89
Bump rebuild
Nikita-Smirnov-Exactpro Dec 16, 2024
077970d
Bump rebuild
Nikita-Smirnov-Exactpro Dec 16, 2024
3936ead
Bump rebuild
Nikita-Smirnov-Exactpro Dec 18, 2024
826fcce
Bump rebuild
Nikita-Smirnov-Exactpro Dec 18, 2024
cae1aed
Bump rebuild
Nikita-Smirnov-Exactpro Dec 18, 2024
b617efd
Bump rebuild
Nikita-Smirnov-Exactpro Dec 18, 2024
90567d0
Bump rebuild
Nikita-Smirnov-Exactpro Dec 18, 2024
c5b3b7c
Bump rebuild
Nikita-Smirnov-Exactpro Dec 18, 2024
cec232b
Bump rebuild
Nikita-Smirnov-Exactpro Dec 18, 2024
2ce26e8
trivy-docker-scan condition if: inputs.scanner-enabled && !cancelled(…
Nikita-Smirnov-Exactpro Dec 18, 2024
33e112c
scanner-enabled: false, strict-scanner: true
Nikita-Smirnov-Exactpro Dec 18, 2024
6056304
scanner-enabled: false, strict-scanner: false
Nikita-Smirnov-Exactpro Dec 18, 2024
72a3353
added (inputs.integration-test-enabled && needs.integration-test.resu…
Nikita-Smirnov-Exactpro Dec 18, 2024
612795a
scanner-enabled and strict-scanner are default
Nikita-Smirnov-Exactpro Dec 18, 2024
a94b89b
integration-test-enabled: true
Nikita-Smirnov-Exactpro Dec 18, 2024
ffa8714
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 18, 2024
ad93c87
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 18, 2024
5de6b82
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 18, 2024
6d26812
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 18, 2024
fb5ecee
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 18, 2024
bd67c3c
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 18, 2024
9ccd6a0
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 18, 2024
3aea97d
integration-test-enabled: false, scanner-enabled: true, strict-scanne…
Nikita-Smirnov-Exactpro Dec 18, 2024
641c6d1
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
18354fe
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
4e49249
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
088c0d3
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
2b91945
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
6dcbbe1
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
4f47b29
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
411b565
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
503cb17
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
4fd3238
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
91e81b3
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
97865a0
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
05700a2
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
0a75d9a
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
161c2f4
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
6d74cd6
integration-test-enabled: false, scanner-enabled: false, strict-scann…
Nikita-Smirnov-Exactpro Dec 18, 2024
dd941e8
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 18, 2024
6bf71f2
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 19, 2024
a4dbe98
integration-test-enabled: true, scanner-enabled: true, strict-scanner…
Nikita-Smirnov-Exactpro Dec 19, 2024
52d8e56
Merge remote-tracking branch 'origin/master' into update-dependencies
Nikita-Smirnov-Exactpro Feb 26, 2025
1ebf466
Bumped rebuild
Nikita-Smirnov-Exactpro Feb 26, 2025
c7419bf
int: true, sca: true, st: true
Nikita-Smirnov-Exactpro Feb 26, 2025
2f60ce4
int: true, sca: true, st: false
Nikita-Smirnov-Exactpro Feb 26, 2025
42b3acd
int: true, sca: false, st: true
Nikita-Smirnov-Exactpro Feb 26, 2025
918af08
int: false, sca: true, st: true
Nikita-Smirnov-Exactpro Feb 26, 2025
65ad6da
int: false, sca: true, st: false
Nikita-Smirnov-Exactpro Feb 26, 2025
b6a6950
int: false, sca: false, st: true
Nikita-Smirnov-Exactpro Feb 26, 2025
dcbe5ec
int: false, sca: false, st: false
Nikita-Smirnov-Exactpro Feb 26, 2025
cb66b33
int: true, sca: false, st: false
Nikita-Smirnov-Exactpro Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build-dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ on: workflow_dispatch

jobs:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
uses: th2-net/.github/.github/workflows/compound-java.yml@integration-tests # FIXME: switch to main branch
with:
integration-test-enabled: true
integration-test-projects: "['cradle-admin-tool-cli','cradle-admin-tool-http']"
build-target: 'Docker'
devRelease: true
createTag: true
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ on: workflow_dispatch

jobs:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
uses: th2-net/.github/.github/workflows/compound-java.yml@integration-tests # FIXME: switch to main branch
with:
integration-test-enabled: true
integration-test-projects: "['cradle-admin-tool-cli','cradle-admin-tool-http']"
build-target: 'Docker'
devRelease: false
createTag: true
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-sanpshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ on:

jobs:
build-job:
uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main
uses: th2-net/.github/.github/workflows/compound-java-dev.yml@integration-tests # FIXME: switch to main branch
with:
integration-test-enabled: true
scanner-enabled: false
strict-scanner: false
integration-test-projects: "['cradle-admin-tool-cli','cradle-admin-tool-http']"
build-target: 'Docker'
docker-username: ${{ github.actor }}
secrets:
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/integration-tests.yml

This file was deleted.

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# th2-cradle-admin 1.11.2
# th2-cradle-admin 2.0.0

The th2-cradle-admin is a set of projects for managing books and pages in th2 storage.

Expand Down Expand Up @@ -70,6 +70,11 @@ spec:

## Release notes:

### 2.0.0-dev
* Updated:
* migrated to jetty: `11.0.24`
* Cradle API to `5.4.4-dev`

### 1.11.2-dev

* Included scripts for REST API interaction and installed required utils into docker image
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ subprojects {
implementation(libs.cradle.cassandra)
implementation "org.slf4j:slf4j-api"

testImplementation(libs.junit.jupiter.integration)
testImplementation(libs.th2.junit.jupiter.integration)

testImplementation(libs.mockito.core)
testImplementation(libs.mockito.junit.jupiter)
Expand All @@ -60,6 +60,8 @@ subprojects {

tasks.register('integrationTest', Test) {
group = 'verification'
systemProperty 'datastax-java-driver.advanced.connection.init-query-timeout', '5 seconds'
systemProperty 'datastax-java-driver.basic.request.timeout', '10 seconds'
useJUnitPlatform {
includeTags('integration')
}
Expand Down
9 changes: 8 additions & 1 deletion cradle-admin-tool-http/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cradle-admin-tool-http (1.11.1-dev)
# cradle-admin-tool-http (2.0.0-dev)
Service which allows user to manage books/pages via RestAPI requests.
- The first page in a book can be created only if start time is more than current time.
- After the first page all new pages must have start time more than current time + `bookRefreshIntervalMillis` * 2
Expand Down Expand Up @@ -76,6 +76,13 @@ Help:

## Release notes

### 2.0.0-dev
* Updated:
* migrated to jetty: `11.0.24`
* th2-gradle-plugin: `0.1.6` (th2-bom: `4.9.0`)
* Cradle API to `5.4.4-dev`
* jackson-datatype-jsr310: `2.18.2`

### 1.11.1-dev

+ Updated:
Expand Down
4 changes: 1 addition & 3 deletions cradle-admin-tool-http/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'application'
id 'com.exactpro.th2.gradle.component'
alias(libs.plugins.th2.component)
}

dependencies {
Expand All @@ -18,8 +18,6 @@ dependencies {
implementation 'org.apache.commons:commons-lang3'

testImplementation project(':cradle-admin-tool-test')
//noinspection DependencyNotationArgument
testImplementation group: "org.eclipse.jetty", name: "jetty-http", classifier: "tests"
testImplementation "org.eclipse.jetty:jetty-util"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2021-2023 Exactpro (Exactpro Systems Limited)
/*
* Copyright 2021-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,12 +12,18 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
*/

package com.exactpro.th2.cradle.adm.http;

import com.exactpro.cradle.CradleStorage;
import com.exactpro.th2.cradle.adm.http.servlets.*;
import com.exactpro.th2.cradle.adm.http.servlets.GetBookInfoServlet;
import com.exactpro.th2.cradle.adm.http.servlets.GetBookServlet;
import com.exactpro.th2.cradle.adm.http.servlets.ListAllBookSchemasServlet;
import com.exactpro.th2.cradle.adm.http.servlets.NewBookServlet;
import com.exactpro.th2.cradle.adm.http.servlets.NewPageServlet;
import com.exactpro.th2.cradle.adm.http.servlets.RemovePageServlet;
import com.exactpro.th2.cradle.adm.http.servlets.UpdatePageServlet;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
Expand All @@ -28,11 +34,12 @@

public class HttpServer implements AutoCloseable {

private static final Logger logger = LoggerFactory.getLogger(HttpServer.class);
private static final Logger LOGGER = LoggerFactory.getLogger(HttpServer.class);

private final Configuration configuration;
private final CradleStorage storage;
protected Server server;
protected ServerConnector serverConnector;

public HttpServer(Configuration configuration, CradleStorage storage) {
this.configuration = configuration;
Expand All @@ -42,7 +49,7 @@ public HttpServer(Configuration configuration, CradleStorage storage) {
protected void createServer() {
this.server = new Server();

ServerConnector serverConnector = new ServerConnector(this.server);
serverConnector = new ServerConnector(this.server);
serverConnector.setHost(configuration.getIp());
serverConnector.setPort(configuration.getPort());

Expand All @@ -63,11 +70,20 @@ public void run() throws Exception {
servletHandler.addServletWithMapping(new ServletHolder(new UpdatePageServlet(storage)), "/update-page");

server.start();
logger.info("server started: http://{}:{}/", configuration.getIp(), configuration.getPort());
LOGGER.info("server started: http://{}:{}/", configuration.getIp(), configuration.getPort());
}

@Override
public void close() throws Exception {
server.stop();
public void close() {
try {
server.stop();
} catch (Exception e) {
LOGGER.error("Stop server failure", e);
}
try {
serverConnector.close();
} catch (Exception e) {
LOGGER.error("Close server connector failure", e);
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2022-2022 Exactpro (Exactpro Systems Limited)
/*
* Copyright 2022-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
*/

package com.exactpro.th2.cradle.adm.http.modes;

Expand All @@ -21,8 +21,7 @@
import com.exactpro.th2.cradle.adm.http.params.HttpParamBuilder;
import com.exactpro.th2.cradle.adm.modes.GetAllBooksMode;
import com.exactpro.th2.cradle.adm.params.GetAllBooksParams;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;


public class GetAllBooksHttpMode extends GetAllBooksMode implements HttpMode<GetAllBooksParams> {
Expand All @@ -32,8 +31,7 @@ public HttpParamBuilder<GetAllBooksParams> createParamsBuilder() {
}

@Override
public boolean initParams(HttpServletRequest req) throws InvalidConfigurationException {
public void initParams(HttpServletRequest req) throws InvalidConfigurationException {
this.param = getParams(req);
return true;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2022-2022 Exactpro (Exactpro Systems Limited)
/*
* Copyright 2022-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,7 +12,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
*/

package com.exactpro.th2.cradle.adm.http.modes;

Expand All @@ -23,7 +23,7 @@
import com.exactpro.th2.cradle.adm.params.GetBookInfoParams;
import com.exactpro.th2.cradle.adm.results.BooksListInfo;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

public class GetBookInfoHttpMode extends GetBookInfoMode implements HttpMode<GetBookInfoParams> {

Expand All @@ -33,9 +33,8 @@ public HttpParamBuilder<GetBookInfoParams> createParamsBuilder() {
}

@Override
public boolean initParams(HttpServletRequest req) throws InvalidConfigurationException {
public void initParams(HttpServletRequest req) throws InvalidConfigurationException {
this.param = getParams(req);
return true;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2021-2021 Exactpro (Exactpro Systems Limited)
/*
* Copyright 2021-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -12,19 +12,19 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
*/

package com.exactpro.th2.cradle.adm.http.modes;

import com.exactpro.th2.cradle.adm.InvalidConfigurationException;
import com.exactpro.th2.cradle.adm.http.params.HttpParamBuilder;
import jakarta.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletRequest;

public interface HttpMode<T> {

HttpParamBuilder<T> createParamsBuilder();
boolean initParams(HttpServletRequest commandLine) throws InvalidConfigurationException;
void initParams(HttpServletRequest commandLine) throws InvalidConfigurationException;

default T getParams(HttpServletRequest commandLine) throws InvalidConfigurationException {
var builder = createParamsBuilder();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2022-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.exactpro.th2.cradle.adm.http.modes;

import com.exactpro.th2.cradle.adm.InvalidConfigurationException;
Expand All @@ -7,7 +23,7 @@
import com.exactpro.th2.cradle.adm.params.NoParams;
import com.exactpro.th2.cradle.adm.results.BookSchemaInfo;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

public class ListAllBookSchemasHttpMode extends ListAllBookSchemasMode implements HttpMode<NoParams> {

Expand All @@ -22,8 +38,7 @@ public HttpParamBuilder<NoParams> createParamsBuilder() {
}

@Override
public boolean initParams(HttpServletRequest commandLine) throws InvalidConfigurationException {
public void initParams(HttpServletRequest commandLine) throws InvalidConfigurationException {
this.param = getParams(commandLine);
return true;
}
}
Loading
Loading