Skip to content

fix: check if log exists before trying to upload it#3150

Merged
reubenmiller merged 1 commit intothin-edge:mainfrom
reubenmiller:fix-upload-log-if-exists
Oct 3, 2024
Merged

fix: check if log exists before trying to upload it#3150
reubenmiller merged 1 commit intothin-edge:mainfrom
reubenmiller:fix-upload-log-if-exists

Conversation

@reubenmiller
Copy link
Copy Markdown
Contributor

Proposed changes

The tedge-mapper-c8y feature controlled by c8y.operations.auto_log_upload=on-failure, uploads an operation log based on the given condition. This PR just adds an additional check to only do the upload if the log file exists to avoid scenarios where an event is created with no attachment...this typically occurs when running the tedge-agent on a child device, and the mapper does not yet have access to the related operation log.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@reubenmiller reubenmiller added theme:troubleshooting Theme: Troubleshooting and remote control theme:c8y Theme: Cumulocity related topics labels Oct 3, 2024
@reubenmiller reubenmiller force-pushed the fix-upload-log-if-exists branch from 3ab4869 to 1341285 Compare October 3, 2024 07:56
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files

📢 Thoughts on this report? Let us know!

Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
@reubenmiller reubenmiller force-pushed the fix-upload-log-if-exists branch from 1341285 to 17a0ecc Compare October 3, 2024 08:12
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 3, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
506 0 2 506 100 1h27m16.270048999s

Copy link
Copy Markdown
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

Approved

@reubenmiller reubenmiller added this pull request to the merge queue Oct 3, 2024
Merged via the queue into thin-edge:main with commit 5903481 Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme:c8y Theme: Cumulocity related topics theme:troubleshooting Theme: Troubleshooting and remote control

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants