From ac74efb7f34e82202e60d365318735a1e2439c02 Mon Sep 17 00:00:00 2001 From: Jose Puebla Date: Tue, 15 Dec 2020 15:23:39 -0500 Subject: [PATCH 1/2] Revert "TT-69 fix: adding or editing an entry must not overlap the date of any other entry" This reverts commit 2520867e55596e1d42e6ddcacdabe8f7352682f7. --- commons/git_hooks/enforce_semantic_commit_msg.py | 2 +- .../time_entries/time_entries_model_test.py | 6 ------ time_tracker_api/time_entries/time_entries_repository.py | 4 +--- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/commons/git_hooks/enforce_semantic_commit_msg.py b/commons/git_hooks/enforce_semantic_commit_msg.py index 224f8f40..b446a074 100644 --- a/commons/git_hooks/enforce_semantic_commit_msg.py +++ b/commons/git_hooks/enforce_semantic_commit_msg.py @@ -13,7 +13,7 @@ SUCCESS_MSG = "Commit succeed!. Semantic commit message is correct." -COMMIT_MSG_REGEX = r'(TT-)[0-9].*(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?:\s.*' +COMMIT_MSG_REGEX = r'(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?:\s.*' # Get the commit message file commit_msg_file = open(sys.argv[1]) # The first argument is the file diff --git a/tests/time_tracker_api/time_entries/time_entries_model_test.py b/tests/time_tracker_api/time_entries/time_entries_model_test.py index dd58e0a9..3883113c 100644 --- a/tests/time_tracker_api/time_entries/time_entries_model_test.py +++ b/tests/time_tracker_api/time_entries/time_entries_model_test.py @@ -61,12 +61,6 @@ def create_time_entry( "2020-10-01T02:00:00.000Z", "2020-10-01T12:00:00.000Z", ), - ( - "2020-10-01T05:00:00.000Z", - "2020-10-01T10:00:00.000Z", - "2020-10-01T06:00:00.000Z", - "2020-10-01T07:00:00.000Z", - ), ], ) def test_find_interception_with_date_range_should_find( diff --git a/time_tracker_api/time_entries/time_entries_repository.py b/time_tracker_api/time_entries/time_entries_repository.py index 2a348964..b909b80d 100644 --- a/time_tracker_api/time_entries/time_entries_repository.py +++ b/time_tracker_api/time_entries/time_entries_repository.py @@ -207,10 +207,8 @@ def find_interception_with_date_range( result = self.container.query_items( query=""" SELECT * FROM c - WHERE (((c.start_date BETWEEN @start_date AND @end_date) + WHERE ((c.start_date BETWEEN @start_date AND @end_date) OR (c.end_date BETWEEN @start_date AND @end_date)) - OR ((@start_date BETWEEN c.start_date AND c.end_date) - OR (@end_date BETWEEN c.start_date AND c.end_date))) AND c.start_date!= @end_date AND c.end_date!= @start_date {conditions_clause} From 6f8f652bb89e133aa547f50d12fa06ae87aa46ba Mon Sep 17 00:00:00 2001 From: Jose Puebla Date: Tue, 15 Dec 2020 15:25:36 -0500 Subject: [PATCH 2/2] TT-00 fix: change commit message regex --- commons/git_hooks/enforce_semantic_commit_msg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/git_hooks/enforce_semantic_commit_msg.py b/commons/git_hooks/enforce_semantic_commit_msg.py index b446a074..224f8f40 100644 --- a/commons/git_hooks/enforce_semantic_commit_msg.py +++ b/commons/git_hooks/enforce_semantic_commit_msg.py @@ -13,7 +13,7 @@ SUCCESS_MSG = "Commit succeed!. Semantic commit message is correct." -COMMIT_MSG_REGEX = r'(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?:\s.*' +COMMIT_MSG_REGEX = r'(TT-)[0-9].*(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?:\s.*' # Get the commit message file commit_msg_file = open(sys.argv[1]) # The first argument is the file