Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
220fcaf
DMND-1721 Successfully creating RSD & Collections and adding skills t…
Sep 9, 2023
3a6946f
Begin converting deprecated/refactored imports
Sep 13, 2023
79072db
Updated to use latest ElasticSearch code; Deprecated classes has been…
Sep 14, 2023
a9ad0bd
Broken code
Sep 19, 2023
fabd542
fix elasticsearch-rest-high-level-client
jesusgudino Sep 20, 2023
5b233ad
Merge remote-tracking branch 'origin/feature/DMND-1721_java17_springb…
jesusgudino Sep 20, 2023
09e4c9a
fix ElasticsearchTemplate
jesusgudino Sep 20, 2023
94e5a33
fix elasticsearch queries
jesusgudino Sep 22, 2023
2c652d8
Merged Huey's Query upgrade calls to replace deprecated calls
Sep 23, 2023
bf2a544
Deprecated ElasticSearchRestTemplate has been excised. Successfully a…
Sep 26, 2023
20a017f
Code clean up
Sep 26, 2023
3584bf7
Code clean up
Sep 26, 2023
2e646ae
Added TODO notes regarding Elasticsearch upgrade related stories in b…
Sep 26, 2023
b7b5987
DMND-1790 Fix NPE and vague http 500 message when wrong Collection Id…
Sep 27, 2023
fcf3170
DMND-1791 Fix NPE and vague http 500 message when wrong Skill UIID is…
Sep 27, 2023
9c0073d
DMND-1778 merging upgraded queries code; UI and postman tests passes.…
Sep 28, 2023
6efe8fa
DMND-1779 Utilizing application.properties to set the new Easticsearc…
shnooga Oct 6, 2023
ef7dd54
Feature/dmnd 1780 security config (#459)
jesusgudino Oct 12, 2023
f1a5684
Feature/dmnd 1782 db config (#460)
shnooga Oct 13, 2023
7468bc9
Updated common.sh version checking to recent version numbers
Oct 20, 2023
4cf8842
Update common.sh to reflect LTS versions
Oct 20, 2023
bf29a8c
DMND-1721 Junits are now all passing.
Oct 20, 2023
77ba713
JUnit fix and synch with develop (#463)
shnooga Oct 25, 2023
e120cf2
Update application-dev.properties
Dec 19, 2023
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: 2 additions & 2 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
steps:
- name: Checkout out branch
uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Maven version
run: mvn -version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'
- name: Maven version
run: mvn -version
Expand Down
23 changes: 16 additions & 7 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>edu.wgu.osmt</groupId>
<artifactId>osmt-parent</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.6.1-SNAPSHOT</version>
</parent>

<repositories>
Expand All @@ -27,11 +27,11 @@

<groupId>edu.wgu.osmt</groupId>
<artifactId>osmt-api</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.6.1-SNAPSHOT</version>
<description>WGU Open Skills Management Toolset</description>

<properties>
<java.version>11</java.version>
<app.version>2.6.1-SNAPSHOT</app.version>
<kotlin.version>1.7.21</kotlin.version>
<kotlin.code.style>official</kotlin.code.style>
<kotlin.coroutines.version>1.5.1</kotlin.coroutines.version>
Expand All @@ -42,8 +42,8 @@
<!-- TODO - is this needed?-->
<kotest.version>4.1.3</kotest.version>
<start-class>edu.wgu.osmt.ApplicationKt</start-class>
<testcontainers.version>1.17.6</testcontainers.version>
<spring-data-elasticsearch.version>4.4.1</spring-data-elasticsearch.version>
<testcontainers.version>1.18.3</testcontainers.version>
<spring-data-elasticsearch.version>5.1.3</spring-data-elasticsearch.version>
<ehcache.version>3.9.2</ehcache.version>
<log4j.version>2.17.1</log4j.version>
<bucket4j.version>4.10.0</bucket4j.version>
Expand All @@ -54,7 +54,7 @@
<dependency>
<groupId>edu.wgu.osmt</groupId>
<artifactId>osmt-ui</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>${app.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -77,7 +77,7 @@
<dependency>
<groupId>com.github.sonus21</groupId>
<artifactId>rqueue-spring-boot-starter</artifactId>
<version>2.13.0-RELEASE</version>
<version>3.1.0-RELEASE</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -121,6 +121,15 @@
</exclusion>
</exclusions>
</dependency>

<!-- Remove when WGU fully migrate to ElasticSearch v8.x apis DMND-1778-->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.17.8</version>
</dependency>


<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/kotlin/edu/wgu/osmt/PropertyLogger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.util.stream.StreamSupport


@Component
@Profile("dev")
@Profile("debug")
class PropertyLogger {
@EventListener
fun handleContextRefresh(event: ContextRefreshedEvent) {
Expand Down Expand Up @@ -43,4 +43,4 @@ class PropertyLogger {
companion object {
private val LOGGER = LoggerFactory.getLogger(PropertyLogger::class.java)
}
}
}
1 change: 1 addition & 0 deletions api/src/main/kotlin/edu/wgu/osmt/RoutePaths.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ object RoutePaths {
const val COLLECTION_REMOVE = "$COLLECTION_DETAIL/remove"

const val WORKSPACE_PATH = "/workspace"
const val WORKSPACE_LIST = WORKSPACE_PATH

private const val TASKS_PATH = "/results"
const val TASK_DETAIL_TEXT = "$TASKS_PATH/text/{uuid}"
Expand Down
8 changes: 5 additions & 3 deletions api/src/main/kotlin/edu/wgu/osmt/api/ApiErrorHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class GeneralApiExceptionHandler : ResponseEntityExceptionHandler() {
@ControllerAdvice
class ApiErrorHandler : ResponseEntityExceptionHandler() {

override fun handleHttpMessageNotReadable(
// No longer abstract method in spring-webmvc:6.0.11
// override fun handleHttpMessageNotReadable(
fun handleHttpMessageNotReadable(
ex: HttpMessageNotReadableException,
headers: HttpHeaders,
status: HttpStatus,
Expand All @@ -57,8 +59,8 @@ class ApiErrorHandler : ResponseEntityExceptionHandler() {

@ExceptionHandler(ResponseStatusException::class)
fun handleResponseStatus(ex: ResponseStatusException): ResponseEntity<Any> {
val apiError = ApiError(ex.status.toString())
return ResponseEntity(apiError, ex.status)
val apiError = ApiError(ex.message)
return ResponseEntity(apiError, ex.statusCode)
}

}
2 changes: 1 addition & 1 deletion api/src/main/kotlin/edu/wgu/osmt/auditlog/AuditLogDao.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package edu.wgu.osmt.auditlog

import com.google.common.reflect.TypeToken
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import edu.wgu.osmt.db.OutputsModel
import org.jetbrains.exposed.dao.LongEntity
import org.jetbrains.exposed.dao.LongEntityClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@ package edu.wgu.osmt.collection
import edu.wgu.osmt.HasAllPaginated
import edu.wgu.osmt.RoutePaths
import edu.wgu.osmt.api.GeneralApiException
import edu.wgu.osmt.api.model.ApiCollection
import edu.wgu.osmt.api.model.ApiCollectionUpdate
import edu.wgu.osmt.api.model.ApiCollectionV2
import edu.wgu.osmt.api.model.ApiSearch
import edu.wgu.osmt.api.model.ApiSearchV2
import edu.wgu.osmt.api.model.ApiSkillListUpdate
import edu.wgu.osmt.api.model.ApiStringListUpdate
import edu.wgu.osmt.api.model.CollectionSortEnum
import edu.wgu.osmt.api.model.*
import edu.wgu.osmt.auditlog.AuditLog
import edu.wgu.osmt.auditlog.AuditLogRepository
import edu.wgu.osmt.auditlog.AuditLogSortEnum
Expand All @@ -20,34 +13,18 @@ import edu.wgu.osmt.db.PublishStatus
import edu.wgu.osmt.elasticsearch.OffsetPageable
import edu.wgu.osmt.richskill.RichSkillRepository
import edu.wgu.osmt.security.OAuthHelper
import edu.wgu.osmt.task.AppliesToType
import edu.wgu.osmt.task.CsvTask
import edu.wgu.osmt.task.CsvTaskV2
import edu.wgu.osmt.task.PublishTask
import edu.wgu.osmt.task.PublishTaskV2
import edu.wgu.osmt.task.RemoveCollectionSkillsTask
import edu.wgu.osmt.task.Task
import edu.wgu.osmt.task.TaskMessageService
import edu.wgu.osmt.task.TaskResult
import edu.wgu.osmt.task.UpdateCollectionSkillsTask
import edu.wgu.osmt.task.XlsxTask
import edu.wgu.osmt.task.*
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.HttpEntity
import org.springframework.http.HttpStatus
import org.springframework.http.HttpStatus.NOT_FOUND
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.security.oauth2.jwt.Jwt
import org.springframework.stereotype.Controller
import org.springframework.transaction.annotation.Transactional
import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.ResponseBody
import org.springframework.web.bind.annotation.*
import org.springframework.web.server.ResponseStatusException
import org.springframework.web.util.UriComponentsBuilder

Expand Down Expand Up @@ -346,7 +323,7 @@ class CollectionController @Autowired constructor(
@PathVariable uuid: String
): HttpEntity<List<AuditLog>> {
val pageable = OffsetPageable(0, Int.MAX_VALUE, AuditLogSortEnum.forValueOrDefault(AuditLogSortEnum.DateDesc.apiValue).sort)
val collection = collectionRepository.findByUUID(uuid)
val collection = collectionRepository.findByUUID(uuid) ?: throw ResponseStatusException(NOT_FOUND, "Collection with id $uuid not ready or not found")
val sizedIterable = auditLogRepository.findByTableAndId(CollectionTable.tableName, entityId = collection!!.id.value, offsetPageable = pageable)

return ResponseEntity.status(200).body(sizedIterable.toList().map { it.toModel() })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.annotation.JsonProperty
import edu.wgu.osmt.config.INDEX_COLLECTION_DOC
import edu.wgu.osmt.db.PublishStatus
import org.elasticsearch.core.Nullable
import javax.annotation.Nullable
import org.springframework.data.annotation.Id
import org.springframework.data.elasticsearch.annotations.*
import org.springframework.data.elasticsearch.annotations.FieldType.*
Expand Down
Loading