Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b070931
Core - API - review and polish of instance mutex utility
GregJohnStewart Apr 30, 2026
7413b26
Core - API - polish and documentation of mutex utilities
GregJohnStewart May 1, 2026
03614aa
Merge branch 'development' into dev/1227-fr-core-api-add-item-mutex
GregJohnStewart May 14, 2026
158118c
Merge branch 'development' into dev/1227-fr-core-api-add-item-mutex
GregJohnStewart May 14, 2026
42f3962
Core - API - adding mutex to applied transaction service / added add …
GregJohnStewart May 14, 2026
560b422
Core - API - adding mutex to item updates
GregJohnStewart May 15, 2026
345174c
Lib - Core API for Quarkus - removed now defunct rest method
GregJohnStewart May 15, 2026
8e5e0eb
Core - API - now doing item mutex on stored updates
GregJohnStewart May 15, 2026
a81fc10
Core - API - version bump for dev
GregJohnStewart May 15, 2026
53a53dd
Core - API - Organized applied transaction service tests
GregJohnStewart May 15, 2026
7d863fa
Core - API - Added thread-based test for updating inventory items to …
GregJohnStewart May 15, 2026
35710d5
Core - API - Added todo/ reference to issue for later improvement
GregJohnStewart May 15, 2026
16b7be4
Core - API - Incorporated db id in the mutex id of inventory items
GregJohnStewart May 15, 2026
62415d3
Core - API - Added startup handler to ensure item mutexes are created
GregJohnStewart May 15, 2026
8b3ddcb
Core - API - Added a bunch of spans, slight change to make transactio…
GregJohnStewart May 16, 2026
e66734b
Core - API - Optimizing threaded testing to reduce required testing time
GregJohnStewart May 16, 2026
7ca4c81
Core - API - Changes from review, added more custom exceptions for mu…
GregJohnStewart May 16, 2026
1e9395d
Core - API - Tweaks to mutex tests
GregJohnStewart May 16, 2026
a64fe72
Merge pull request #1260 from Epic-Breakfast-Productions/dev/1227-fr-…
GregJohnStewart May 16, 2026
581c1e2
Core - API - Added initial new objects for stored state
GregJohnStewart May 16, 2026
d184c27
basic mongodb indexig added
axgiri May 16, 2026
de33745
Refactor MongoDB initialization and indexing logic across services
axgiri May 17, 2026
4eb6d21
add unique and background options to mongodb indexes
axgiri May 17, 2026
239afdb
refactor: add index initialization to TopLevelMongoService and MongoD…
axgiri May 17, 2026
a15f8aa
Core - API - Set stored to use new stored state object. Updated store…
GregJohnStewart May 17, 2026
f3b2f8e
Core - API - updated itemStatsService to reflect new stored state
GregJohnStewart May 17, 2026
bde2c43
Core - API - initial usage of stored state rework
GregJohnStewart May 18, 2026
6d8f32c
move ensureItemMutexesExist call after db init
axgiri May 18, 2026
4ebe0f0
Core - API - Fixed tests related to stored state rework
GregJohnStewart May 19, 2026
4b37d09
Core - API - Now working upgrader
GregJohnStewart May 19, 2026
d2b2ea4
Lib - Core API for Quarkus - Updates for new stored search
GregJohnStewart May 19, 2026
3ddfee5
Core - Base Station - version bump for dev
GregJohnStewart May 19, 2026
9ac14ba
static implementation defined in MongoService
axgiri May 19, 2026
6faf287
Core - Base Station - Fixed search result tweaks for stored results
GregJohnStewart May 20, 2026
b5d949f
Bump com.microsoft.playwright:playwright
dependabot[bot] May 20, 2026
cd1b914
Bump tech.units:indriya in /software/core/oqm-core-api
dependabot[bot] May 20, 2026
0e2ac71
Bump org.junit.jupiter:junit-jupiter-params
dependabot[bot] May 20, 2026
0ace2db
Bump ubi9/ubi-minimal in /software/plugins/storagotchi/src/main/docker
dependabot[bot] May 20, 2026
db5a60c
Core - Base Station - Fixing storage block label viewing in storeds
GregJohnStewart May 20, 2026
31d606e
Merge pull request #1267 from Epic-Breakfast-Productions/dependabot/g…
GregJohnStewart May 20, 2026
32a7a3a
Merge branch 'development' into dependabot/docker/software/plugins/st…
GregJohnStewart May 20, 2026
0fdfa13
Merge pull request #1269 from Epic-Breakfast-Productions/dependabot/d…
GregJohnStewart May 20, 2026
adc297a
Merge branch 'development' into dependabot/gradle/software/core/oqm-c…
GregJohnStewart May 20, 2026
21b67b8
Merge pull request #1266 from Epic-Breakfast-Productions/dependabot/g…
GregJohnStewart May 20, 2026
c6e45a2
Merge branch 'development' into dependabot/gradle/software/core/oqm-c…
GregJohnStewart May 20, 2026
32a2ae2
Merge pull request #1268 from Epic-Breakfast-Productions/dependabot/g…
GregJohnStewart May 20, 2026
2bb4942
Merge branch 'development' into dev/1228-fr-core-api-change-stored-fi…
GregJohnStewart May 20, 2026
dcfbbaa
Core - Base Station - Updating required core api version for snh
GregJohnStewart May 20, 2026
1898d9d
Merge branch 'main' into development
GregJohnStewart May 20, 2026
01c9a0d
Merge branch 'development' into dev/1228-fr-core-api-change-stored-fi…
GregJohnStewart May 20, 2026
38eb983
Core - API - Fixing some openapi definition
GregJohnStewart May 20, 2026
71ceead
Core - Base Station - More fixing to stored things
GregJohnStewart May 20, 2026
e60c2c2
Core - API - Adding to checks for transfer amount applier
GregJohnStewart May 20, 2026
f40839a
Core - Base Station - eliminating a possible edge case that fails tests
GregJohnStewart May 20, 2026
96b53db
Core - API - Tweaks from review
GregJohnStewart May 20, 2026
6a5f47a
Merge pull request #1270 from Epic-Breakfast-Productions/dev/1228-fr-…
GregJohnStewart May 20, 2026
f8816b1
Merge pull request #1264 from axgiri/dev/301-mongodb-indexing
GregJohnStewart May 21, 2026
a7ba727
Lib - Core API for Quarkus - Now using real entity for interacting en…
GregJohnStewart May 21, 2026
e12be24
Core - Base Station - Fixing getting user info properly
GregJohnStewart May 21, 2026
87562ab
Core - API - Cleanup of unused api
GregJohnStewart May 21, 2026
a9ada78
Core - API - Improvements from review
GregJohnStewart May 21, 2026
05ce88b
Core - Characteristics - Fixing potential issue in parsing ui entries
GregJohnStewart May 21, 2026
253ad1e
Core - Base Station - Fixing the display, or rather not displaying, a…
GregJohnStewart May 21, 2026
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 software/core/oqm-core-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group 'com.ebp.openQuarterMaster'
version '4.4.7'
version '5.0.0-SNAPSHOT'

