Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify setting workspace metadata & add tests #694

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

MrCreosote
Copy link
Member

... in preparation for setting object admin metadata which will hopefully reuse the code

... in preparation for setting object admin metadata which will
hopefully reuse the code
@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #694 (3f3a505) into develop (c8672aa) will increase coverage by 0.01%.
Report is 4 commits behind head on develop.
The diff coverage is 92.85%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #694      +/-   ##
=============================================
+ Coverage      87.42%   87.44%   +0.01%     
- Complexity      5193     5195       +2     
=============================================
  Files            223      223              
  Lines          17319    17309      -10     
  Branches        2546     2545       -1     
=============================================
- Hits           15141    15135       -6     
+ Misses          1711     1708       -3     
+ Partials         467      466       -1     


throws WorkspaceCommunicationException, CorruptWorkspaceDBException {
// TODO NOW CODE integrate keys to remove (below) into this method and do it all in
// one shot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mysterious space?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tabbed it in to make it clear it's a continuation of the TODO

Comment on lines +751 to +758
if (ur.getModifiedCount() == 1) { //ok, it worked
return time;
} else if (attempts >= maxattempts) {
throw new WorkspaceCommunicationException(
String.format("Failed to update metadata %s times", attempts));
} else {
return null;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you were having an anti-indentation day, you could do:

			if (ur.getModifiedCount() == 1) { //ok, it worked
 				return time;
 			}
 			if (attempts >= maxattempts) {
 				throw new WorkspaceCommunicationException(
 						String.format("Failed to update metadata %s times", attempts));
 			}
                        return null;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually prefer the elses here, makes things a bit easier to read for me. Not a big deal though

@MrCreosote MrCreosote merged commit b02d1b1 into kbase:develop Oct 13, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants