Skip to content

Commit 749081a

Browse files
Merge branch 'development' into feature
2 parents 3780441 + 108a620 commit 749081a

8 files changed

Lines changed: 163 additions & 34 deletions

File tree

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at devex@relativity.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

Gravity/.editorconfig

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ csharp_style_expression_bodied_methods = when_on_single_line:suggestion
5858
#prefer out variables to be declared inline in the argument list of a method call when possible
5959
csharp_style_inlined_variable_declaration = true:suggestion
6060
#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them
61-
dotnet_style_predefined_type_for_member_access = true:suggestion
61+
dotnet_style_predefined_type_for_member_access = true:warning
6262

6363
#Style - implicit and explicit types
6464

@@ -70,7 +70,7 @@ csharp_style_var_when_type_is_apparent = true:suggestion
7070
#Style - language keyword and framework type options
7171

7272
#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them
73-
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
73+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
7474

7575
#Style - qualification options
7676

@@ -80,4 +80,85 @@ dotnet_style_qualification_for_field = false:suggestion
8080
dotnet_style_qualification_for_method = false:suggestion
8181
#prefer properties not to be prefaced with this. or Me. in Visual Basic
8282
dotnet_style_qualification_for_property = false:suggestion
83-
dotnet_style_qualification_for_event = false:suggestion
83+
dotnet_style_qualification_for_event = false:suggestion
84+
85+
86+
# NAMING CONVENTIONS
87+
88+
#Classes, Interfaces: Pascal
89+
dotnet_naming_rule.types.severity = warning
90+
dotnet_naming_rule.types.symbols = types_def
91+
dotnet_naming_rule.types.style = types_style
92+
93+
dotnet_naming_symbols.types_def.applicable_kinds = class, struct, interface, enum
94+
dotnet_naming_symbols.types_def.applicable_accessibilities = *
95+
96+
dotnet_naming_style.types_style.capitalization = pascal_case
97+
98+
#Methods: Pascal
99+
dotnet_naming_rule.methods.severity = warning
100+
dotnet_naming_rule.methods.symbols = methods_def
101+
dotnet_naming_rule.methods.style = methods_style
102+
103+
dotnet_naming_symbols.methods_def.applicable_kinds = method
104+
dotnet_naming_symbols.methods_def.applicable_accessibilities = *
105+
106+
dotnet_naming_style.methods_style.capitalization = pascal_case
107+
108+
#Local variables: Camel
109+
dotnet_naming_rule.locals.severity = warning
110+
dotnet_naming_rule.locals.symbols = locals_def
111+
dotnet_naming_rule.locals.style = locals_style
112+
113+
dotnet_naming_symbols.locals_def.applicable_kinds = local, local_function
114+
115+
dotnet_naming_style.locals_style.capitalization = camel_case
116+
117+
#Method argumens: Camel
118+
dotnet_naming_rule.method_arguments.severity = warning
119+
dotnet_naming_rule.method_arguments.symbols = method_arguments_def
120+
dotnet_naming_rule.method_arguments.style = method_arguments_style
121+
122+
dotnet_naming_symbols.method_arguments_def.applicable_kinds = parameter
123+
124+
dotnet_naming_style.method_arguments_style.capitalization = camel_case
125+
126+
#private member variables: camel, underscore prefix
127+
128+
dotnet_naming_rule.private_member_variables.severity = warning
129+
dotnet_naming_rule.private_member_variables.symbols = private_member_variables_def
130+
dotnet_naming_rule.private_member_variables.style = private_member_variables_style
131+
132+
dotnet_naming_symbols.private_member_variables_def.applicable_kinds = field, delegate, event
133+
dotnet_naming_symbols.private_member_variables_def.applicable_accessibilities = private
134+
135+
dotnet_naming_style.private_member_variables_style.capitalization = camel_case
136+
dotnet_naming_style.private_member_variables_style.required_prefix = _
137+
138+
#private constants: All caps, underscore-seperated, underscore-prefix
139+
140+
dotnet_naming_rule.private_constants.severity = warning
141+
dotnet_naming_rule.private_constants.symbols = private_constants_def
142+
dotnet_naming_rule.private_constants.style = private_constants_style
143+
144+
dotnet_naming_symbols.private_constants_def.applicable_kinds = field
145+
dotnet_naming_symbols.private_constants_def.applicable_accessibilities = private
146+
dotnet_naming_symbols.private_constants_def.required_modifiers = const
147+
148+
dotnet_naming_style.private_constants_style.capitalization = all_upper
149+
dotnet_naming_style.private_constants_style.word_separator = _
150+
dotnet_naming_style.private_constants_style.required_prefix = _
151+
152+
153+
#Non-private Constants: All caps, underscore-seperated, no prefix
154+
155+
dotnet_naming_rule.non_private_constants.severity = warning
156+
dotnet_naming_rule.non_private_constants.symbols = non_private_constants_def
157+
dotnet_naming_rule.non_private_constants.style = non_private_constants_style
158+
159+
dotnet_naming_symbols.non_private_constants_def.applicable_kinds = field
160+
dotnet_naming_symbols.non_private_constants_def.applicable_accessibilities = public, protected, internal
161+
dotnet_naming_symbols.non_private_constants_def.required_modifiers = const
162+
163+
dotnet_naming_style.non_private_constants_style.capitalization = all_upper
164+
dotnet_naming_style.non_private_constants_style.word_separator = _