repositories {
mavenCentral()
Expand Down Expand Up @@ -44,7 +44,7 @@ dependencies {

// https://mvnrepository.com/artifact/tech.units/indriya
// https://unitsofmeasurement.gitbook.io/uom-guide/getting-started/getting-started-with-indriya
implementation 'tech.units:indriya:2.2.3'
implementation 'tech.units:indriya:2.2.4'
implementation 'systems.uom:systems-common:2.2'
// https://mvnrepository.com/artifact/tech.uom.lib/uom-lib-jackson
implementation 'tech.uom.lib:uom-lib-jackson:2.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package tech.ebp.oqm.core.api.config;

import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;

import java.time.Duration;

@ConfigMapping(prefix = "service.mutex", namingStrategy = ConfigMapping.NamingStrategy.VERBATIM)
public interface MutexConfig {

@WithDefault("${quarkus.uuid}")
String instanceId();

@WithDefault("10m")
Duration lockExpireDuration();

AwaitConfig await();

interface AwaitConfig {
@WithDefault("30s")
Duration timeout();

@WithDefault("0ms")
Duration loopPauseMin();

@WithDefault("50ms")
Duration loopPauseMax();
}
Comment thread
GregJohnStewart marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package tech.ebp.oqm.core.api.exception.mutex;

/**
* Exception to use when a lock is attempted on a non registered mutex.
*/
Comment thread
GregJohnStewart marked this conversation as resolved.
public class MutexNotRegisteredException extends IllegalStateException {
public MutexNotRegisteredException(String mutexId) {
super("Mutex with id " + mutexId + " was not registered when lock attempt made.");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package tech.ebp.oqm.core.api.exception.mutex;

/**
* Exception to use when a wait for a mutex lock has been interrupted.
*/
Comment thread
GregJohnStewart marked this conversation as resolved.
public class MutexWaitInterruptedException extends IllegalStateException {
public MutexWaitInterruptedException(InterruptedException e) {
super("Mutex wait interrupted.", e);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.ebp.oqm.core.api.exception;
package tech.ebp.oqm.core.api.exception.mutex;

/**
* Exception to use when a wait for a mutex lock has timed out.
Expand All @@ -7,6 +7,7 @@
*/
public class MutexWaitTimeoutException extends IllegalStateException {
public MutexWaitTimeoutException() {
super("Mutex wait timed out. Could not acquire lock before timeout.");
}

public MutexWaitTimeoutException(String s) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.HealthCheckResponseBuilder;
import org.eclipse.microprofile.health.Startup;
import tech.ebp.oqm.core.api.config.MutexConfig;
import tech.ebp.oqm.core.api.exception.InvalidConfigException;
import tech.ebp.oqm.core.api.service.TempFileService;

Expand All @@ -25,42 +28,50 @@
@Startup
@ApplicationScoped
public class ConfigHealthCheck implements HealthCheck {

private static final String HEALTH_CHECK_NAME = "Config Sanity health check";


@Inject
@Getter(AccessLevel.PRIVATE)
MutexConfig mutexConfig;

@ConfigProperty(name = "service.tempDir")
Path tempDir;

private Map<String, String> checkRunningInfoConfig() {
Map<String, String> invalidConfigs = new HashMap<>();

try{
TempFileService.checkDir(tempDir);
} catch (InvalidConfigException e){
invalidConfigs.put("service.tempDir", "Specified temporary directory not suitable for temp file usage: " + e.getMessage());
}


if(mutexConfig.await().loopPauseMin().compareTo(mutexConfig.await().loopPauseMax()) > 0){
invalidConfigs.put("service.mutex.await.loopPauseMin", "loopPauseMin must be less than loopPauseMax");
}

return invalidConfigs;
}


@Override
public HealthCheckResponse call() {
Map<String, String> invalidConfigs = new HashMap<>();

invalidConfigs.putAll(checkRunningInfoConfig());

if (invalidConfigs.isEmpty()) {
return HealthCheckResponse.up(HEALTH_CHECK_NAME);
}
HealthCheckResponseBuilder builder = HealthCheckResponse.named(HEALTH_CHECK_NAME);

builder.down();

for (Map.Entry<String, String> curInv : invalidConfigs.entrySet()) {
builder.withData(curInv.getKey(), curInv.getValue());
}

return builder.build();
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -131,42 +131,6 @@ public Stored get(@PathParam("storedItemId") ObjectId id) {
return this.applyDefaults(super.get(id));
}

@PUT
@Path("{storedItemId}")
@Operation(
summary = "Updates a particular stored item. If applicable, amounts are disregarded. Use the transact endpoint to modify amounts, or add/remove stored items",
description = "Partial update to a object. Do not need to supply all fields, just the one(s) you wish to update."
)
@APIResponse(
responseCode = "200",
description = "Object updated."
)
@APIResponse(
responseCode = "400",
description = "Bad request given. Data given could not pass validation.",
content = @Content(mediaType = "text/plain")
)
@APIResponse(
responseCode = "404",
description = "Bad request given, could not find object at given id.",
content = @Content(mediaType = "text/plain")
)
@APIResponse(
responseCode = "410",
description = "Object requested has been deleted.",
content = @Content(mediaType = "text/plain")
)
@RolesAllowed(Roles.INVENTORY_EDIT)
@Produces(MediaType.APPLICATION_JSON)
public Stored update(
@PathParam("storedItemId")
ObjectId id,
@Schema(type = SchemaType.OBJECT, implementation = Stored.class, description = "Partial object updates; supply all or some of values to update.")
ObjectNode updates
) {
return this.applyDefaults(super.update(id, updates));
}

@GET
@Path("{storedItemId}/history")
@Operation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ public Stored update(
@Schema(type = SchemaType.OBJECT, implementation = Stored.class, description = "Partial object updates; supply all or some of values to update.")
ObjectNode updates
) {
return this.applyDefaults(super.update(id, updates));
log.info("Updating {} from REST interface with id {}", this.getObjectClass().getSimpleName(), id);

Stored updated = this.getObjectService().update(this.getOqmDbIdOrName(), null, id, updates, this.getInteractingEntity());

log.info("Updated {} with id {}", updated.getClass().getSimpleName(), id);

return this.applyDefaults(updated);
}

@GET
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package tech.ebp.oqm.core.api.model.object;

import com.fasterxml.jackson.annotation.JsonMerge;
import com.fasterxml.jackson.annotation.OptBoolean;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -39,6 +41,7 @@ public AttKeywordMainObject(ObjectId id, Map<@NotBlank @NotNull String, String>
*/
@NotNull
@NonNull
// @JsonMerge TODO:: #1261 figure out how to merge these; without, the whole map gets written on merge. With, partial updates are possible, but can't remove entries.
@lombok.Builder.Default
@Schema(required = false, description = "Attribute key/value (string) pairs to associate with the object.", examples = {"{}", "{\"key\": \"value\"}"})
private Map<@NotBlank @NotNull String, String> attributes = new HashMap<>();
Expand Down
Loading
Loading