Skip to content

Commit

Permalink
Merge c764938 into 54ffd28
Browse files Browse the repository at this point in the history
  • Loading branch information
RickArt committed Mar 6, 2023
2 parents 54ffd28 + c764938 commit b7e2e1a
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 40 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.5.3] - 2023-03-07
### Changed
- Upgrade `Springboot` from `2.4.4` to `2.7.9`.
- Migrate using `springfox` to `springdoc` due to incompatibilities with `spring boot 2.6+` actuators.
- Removed `micrometer` version from `beekeeper-vacuum-tool` to be the same as managed by `beekeeper/pom.xml`'s dependencies.
- Upgrade `specification-args-resolver` version to be compatible with `springdoc`.

## [3.5.2] - 2023-01-06
### Fixed
- `cleanUpOldDeletedRecords` status check to not delete `DISABLED` entries immediately.
Expand Down
16 changes: 6 additions & 10 deletions beekeeper-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<artifactId>beekeeper-api</artifactId>

<properties>
<specification-arg-resolver.version>2.6.1</specification-arg-resolver.version>
<springfox.swagger.version>2.9.2</springfox.swagger.version>
<specification-arg-resolver.version>2.18.1</specification-arg-resolver.version>
<springdoc.version>1.6.14</springdoc.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -40,16 +40,12 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox.swagger.version}</version>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc.version}</version>
</dependency>

<!-- test -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2019-2021 Expedia, Inc.
* Copyright (C) 2019-2023 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,26 +15,23 @@
*/
package com.expediagroup.beekeeper.api.conf;

import static springfox.documentation.spi.DocumentationType.SWAGGER_2;

import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.servers.Server;