Gravity/Gravity.Test.Unit/RsapiDaoDeleteTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ private void SetupQuery<T>(int parentArtifactId, int[] resultArtifactIds) where
116116
}
117117

118118
private void ExecuteDelete(ObjectFieldsDepthLevel depthLevel)
119-
=> new RsapiDao(mockProvider.Object).Delete<GravityLevelOne>(rootId, depthLevel);
119+
=> new RsapiDao(mockProvider.Object, null).Delete<GravityLevelOne>(rootId, depthLevel);
120120
}
121121
}

Gravity/Gravity.Test.Unit/RsapiDaoGetTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class RsapiDaoGetTests
2424
[Test]
2525
public void Get_BlankRDO()
2626
{
27-
var dao = new RsapiDao(GetChoiceRsapiProvider(null, null));
27+
var dao = new RsapiDao(GetChoiceRsapiProvider(null, null), null);
2828
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FirstLevelOnly);
2929
Assert.AreEqual(RootArtifactID, dto.ArtifactId);
3030
}
@@ -35,7 +35,7 @@ public void Get_MultiObject_FirstLevelOnly()
3535
//test MultiObject fields with one level of recursion
3636
int[] multiObjectIds = new int[] { 1 , 2 , 3 };
3737
int[] singleObjectLevel3ArtifactIds = new int[] { 5 , 6 , 7 };
38-
var dao = new RsapiDao(GetMultipleObjectRsapiProvider(multiObjectIds, singleObjectLevel3ArtifactIds));
38+
var dao = new RsapiDao(GetMultipleObjectRsapiProvider(multiObjectIds, singleObjectLevel3ArtifactIds), null);
3939
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FirstLevelOnly);
4040
for(int i = 0; i < multiObjectIds.Length; i++)
4141
{
@@ -50,7 +50,7 @@ public void Get_MultiObject_Recursive()
5050
//test MultiObject fields with varying degrees of recursion
5151
int[] multiObjectIds = new int[] { 1, 2, 3 };
5252
int[] singleObjectLevel3ArtifactIds = new int[] { 5 , 6 , 7 };
53-
var dao = new RsapiDao(GetMultipleObjectRsapiProvider(multiObjectIds, singleObjectLevel3ArtifactIds));
53+
var dao = new RsapiDao(GetMultipleObjectRsapiProvider(multiObjectIds, singleObjectLevel3ArtifactIds), null);
5454
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FullyRecursive);
5555
for (int i = 0; i < multiObjectIds.Length; i++)
5656
{
@@ -66,7 +66,7 @@ public void Get_ChildObjectList_FirstLevelOnly()
6666
int level2ChildObjectId = 1;
6767
int singleObjectLevel3Id = 2;
6868
int level3ChildObjectId = 3;
69-
var dao = new RsapiDao(GetChildObjectRsapiProvider(level2ChildObjectId, singleObjectLevel3Id, level3ChildObjectId));
69+
var dao = new RsapiDao(GetChildObjectRsapiProvider(level2ChildObjectId, singleObjectLevel3Id, level3ChildObjectId), null);
7070
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FirstLevelOnly);
7171
Assert.AreEqual(level2ChildObjectId, dto.GravityLevel2Childs[0].ArtifactId);
7272
Assert.IsNull(dto.GravityLevel2Childs[0].GravityLevel3Obj);
@@ -80,7 +80,7 @@ public void Get_ChildObjectList_Recursive()
8080
int level2ChildObjectId = 1;
8181
int singleObjectLevel3Id = 2;
8282
int level3ChildObjectId = 3;
83-
var dao = new RsapiDao(GetChildObjectRsapiProvider(level2ChildObjectId, singleObjectLevel3Id, level3ChildObjectId));
83+
var dao = new RsapiDao(GetChildObjectRsapiProvider(level2ChildObjectId, singleObjectLevel3Id, level3ChildObjectId), null);
8484
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FullyRecursive);
8585
Assert.AreEqual(level2ChildObjectId, dto.GravityLevel2Childs[0].ArtifactId);
8686
Assert.AreEqual(singleObjectLevel3Id, dto.GravityLevel2Childs[0].GravityLevel3Obj.ArtifactId);
@@ -93,7 +93,7 @@ public void Get_SingleObject_FirstLevelOnly()
9393
//test single object fields with one level of recursion
9494
int singleObjectLevel2ArtifactId = 1;
9595
int singleObjectLevel3ArtifactId = 2;
96-
var dao = new RsapiDao(GetObjectRsapiProvider(singleObjectLevel2ArtifactId, singleObjectLevel3ArtifactId));
96+
var dao = new RsapiDao(GetObjectRsapiProvider(singleObjectLevel2ArtifactId, singleObjectLevel3ArtifactId), null);
9797
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FirstLevelOnly);
9898
Assert.AreEqual(singleObjectLevel2ArtifactId, dto.GravityLevel2Obj.ArtifactId);
9999
Assert.IsNull(dto.GravityLevel2Obj.GravityLevel3SingleObj);
@@ -105,7 +105,7 @@ public void Get_SingleObject_Recursive()
105105
//test single object fields with varying degrees of recursion
106106
int singleObjectLevel2ArtifactId = 25;
107107
int singleObjectLevel3ArtifactId = 26;
108-
var dao = new RsapiDao(GetObjectRsapiProvider(singleObjectLevel2ArtifactId, singleObjectLevel3ArtifactId));
108+
var dao = new RsapiDao(GetObjectRsapiProvider(singleObjectLevel2ArtifactId, singleObjectLevel3ArtifactId), null);
109109
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FullyRecursive);
110110
Assert.AreEqual(singleObjectLevel2ArtifactId, dto.GravityLevel2Obj.ArtifactId);
111111
Assert.AreEqual(singleObjectLevel3ArtifactId, dto.GravityLevel2Obj.GravityLevel3SingleObj.ArtifactId);
@@ -116,7 +116,7 @@ public void Get_DownloadsFileContents()
116116
{
117117
var fileArray = new byte[] { 2 };
118118
var fileName = "filename.dat";
119-
var dao = new RsapiDao(GetFileRsapiProvider(fileName, fileArray));
119+
var dao = new RsapiDao(GetFileRsapiProvider(fileName, fileArray), null);
120120
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.OnlyParentObject);
121121
CollectionAssert.AreEqual(fileArray, ((ByteArrayFileDto)dto.FileField).ByteArray);
122122
Assert.AreEqual(fileName, ((ByteArrayFileDto)dto.FileField).FileName);
@@ -125,30 +125,30 @@ public void Get_DownloadsFileContents()
125125
[Test]
126126
public void Get_SkipsDownloadIfNoFile()
127127
{
128-
var dao = new RsapiDao(GetFileRsapiProvider(null, null));
128+
var dao = new RsapiDao(GetFileRsapiProvider(null, null), null);
129129
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.OnlyParentObject);
130130
Assert.Null(dto.FileField);
131131
}
132132

