Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d7b39c4
Merge branch 'germ-importer-opts' into java-21-uuid
jloux-brapi Apr 4, 2025
939a2df
Utilize pagination fixes for observations and OUnits
jloux-brapi Apr 18, 2025
a1f895c
Use @SecondaryTables on studies to fix hibernate n+1 query issues
jloux-brapi Apr 23, 2025
7dc567b
Create entities in batch for OU post call
jloux-brapi Apr 23, 2025
413942c
Rename migration to avoid collision
jloux-brapi Apr 23, 2025
251e0a6
Merge branch 'observation-search-opts' into observation-importer-opts
jloux-brapi Apr 23, 2025
8eba827
Finish Observation and ObservationUnit Import optimizations
jloux-brapi Apr 30, 2025
05f51b4
Use unpaginated search query in favor of findByIdIn
jloux-brapi May 1, 2025
0f0dce1
Add migration scripts
jloux-brapi May 6, 2025
fab5f05
Resolve compilation issues after migration
jloux-brapi May 21, 2025
7aa2e93
Add endpoints, create first base entity repository
jloux-brapi May 27, 2025
0c6878a
Refactor Repo configuration and structure to allow for two base repos
jloux-brapi May 27, 2025
d41deee
Merge observation optimizations from BI fork to prod server
jloux-brapi May 29, 2025
6822f8b
Merge bi fork dynamic observation levels into prod server
jloux-brapi May 29, 2025
47f5521
Fix bug in PUT method, correct server info for obslvlnames
jloux-brapi Jul 2, 2025
0ce831e
Add unique index for level_name, program_id
jloux-brapi Jul 11, 2025
c12dc37
Ensure batch optimizations for obs and obs units is intact
jloux-brapi Jul 21, 2025
ac24c99
Merge branch 'brapi-server-v2' into obs-opts
jloux-brapi Jul 21, 2025
5ff4b4f
Address review comments
jloux-brapi Jul 21, 2025
3862f76
Utilize static typing for observation service comment
jloux-brapi Jul 21, 2025
1fdd5eb
Merge branch 'obs-opts' into dynamic-obs-levels
jloux-brapi Jul 22, 2025
38a0272
Merge pull request #11 from plantbreeding/obs-opts
jloux-brapi Aug 4, 2025
47a07b9
Merge branch 'plantbreeding:brapi-server-v2' into develop
nickpalladino Aug 4, 2025
6893588
Rename migrations for ordering
nickpalladino Aug 5, 2025
7080106
Rename migrations for ordering
nickpalladino Aug 5, 2025
6f63b00
Checkout correct branch
nickpalladino Aug 6, 2025
a997f43
Rename step to be more accurate
nickpalladino Aug 6, 2025
e5479c2
Merge pull request #2 from Breeding-Insight/bug/BI-2688
mlm483 Aug 6, 2025
5399628
Make old /observationlevels endpoint usable
jloux-brapi Aug 6, 2025
e53ea4b
Merge pull request #15 from Breeding-Insight/rename-migrations
jloux-brapi Aug 6, 2025
66df793
Merge branch 'plantbreeding:brapi-server-v2' into develop
nickpalladino Aug 6, 2025
d05da74
Add DISTINCT to select id only query
jloux-brapi Aug 6, 2025
3576212
Merge pull request #16 from plantbreeding/id-query-distinct-bug
BrapiCoordinatorSelby Aug 7, 2025
35e5675
Merge branch 'brapi-server-v2' into dynamic-obs-levels
jloux-brapi Aug 7, 2025
a3009e4
Merge branch 'plantbreeding:brapi-server-v2' into develop
nickpalladino Aug 8, 2025
6afd444
Optimize /observationlevels GET endpoint for use with dynamic obs lvls
jloux-brapi Aug 8, 2025
8b7414c
Fix issues with study posts including obs lvls, fix ou search
jloux-brapi Aug 12, 2025
6011699
Improve var usage, add comments
jloux-brapi Aug 12, 2025
a08dc2a
Support for removing level_name_new and utilizing new column ref
jloux-brapi Aug 13, 2025
44d1472
Merge pull request #8 from Breeding-Insight/release/1.1.1
mlm483 Aug 28, 2025
f032294
[BI-2219] Obfuscate unused new level name fields
jloux-brapi Jan 27, 2026
fde4e15
Return 409 with offending duplicate message
jloux-brapi Jan 29, 2026
d76fc89
Update migration file to add partial index for global level names
jloux-brapi Jan 29, 2026
47ab537
Add page and pageCount to get method. POST returns empty metadata
jloux-brapi Feb 2, 2026
c7661d4
Merge pull request #17 from plantbreeding/dynamic-obs-levels
jloux-brapi Feb 9, 2026
b40584f
Merge pull request #9 from plantbreeding/brapi-server-v2
nickpalladino Feb 9, 2026
b7385d7
Migration to remove treatments out of ou additionalInfo
jloux-brapi Feb 13, 2026
9968f3f
Change migration version
jloux-brapi Feb 17, 2026
cb252be
Merge pull request #10 from Breeding-Insight/bug/BI-2786
jloux-brapi Feb 17, 2026
9cba318
Create pull_request_template.md
sb2597 Feb 18, 2026
0ff5b11
Added observation levels migration
nickpalladino Mar 16, 2026
2a7d88c
Merge pull request #11 from Breeding-Insight/feature/BI-2779
nickpalladino Mar 20, 2026
a9ef485
Fix NPE use cases
jloux-brapi Mar 20, 2026
eb009cb
Merge pull request #12 from Breeding-Insight/bug/BI-2818
jloux-brapi Mar 20, 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
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Description
**Story:** _Please include a link to the story in Jira_

