Skip to content

Commit

Permalink
Merge pull request #592 from oda-hub/matrix-message-notification
Browse files Browse the repository at this point in the history
Sending notifications via Matrix
  • Loading branch information
burnout87 authored Oct 12, 2023
2 parents 4f1868b + 41e9b40 commit 9879773
Show file tree
Hide file tree
Showing 22 changed files with 2,616 additions and 252 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ jobs:
- name: Test fast subset with pytest
run: |
python -m pytest tests --cov=cdci_data_analysis -sv --full-trace --log-cli-level=DEBUG -m "not test_drupal and fast and not test_renku" --durations=0
python -m pytest tests --cov=cdci_data_analysis -sv --full-trace --log-cli-level=DEBUG -m "not test_drupal and fast and not test_renku and not test_matrix" --durations=0
- name: Test everything with pytest
if: ${{ env.TEST_ONLY_FAST != 'true' }}
run: |
python -m pytest tests --cov=cdci_data_analysis -sv --full-trace --log-cli-level=DEBUG -m "not test_drupal and not test_renku" --durations=0
python -m pytest tests --cov=cdci_data_analysis -sv --full-trace --log-cli-level=DEBUG -m "not test_drupal and not test_renku and not test_matrix" --durations=0
# I wonder how this interacts with the Github App. But this is not only for PR. Also this does not always work
Expand Down
3 changes: 2 additions & 1 deletion cdci_data_analysis/analysis/email_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ def send_job_email(
'product_type': product_type,
'time_request': time_request,
'request_url': possibly_compressed_request_url,
# TODO to be removed ?
'api_code_no_token': api_code_no_token,
'api_code': api_code,
'api_code_too_long': api_code_too_long,
Expand Down Expand Up @@ -645,7 +646,7 @@ def is_email_to_send_run_query(logger, status, time_original_request, scratch_di
'email_submitted_*.email'
)
submitted_email_files = glob.glob(submitted_email_pattern)
logger.info("submitted_email_files: %s as %s", len(submitted_email_files), submitted_email_pattern)
logger.info("submitted_email_files: %s as %s", len(submitted_email_files), submitted_email_files)
log_additional_info_obj['submitted_email_files'] = submitted_email_files

if len(submitted_email_files) >= 1:
Expand Down
8 changes: 8 additions & 0 deletions cdci_data_analysis/analysis/job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def write_dataserver_status(self, status_dictionary_value=None,
full_dict=None,
email_status=None,
email_status_details=None,
matrix_message_status=None,
matrix_message_status_details=None,
call_back_status=None):
# TODO: write to specific name coming for call_back

Expand All @@ -202,6 +204,12 @@ def write_dataserver_status(self, status_dictionary_value=None,
if email_status_details is not None:
self.monitor['email_status_details'] = email_status_details

if matrix_message_status is not None:
self.monitor['matrix_message_status'] = matrix_message_status

if matrix_message_status_details is not None:
self.monitor['matrix_message_status_details'] = matrix_message_status_details

if call_back_status is not None:
self.monitor['call_back_status'] = call_back_status

Expand Down
Loading

0 comments on commit 9879773

Please sign in to comment.