133133
[Test]
134134
public void Get_SingleChoice_InEnum()
135135
{
136-
var dao = new RsapiDao(GetChoiceRsapiProvider(2, null));
136+
var dao = new RsapiDao(GetChoiceRsapiProvider(2, null), null);
137137
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FirstLevelOnly);
138138
Assert.AreEqual(SingleChoiceFieldChoices.SingleChoice2, dto.SingleChoice);
139139
}
140140

141141
[Test]
142142
public void Get_SingleChoice_NotInEnum()
143143
{
144-
var dao = new RsapiDao(GetChoiceRsapiProvider(5, null));
144+
var dao = new RsapiDao(GetChoiceRsapiProvider(5, null), null);
145145
Assert.Throws<InvalidOperationException>(() => dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FirstLevelOnly));
146146
}
147147

148148
[Test]
149149
public void Get_MultipleChoice_AllInEnum()
150150
{
151-
var dao = new RsapiDao(GetChoiceRsapiProvider(null, new[] { 11, 13 }));
151+
var dao = new RsapiDao(GetChoiceRsapiProvider(null, new[] { 11, 13 }), null);
152152
var dto = dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FirstLevelOnly);
153153
CollectionAssert.AreEquivalent(
154154
new[] { MultipleChoiceFieldChoices.MultipleChoice1, MultipleChoiceFieldChoices.MultipleChoice3 },
@@ -160,7 +160,7 @@ public void Get_MultipleChoice_AllInEnum()
160160
public void Get_MultipleChoice_NotAllInEnum()
161161
{
162162
//first item is in an enum, but not in our enum
163-
var dao = new RsapiDao(GetChoiceRsapiProvider(null, new[] { 3, 13 }));
163+
var dao = new RsapiDao(GetChoiceRsapiProvider(null, new[] { 3, 13 }), null);
164164
Assert.Throws<InvalidOperationException>(() => dao.Get<GravityLevelOne>(RootArtifactID, Base.ObjectFieldsDepthLevel.FirstLevelOnly));
165165

166166
}

Gravity/Gravity.Test.Unit/RsapiDaoInsertTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ public void Insert_ChildObject_NonRecursive()
374374
void InsertObject(G1 objectToInsert, RdoCondition rootCondition, ObjectFieldsDepthLevel depthLevel)
375375
{
376376
SetupInsertManyCondition(x => x.Count == 1 && rootCondition(x.Single()), 10);
377-
var insertedId = new RsapiDao(mockProvider.Object).Insert(objectToInsert, depthLevel);
377+
var insertedId = new RsapiDao(mockProvider.Object, null).Insert(objectToInsert, depthLevel);
378378
Assert.AreEqual(10, insertedId);
379379
Assert.AreEqual(10, objectToInsert.ArtifactId);
380380
}

Gravity/Gravity.Test.Unit/RsapiDaoUpdateTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ void UpdateObject(G1 objectToUpdate, RdoBoolCond rootExpression, ObjectFieldsDep
498498
.Returns(new[] { new RDO(FileFieldId) }.ToSuccessResultSet<WriteResultSet<RDO>>());
499499
mockProvider.Setup(x => x.ClearFile(FileFieldId, G1ArtifactId));
500500

501-
new RsapiDao(mockProvider.Object).Update(objectToUpdate, depthLevel);
501+
new RsapiDao(mockProvider.Object, null).Update(objectToUpdate, depthLevel);
502502
}
503503

504504
private void SetupSingleObjectQuery(params int[] resultArtifactIds)

Gravity/Gravity/DAL/RSAPI/RsapiDao.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ public RsapiDao(IServicesMgr servicesManager, int workspaceId, ExecutionIdentity
2626
private RsapiDao(IServicesMgr servicesManager, int workspaceId, ExecutionIdentity executionIdentity,
2727
InvokeWithRetryService invokeWithRetryService,
2828
int batchSize = DefaultBatchSize)
29-
: this(new RsapiProvider(servicesManager, executionIdentity, invokeWithRetryService, workspaceId, batchSize))
29+
: this(new RsapiProvider(servicesManager, executionIdentity, invokeWithRetryService, workspaceId, batchSize), invokeWithRetryService)
3030
{
31-
this.invokeWithRetryService = invokeWithRetryService;
3231
}
3332

34-
public RsapiDao(IRsapiProvider rsapiProvider)
33+
public RsapiDao(IRsapiProvider rsapiProvider, InvokeWithRetryService invokeWithRetryService)
3534
{
35+
this.invokeWithRetryService = invokeWithRetryService;
36+
3637
this.rsapiProvider = rsapiProvider;
3738
this.choiceCache = new ChoiceCache(this.rsapiProvider);
3839
this.guidCache = new ArtifactGuidCache(this.rsapiProvider);

0 commit comments

Comments
 (0)