_Please include a summary of the change that was made._



# Dependencies
_Please include any dependencies to other code branches, testing configurations, scripts to be run, etc._

# Testing
_Please include any details needed for reviewers to test this code_


# Checklist:

- [ ] I have performed a self-review of my own code
- [ ] I have tested my code and ensured it meets the acceptance criteria of the story
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have either updated the source of truth or arranged for update with product owner if needed https://breedinginsight.atlassian.net/wiki/spaces/BI/pages/1559953409/Source+of+Truth
68 changes: 68 additions & 0 deletions src/main/java/io/swagger/api/pheno/ObservationLevelNamesApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package io.swagger.api.pheno;

import io.swagger.annotations.*;
import io.swagger.model.pheno.*;
import jakarta.validation.Valid;
import org.brapi.test.BrAPITestServer.exceptions.BrAPIServerException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@javax.annotation.processing.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-05-21T16:32:22.556Z[GMT]")
@Api(value = "observationlevelnames", description = "the observationlevelnames API")
public interface ObservationLevelNamesApi {
@ApiOperation(value = "Get the Observation Level Names", nickname = "observationlevelnamesGet", notes = "Call to retrieve the list of supported observation level names", response = ObservationLevelListResponse.class, authorizations = {
@Authorization(value = "AuthorizationToken") }, tags = { "Observation level names", })
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = ObservationLevelListResponse.class),
@ApiResponse(code = 400, message = "Bad Request", response = String.class),
@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
@ApiResponse(code = 403, message = "Forbidden", response = String.class) })
@RequestMapping(value = "/observationlevelnames", produces = { "application/json" }, method = RequestMethod.GET)
ResponseEntity<ObservationLevelListResponse> observationlevelnamesGet(
@ApiParam(value = "programDbId") @Valid @RequestParam(value = "programDbId", required = false) String programDbId,
@ApiParam(value = "all") @Valid @RequestParam(value = "all", required = false) Boolean all,
@ApiParam(value = "page") @Valid @RequestParam(value = "page", required = false) Integer page,
@ApiParam(value = "pageSize") @Valid @RequestParam(value = "pageSize", required = false) Integer pageSize,
@ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
throws BrAPIServerException;

@ApiOperation(value = "Create Observation Level Names", nickname = "observationlevelnamesPost", notes = "Call to save a list of observation level names", response = ObservationLevelListResponse.class, authorizations = {
@Authorization(value = "AuthorizationToken") }, tags = { "Observation level names", })
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = ObservationLevelListResponse.class),
@ApiResponse(code = 400, message = "Bad Request", response = String.class),
@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
@ApiResponse(code = 403, message = "Forbidden", response = String.class) })
@RequestMapping(value = "/observationlevelnames", produces = { "application/json" }, method = RequestMethod.POST)
ResponseEntity<ObservationLevelListResponse> observationlevelnamesPost(
@ApiParam(value = "") @Valid @RequestBody List<ObservationLevelNewRequest> body,
@ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
throws BrAPIServerException;

@ApiOperation(value = "Delete Observation Level Names", nickname = "observationlevelnamesGet", notes = "Call to delete a list of observation level names", response = ObservationLevelListResponse.class, authorizations = {
@Authorization(value = "AuthorizationToken") }, tags = { "Observation level names", })
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = ObservationLevelListResponse.class),
@ApiResponse(code = 400, message = "Bad Request", response = String.class),
@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
@ApiResponse(code = 403, message = "Forbidden", response = String.class) })
@RequestMapping(value = "/observationlevelnames/{observationlevelnameDbId}", produces = { "application/json" }, method = RequestMethod.DELETE)
ResponseEntity<ObservationLevelListResponse> observationlevelnamesDelete(
@ApiParam(value = "The unique ID of this generic list", required = true) @PathVariable("observationlevelnameDbId") String observationLevelNameDbId,
@ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
throws BrAPIServerException;

@ApiOperation(value = "Update an existing Observation Level Name", nickname = "observationlevelnamesDbIdPut", notes = "Update an existing Observation Level Name", response = ObservationLevelListResponse.class, authorizations = {
@Authorization(value = "AuthorizationToken") }, tags = { "Observation Units", })
@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = ObservationUnitHierarchyLevel.class),
@ApiResponse(code = 400, message = "Bad Request", response = String.class),
@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
@ApiResponse(code = 403, message = "Forbidden", response = String.class) })
@RequestMapping(value = "/observationlevelnames/{observationlevelnameDbId}", produces = { "application/json" }, consumes = {
"application/json" }, method = RequestMethod.PUT)
ResponseEntity<ObservationLevelSingleResponse> observationlevelnamesDbIdPut(
@ApiParam(value = "The unique ID of the specific Observation Level Name", required = true) @PathVariable("observationlevelnameDbId") String observationlevelnameDbId,
@ApiParam(value = "") @Valid @RequestBody ObservationLevelNewRequest body,
@ApiParam(value = "HTTP HEADER - Token used for Authorization <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
throws BrAPIServerException;
}

11 changes: 11 additions & 0 deletions src/main/java/io/swagger/model/core/StudyNewRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public class StudyNewRequest extends BrAPIDataModel{
@JsonProperty("trialDbId")
private String trialDbId = null;

@JsonProperty("programDbId")
private String programDbId = null;

@JsonProperty("trialName")
private String trialName = null;

Expand Down Expand Up @@ -463,6 +466,14 @@ public void setTrialDbId(String trialDbId) {
this.trialDbId = trialDbId;
}

public String getProgramDbId() {
return programDbId;
}

public void setProgramDbId(String programDbId) {
this.programDbId = programDbId;
}

public StudyNewRequest trialName(String trialName) {
this.trialName = trialName;
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.swagger.model.pheno;

public class ObservationLevelNewRequest extends ObservationUnitHierarchyLevel {
private Boolean global = null;

public Boolean getGlobal() {
return global;
}

public void setGlobal(Boolean value) {
this.global = value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
package io.swagger.model.pheno;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;


import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.BrAPIResponse;
import io.swagger.model.Context;
import io.swagger.model.Metadata;

import io.swagger.model.pheno.ObservationLevelListResponseResult;
import org.springframework.validation.annotation.Validated;
import jakarta.validation.Valid;


/**
* ObservationLevelListResponse
*/
@Validated
@javax.annotation.processing.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-03-20T16:32:22.556Z[GMT]")
public class ObservationLevelSingleResponse implements BrAPIResponse<ObservationUnitHierarchyLevel> {
@JsonProperty("@context")
private Context _atContext = null;

@JsonProperty("metadata")
private Metadata metadata = null;

@JsonProperty("result")
private ObservationUnitHierarchyLevel result = null;

public ObservationLevelSingleResponse _atContext(Context _atContext) {
this._atContext = _atContext;
return this;
}



public void set_atContext(Context _atContext) {
this._atContext = _atContext;
}

public ObservationLevelSingleResponse metadata(Metadata metadata) {
this.metadata = metadata;
return this;
}

/**
* Get metadata
* @return metadata
**/
@ApiModelProperty(required = true, value = "")


@Valid
public Metadata getMetadata() {
return metadata;
}

public void setMetadata(Metadata metadata) {
this.metadata = metadata;
}

public ObservationLevelSingleResponse result(ObservationUnitHierarchyLevel result) {
this.result = result;
return this;
}

/**
* Get result
* @return result
**/
@ApiModelProperty(required = true, value = "")


@Valid
public ObservationUnitHierarchyLevel getResult() {
return result;
}

public void setResult(ObservationUnitHierarchyLevel result) {
this.result = result;
}


@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ObservationLevelSingleResponse observationLevelSingleResponse = (ObservationLevelSingleResponse) o;
return Objects.equals(this._atContext, observationLevelSingleResponse._atContext) &&
Objects.equals(this.metadata, observationLevelSingleResponse.metadata) &&
Objects.equals(this.result, observationLevelSingleResponse.result);
}

@Override
public int hashCode() {
return Objects.hash(_atContext, metadata, result);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ObservationLevelListResponse {\n");

sb.append(" _atContext: ").append(toIndentedString(_atContext)).append("\n");
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
sb.append(" result: ").append(toIndentedString(result)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,7 @@ public enum ObservationTableHeaderRowEnum {
GERMPLASMNAME("germplasmName"),
POSITIONCOORDINATEX("positionCoordinateX"),
POSITIONCOORDINATEY("positionCoordinateY"),
YEAR("year"),
FIELD("field"),
PLOT("plot"),
SUB_PLOT("sub-plot"),
PLANT("plant"),
POT("pot"),
BLOCK("block"),
ENTRY("entry"),
REP("rep");
YEAR("year");
private String value;

ObservationTableHeaderRowEnum(String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,42 @@

import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

public class ObservationUnitHierarchyLevel {

@JsonProperty("levelNameDbId")
private String levelNameDbId = null;

@JsonProperty("levelName")
private ObservationUnitHierarchyLevelEnum levelName = null;
private String levelName = null;

@JsonProperty("levelOrder")
private Integer levelOrder = null;

public ObservationUnitHierarchyLevel levelName(ObservationUnitHierarchyLevelEnum levelName) {
this.levelName = levelName;
return this;
@JsonProperty("programDbId")
@JsonInclude(JsonInclude.Include.NON_NULL)
private String programDbId = null;

// NOTE: This property is NOT used for lookups, only responses.
@JsonProperty("programName")
@JsonInclude(JsonInclude.Include.NON_NULL)
private String programName = null;

public String getLevelNameDbId() {
return levelNameDbId;
}

public void setLevelNameDbId(String value) {
this.levelNameDbId = value;
}

public ObservationUnitHierarchyLevelEnum getLevelName() {
public String getLevelName() {
return levelName;
}

public void setLevelName(ObservationUnitHierarchyLevelEnum levelName) {
public void setLevelName(String levelName) {
this.levelName = levelName;
}

Expand All @@ -38,6 +54,22 @@ public void setLevelOrder(Integer levelOrder) {
this.levelOrder = levelOrder;
}

public String getProgramDbId() {
return programDbId;
}

public void setProgramDbId(String value) {
this.programDbId = value;
}

public String getProgramName() {
return programName;
}

public void setProgramName(String value) {
this.programName = value;
}

@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
Expand All @@ -47,13 +79,12 @@ public boolean equals(java.lang.Object o) {
return false;
}
ObservationUnitHierarchyLevel observationUnitHierarchyLevel = (ObservationUnitHierarchyLevel) o;
return Objects.equals(this.levelName, observationUnitHierarchyLevel.levelName)
&& Objects.equals(this.levelOrder, observationUnitHierarchyLevel.levelOrder);
return Objects.equals(this.levelNameDbId, observationUnitHierarchyLevel.levelNameDbId);
}

@Override
public int hashCode() {
return Objects.hash(levelName, levelOrder);
return Objects.hash(levelNameDbId);
}

@Override
Expand All @@ -63,7 +94,9 @@ public String toString() {

sb.append(" levelName: ").append(toIndentedString(levelName)).append("\n");
sb.append(" levelOrder: ").append(toIndentedString(levelOrder)).append("\n");
sb.append("}");
sb.append(" levelNameDbId: ").append(toIndentedString(levelNameDbId)).append("\n");
sb.append(" programDbId: ").append(toIndentedString(programDbId)).append("\n");
sb.append(" programName: ").append(toIndentedString(programName)).append("\n");
return sb.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public boolean equals(Object obj) {
if (getClass() != obj.getClass())
return false;
ObservationUnitLevel other = (ObservationUnitLevel) obj;
return Objects.equals(levelCode, other.levelCode);
return Objects.equals(getLevelNameDbId(), other.getLevelNameDbId());
}

@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + Objects.hash(levelCode);
result = prime * result + Objects.hash(getLevelNameDbId());
return result;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.brapi.test.BrAPITestServer.auth;
package org.brapi.test.BrAPITestServer.config;

import org.brapi.test.BrAPITestServer.auth.BrapiTestServerJWTAuthFilter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Loading
Loading