@EnableSwagger2
@Configuration
@OpenAPIDefinition(servers = { @Server(url = "/", description = "Default Server URL") })
public class SwaggerConfiguration {

@Bean
public Docket api() {
return new Docket(SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.expediagroup.beekeeper.api.controller"))
.paths(PathSelectors.any())
public GroupedOpenApi api() {
return GroupedOpenApi.builder()
.group("beekeeper-api-service")
.packagesToScan("com.expediagroup.beekeeper.api.controller")
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.expediagroup.beekeeper.api.controller;

import org.springdoc.api.annotations.ParameterObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand All @@ -25,6 +26,8 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import net.kaczmarzyk.spring.data.jpa.domain.EqualIgnoreCase;
import net.kaczmarzyk.spring.data.jpa.domain.GreaterThan;
import net.kaczmarzyk.spring.data.jpa.domain.LessThan;
Expand All @@ -49,10 +52,20 @@ public BeekeeperController(HousekeepingEntityService housekeepingEntityService)
}

@RequestMapping(value = "/database/{databaseName}/table/{tableName}/metadata", method = RequestMethod.GET)
@Parameter(name = "tableName", in = ParameterIn.PATH)
@Parameter(name = "databaseName", in = ParameterIn.PATH)
@Parameter(name = "path", in = ParameterIn.QUERY)
@Parameter(name = "partition_name", in = ParameterIn.QUERY)
@Parameter(name = "housekeeping_status", in = ParameterIn.QUERY)
@Parameter(name = "lifecycle_type", in = ParameterIn.QUERY)
@Parameter(name = "deleted_before", in = ParameterIn.QUERY)
@Parameter(name = "deleted_after", in = ParameterIn.QUERY)
@Parameter(name = "registered_before", in = ParameterIn.QUERY)
@Parameter(name = "registered_after", in = ParameterIn.QUERY)
public ResponseEntity<Page<HousekeepingMetadataResponse>> getAllMetadata(
@PathVariable String databaseName,
@PathVariable String tableName,
@And({
@Parameter(hidden = true) @And(value = {
@Spec(path = "tableName", pathVars = "tableName", spec = EqualIgnoreCase.class),
@Spec(path = "databaseName", pathVars = "databaseName", spec = EqualIgnoreCase.class),
@Spec(path = "path", params = "path", spec = EqualIgnoreCase.class),
Expand All @@ -63,16 +76,26 @@ public ResponseEntity<Page<HousekeepingMetadataResponse>> getAllMetadata(
@Spec(path = "cleanupTimestamp", params = "deleted_after", spec = GreaterThan.class),
@Spec(path = "creationTimestamp", params = "registered_before", spec = LessThan.class),
@Spec(path = "creationTimestamp", params = "registered_after", spec = GreaterThan.class) }) Specification<HousekeepingMetadata> spec,
Pageable pageable) {
@ParameterObject Pageable pageable) {
return ResponseEntity.ok(housekeepingEntityService.getAllMetadata(spec, pageable));
}


@RequestMapping(value = "/database/{databaseName}/table/{tableName}/unreferenced-paths", method = RequestMethod.GET)
@Parameter(name = "tableName", in = ParameterIn.PATH)
@Parameter(name = "databaseName", in = ParameterIn.PATH)
@Parameter(name = "path", in = ParameterIn.QUERY)
@Parameter(name = "partition_name", in = ParameterIn.QUERY)
@Parameter(name = "housekeeping_status", in = ParameterIn.QUERY)
@Parameter(name = "lifecycle_type", in = ParameterIn.QUERY)
@Parameter(name = "deleted_before", in = ParameterIn.QUERY)
@Parameter(name = "deleted_after", in = ParameterIn.QUERY)
@Parameter(name = "registered_before", in = ParameterIn.QUERY)
@Parameter(name = "registered_after", in = ParameterIn.QUERY)
public ResponseEntity<Page<HousekeepingPathResponse>> getAllPaths(
@PathVariable String databaseName,
@PathVariable String tableName,
@And({
@Parameter(hidden = true) @And(value ={
@Spec(path = "tableName", pathVars = "tableName", spec = EqualIgnoreCase.class),
@Spec(path = "databaseName", pathVars = "databaseName", spec = EqualIgnoreCase.class),
@Spec(path = "path", params = "path", spec = EqualIgnoreCase.class),
Expand Down
11 changes: 4 additions & 7 deletions beekeeper-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@

<artifactId>beekeeper-core</artifactId>

<properties>
<graphite.version>1.6.5</graphite.version>
<prometheus.version>1.6.5</prometheus.version>
</properties>

<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down Expand Up @@ -50,15 +45,17 @@
</dependency>

<!-- micrometer -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-graphite</artifactId>
<version>${graphite.version}</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>${prometheus.version}</version>
</dependency>

<!-- test -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ void timezone() {
assertThat(paths.size()).isEqualTo(1);

HousekeepingPath savedPath = paths.get(0);
int utcHour = LocalDateTime.now(ZoneId.of("UTC")).getHour();
assertThat(savedPath.getCleanupTimestamp().getHour()).isEqualTo(utcHour + 1);
LocalDateTime localDateTime = LocalDateTime.now(ZoneId.of("UTC"));
int utcHour = localDateTime.getHour();
int cleanUpUTCHour = localDateTime.plusHours(1).getHour();
assertThat(savedPath.getCleanupTimestamp().getHour()).isEqualTo(cleanUpUTCHour);
assertThat(savedPath.getModifiedTimestamp().getHour()).isEqualTo(utcHour);
assertThat(savedPath.getCreationTimestamp().getHour()).isEqualTo(utcHour);
}
Expand Down
4 changes: 4 additions & 0 deletions beekeeper-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,9 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2019-2021 Expedia, Inc.
* Copyright (C) 2019-2023 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions beekeeper-metadata-cleanup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
1 change: 1 addition & 0 deletions beekeeper-path-cleanup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
1 change: 1 addition & 0 deletions beekeeper-scheduler-apiary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2019-2021 Expedia, Inc.
* Copyright (C) 2019-2023 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2019-2021 Expedia, Inc.
* Copyright (C) 2019-2023 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2019-2021 Expedia, Inc.
* Copyright (C) 2019-2023 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<maven.assembly.plugin.version>3.1.0</maven.assembly.plugin.version>
<mockito.version>3.11.2</mockito.version>
<snakeyaml.version>1.27</snakeyaml.version>
<springframework.boot.version>2.4.4</springframework.boot.version>
<springframework.version>5.3.5</springframework.version>
<springframework.boot.version>2.7.9</springframework.boot.version>
<springframework.version>5.3.25</springframework.version>
<testcontainers.version>1.17.1</testcontainers.version>
<docker.from.tag>11-slim</docker.from.tag>
</properties>
Expand Down

0 comments on commit b7e2e1a

Please sign in to comment.