Skip to content

Commit 99eda93

Browse files
authored
merge: Merge pull request #85 from ArunaStorage/dev
[fixes] Fixes from dev
2 parents 811886b + 684edbd commit 99eda93

6 files changed

Lines changed: 26 additions & 4 deletions

File tree

.codecov.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
codecov:
2+
require_ci_to_pass: no
13
coverage:
2-
range: 60..100 # set a high standard for ourselves
4+
range: 50..90 # coverage lower than 50 is red, higher than 90 green, between color code
5+
status:
6+
project: # settings affecting project coverage
7+
enabled: yes
8+
target: auto # auto % coverage target
9+
threshold: 5% # allow for 5% reduction of coverage without failing
10+
# do not run coverage on patch nor changes
11+
patch: no
12+
changes: no
313
ignore:
414
- "src/bin" # don't consider binaries in coverage report
515
- "src/api" # Ignore autogenerated api

migrations/2023-05-15-081831_indices/up.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ CREATE INDEX objects_shared_single_idx ON objects (shared_revision_id);
66
CREATE INDEX hashes_objects_idx ON hashes (object_id);
77
CREATE INDEX object_key_value_objects_idx ON object_key_value (object_id);
88
CREATE INDEX collection_objects_collection_idx ON collection_objects (collection_id);
9-
CREATE INDEX collection_objects_objects_idx ON collection_objects (object_id);
9+
CREATE INDEX collection_objects_objects_idx ON collection_objects (object_id);
10+
11+
12+
ALTER TABLE collections ADD CONSTRAINT uniqe_collection_name_project_id UNIQUE (project_id, name, version_id);
13+
ALTER TABLE collections ADD CONSTRAINT uniqe_collection_name_project_id_without_version UNIQUE (project_id, name) WHERE (version_id is NULL);

src/server/grpc_server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ impl ServiceServer {
162162
log::info!("ArunaServer (internal) listening on {}", other_addr);
163163
let internal_server = tokio::spawn(async move {
164164
Server::builder()
165+
.http2_keepalive_interval(Some(std::time::Duration::from_secs(15)))
165166
.add_service(InternalProxyNotifierServiceServer::new(
166167
internal_proxy_notifier_service,
167168
))

tests/d1_collection_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ fn delete_collection_test() {
741741
let result = db.create_new_collection(request, creator).unwrap();
742742

743743
let ref_col_request = CreateNewCollectionRequest {
744-
name: "new-collection-update-delete".to_owned(),
744+
name: "new-collection-update-delete-2".to_owned(),
745745
description: "this_is_a_demo_collection_delete".to_owned(),
746746
project_id: regular_project_ulid.to_string(),
747747
label_ontology: None,

tests/d2_collection_grpc_tests.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ async fn create_collection_grpc_test() {
9393
};
9494

9595
// Loop all permissions and validate error/success
96-
for permission in vec![
96+
for (i, permission) in vec![
9797
Permission::None,
9898
Permission::Read,
9999
Permission::Append,
100100
Permission::Modify,
101101
Permission::Admin,
102102
]
103103
.iter()
104+
.enumerate()
104105
{
105106
// Update collection description
106107
create_collection_request.description = format!(
@@ -109,6 +110,8 @@ async fn create_collection_grpc_test() {
109110
)
110111
.to_string();
111112

113+
create_collection_request.name = format!("col-{}", i).to_string();
114+
112115
// Fast track permission edit
113116
assert!(common::functions::update_project_permission(
114117
random_project.id.as_str(),
@@ -134,6 +137,7 @@ async fn create_collection_grpc_test() {
134137
}
135138
Permission::Modify | Permission::Admin => {
136139
// Validate correct collection creation
140+
dbg!(&create_collection_response);
137141
assert!(create_collection_response.is_ok());
138142
let collection_id = create_collection_response
139143
.unwrap()

tests/sources/up.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ CREATE TABLE encryption_keys (
330330
FOREIGN KEY (object_id) REFERENCES objects(id),
331331
FOREIGN KEY (endpoint_id) REFERENCES endpoints(id)
332332
);
333+
334+
ALTER TABLE collections ADD CONSTRAINT uniqe_collection_name_project_id UNIQUE (project_id, name, version_id);
335+
ALTER TABLE collections ADD CONSTRAINT uniqe_collection_name_project_id_without_version UNIQUE (project_id, name) WHERE (version_id is NULL);
333336
/* ----- Materialized Views --------------------------------------- */
334337
-- Materialized view for the collections table
335338
CREATE MATERIALIZED VIEW collection_stats AS

0 commit comments

Comments
 (0)