876: Added optional to all of the nullable function returns in POTDRe…#861
876: Added optional to all of the nullable function returns in POTDRe…#861Arshadul-Monir merged 2 commits intomainfrom
Conversation
Available PR Commands
See: https://github.com/tahminator/codebloom/wiki/CI-Commands |
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement Description
Diagram Walkthroughflowchart LR
A["POTDRepository Interface"] -- "Update return types" --> B["POTDSqlRepository Implementation"]
B -- "Return Optional.of/empty" --> C["SubmissionController"]
C -- "Handle Optional" --> D["SubmissionsHandler"]
D -- "Handle Optional" --> E["PotdSetter"]
E -- "Handle Optional" --> F["Unit Tests"]
F -- "Adjust mocks and assertions" --> G["Codebase Stability"]
|
| Relevant files | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Enhancement | |||||||||
| Interface change | 1 files
| ||||||||
| Implementation change | 1 files
| ||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
src/test/java/org/patinanetwork/codebloom/common/db/repos/potd/POTDRepositoryTest.java
Outdated
Show resolved
Hide resolved
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement Description
Diagram Walkthroughflowchart LR
A[POTDRepository Interface] --> B[POTDSqlRepository]
A --> C[SubmissionController]
A --> D[SubmissionsHandler]
A --> E[PotdSetter]
A --> F[Tests]
B -- "Implement Optional returns" --> A
C -- "Consume Optional<POTD>" --> A
D -- "Consume Optional<POTD>" --> A
E -- "Consume Optional<POTD>" --> A
F -- "Update mocks/assertions" --> A
|
| Relevant files | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 5 files
| ||||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
src/test/java/org/patinanetwork/codebloom/scheduled/potd/PotdSetterTest.java
Outdated
Show resolved
Hide resolved
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement Description
Diagram Walkthroughflowchart LR
A["POTDRepository Interface"] -- "Update method signatures" --> B["Optional<POTD> Returns"];
C["POTDSqlRepository Implementation"] -- "Implement Optional returns" --> B;
D["SubmissionController"] -- "Consume Optional<POTD>" --> B;
E["SubmissionsHandler"] -- "Consume Optional<POTD>" --> B;
F["PotdSetter"] -- "Consume Optional<POTD>" --> B;
G["Related Tests"] -- "Update mocks & assertions" --> B;
|
| Relevant files | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 5 files
| ||||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
|
/deploy |
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement, Tests Description
Diagram Walkthroughflowchart LR
A[POTDRepository Interface] -- "Return Optional<POTD>" --> B[POTDSqlRepository Implementation]
B -- "Used by" --> C[API Controllers & Handlers]
B -- "Used by" --> D[Scheduled Tasks]
E[Unit Tests] -- "Updated for Optional" --> A
E -- "Updated for Optional" --> B
E -- "Updated for Optional" --> C
E -- "Updated for Optional" --> D
|
| Relevant files | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 5 files
| ||||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
src/main/java/org/patinanetwork/codebloom/common/submissions/SubmissionsHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/patinanetwork/codebloom/api/submission/SubmissionController.java
Outdated
Show resolved
Hide resolved
|
/deploy |
src/main/java/org/patinanetwork/codebloom/api/submission/SubmissionController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/patinanetwork/codebloom/api/submission/SubmissionController.java
Outdated
Show resolved
Hide resolved
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement Description
Diagram Walkthroughflowchart LR
POTDRepository_Interface["POTDRepository (Interface)"] --> POTDSqlRepository_Impl["POTDSqlRepository (Implementation)"]
POTDSqlRepository_Impl -- returns Optional<POTD> --> SubmissionController["SubmissionController"]
POTDSqlRepository_Impl -- returns Optional<POTD> --> SubmissionsHandler["SubmissionsHandler"]
POTDSqlRepository_Impl -- returns Optional<POTD> --> PotdSetter["PotdSetter"]
SubmissionController -- handles Optional, throws exception --> ResponseStatusException["ResponseStatusException (Error)"]
SubmissionsHandler -- handles Optional --> Logic["Business Logic"]
PotdSetter -- handles Optional --> Logic
|
| Relevant files | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 1 files
| ||||||||
| Interface change | 1 files
| ||||||||
| Implementation change | 1 files
| ||||||||
| Code refactoring | |||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement, Refactoring, Tests Description
Diagram Walkthroughflowchart LR
POTDRepo["POTDRepository"] --> OptionalReturn{"Return Optional<POTD>"};
OptionalReturn --> SubController["SubmissionController"];
OptionalReturn --> SubHandler["SubmissionsHandler"];
OptionalReturn --> PotdSetter["PotdSetter"];
SubController -- "Uses Optional, throws ResponseStatusException" --> APIError["API Error Handling"];
SubHandler -- "Adapts to Optional" --> SubHandler;
PotdSetter -- "Adapts to Optional" --> PotdSetter;
OptionalReturn -- "Reflected in" --> Tests["Updated Unit Tests"];
APIError -- "Reflected in" --> Tests;
|
| Relevant files | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Error handling | 1 files
| ||||||||
| Refactoring | 4 files
| ||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
src/main/java/org/patinanetwork/codebloom/api/submission/SubmissionController.java
Show resolved
Hide resolved
src/main/java/org/patinanetwork/codebloom/common/db/repos/potd/POTDSqlRepository.java
Show resolved
Hide resolved
src/main/java/org/patinanetwork/codebloom/common/submissions/SubmissionsHandler.java
Outdated
Show resolved
Hide resolved
|
/deploy |
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement Description
Diagram Walkthroughflowchart LR
A[POTDRepository] -- "Return Optional<POTD>" --> B{Consumers};
B -- "Handle Optional" --> C[SubmissionController];
B -- "Handle Optional" --> D[SubmissionsHandler];
B -- "Handle Optional" --> E[PotdSetter];
C -- "Throw ResponseStatusException" --> F[Error Handling];
|
| Relevant files | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 1 files
| ||||||||
| Interface change | 1 files
| ||||||||
| Implementation | 1 files
| ||||||||
| Logic update | |||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
src/main/java/org/patinanetwork/codebloom/common/submissions/SubmissionsHandler.java
Outdated
Show resolved
Hide resolved
|
/deploy |
|
/deploy |
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement, Error handling, Tests Description
Diagram Walkthroughflowchart LR
POTDRepoInterface["POTDRepository Interface"] -- "Return Optional<POTD>" --> POTDSqlRepo["POTDSqlRepository Implementation"]
POTDSqlRepo -- "Used by" --> SubmissionCtrl["SubmissionController"]
POTDSqlRepo -- "Used by" --> SubmissionsHndlr["SubmissionsHandler"]
POTDSqlRepo -- "Used by" --> PotdSetter["PotdSetter Scheduled Task"]
SubmissionCtrl -- "Adapt logic & throw ResponseStatusException" --> UnitTests["Updated Unit Tests"]
SubmissionsHndlr -- "Adapt logic" --> UnitTests
PotdSetter -- "Adapt logic" --> UnitTests
|
| Relevant files | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Error handling | 1 files
| ||||||||
| Abstraction / code structure | |||||||||
| Enhancement | |||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
src/main/java/org/patinanetwork/codebloom/api/submission/SubmissionController.java
Show resolved
Hide resolved
src/main/java/org/patinanetwork/codebloom/common/submissions/SubmissionsHandler.java
Outdated
Show resolved
Hide resolved
…pository 876: reduced multiple Optional.get() operations down into one 876: Condensed multiplier logic
Title876: Added optional to all of the nullable function returns in POTDRe… PR TypeEnhancement Description
Diagram Walkthroughflowchart LR
A[SubmissionController] --> B{POTDRepository};
B -- "Optional<POTD>" --> C[SubmissionsHandler];
B -- "Optional<POTD>" --> D[PotdSetter];
B --> E[POTDSqlRepository];
A -- "ResponseStatusException" --> F[API Client];
|
| Relevant files | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 5 files
| ||||||||||
| Tests | 4 files
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
|
/improve |
PR Code Suggestions ✨No code suggestions found for the PR. |
|
/deploy |
876
…pository
Description of changes
Replaced returns and return types of any function that can return a null value with an Optional return type for POTDRepository. Also edited anywhere that used those functions to match the return type.
Checklist before review
Screenshots
Dev
Staging