Skip to content

refactor: remove hardcoded temporary directory handling in LoggedCommand#3630

Merged
rina23q merged 1 commit intothin-edge:mainfrom
rina23q:refactor/logged-command-should-refer-tmp-dir-path-from-config
May 16, 2025
Merged

refactor: remove hardcoded temporary directory handling in LoggedCommand#3630
rina23q merged 1 commit intothin-edge:mainfrom
rina23q:refactor/logged-command-should-refer-tmp-dir-path-from-config

Conversation

@rina23q
Copy link
Copy Markdown
Member

@rina23q rina23q commented May 16, 2025

Proposed changes

Standardize the use of configurable temporary directories across LoggedCommand and related areas. This removes hardcoded /tmp paths and enables consistent directory management by using tmp.path from tedge config.

This PR removes 3 todos related to the hardcoded /tmp directory path.

        command
            // TODO: should use tmp from config
            .current_dir("/tmp")
            .stdin(Stdio::piped())
            .stdout(Stdio::piped())
            .stderr(Stdio::piped());

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. You can activate automatic signing by running just prepare-dev once)
  • I ran just format as mentioned in CODING_GUIDELINES
  • I used just check 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

@codecov
Copy link
Copy Markdown

codecov bot commented May 16, 2025

Codecov Report

Attention: Patch coverage is 65.21739% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/extensions/c8y_mapper_ext/src/converter.rs 0.00% 3 Missing and 2 partials ⚠️
crates/core/plugin_sm/src/plugin.rs 33.33% 2 Missing ⚠️
.../core/tedge_api/src/workflow/log/logged_command.rs 91.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 16, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
633 0 3 633 100 1h50m27.795213s

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 the refactoring Developer value label May 16, 2025
Standardize the use of configurable temporary directories across
`LoggedCommand` and related areas. This removes hardcoded `/tmp` paths
and enables consistent directory management by using tmp.path from
tedge config.

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
@rina23q rina23q force-pushed the refactor/logged-command-should-refer-tmp-dir-path-from-config branch from 10235e8 to ac68fdb Compare May 16, 2025 14:57
@rina23q rina23q temporarily deployed to Test Pull Request May 16, 2025 14:57 — with GitHub Actions Inactive
@rina23q rina23q added this pull request to the merge queue May 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 16, 2025
@rina23q rina23q added this pull request to the merge queue May 16, 2025
Merged via the queue into thin-edge:main with commit 06d2f22 May 16, 2025
34 checks passed
@rina23q rina23q deleted the refactor/logged-command-should-refer-tmp-dir-path-from-config branch May 16, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Developer value

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants