Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Simplify command state update methods #3309

Conversation

didier-wenzek
Copy link
Contributor

Proposed changes

Address comments raised on #3307

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

#3307

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

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 54.71698% with 24 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/core/tedge_api/src/workflow/supervisor.rs 28.57% 9 Missing and 1 partial ⚠️
crates/core/tedge_api/src/workflow/state.rs 66.66% 5 Missing and 3 partials ⚠️
...ore/tedge_agent/src/operation_workflows/persist.rs 44.44% 5 Missing ⚠️
crates/core/tedge_api/src/workflow/mod.rs 50.00% 1 Missing ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
551 0 2 551 100 1h31m8.521846s

crates/core/tedge_agent/src/operation_workflows/persist.rs Outdated Show resolved Hide resolved
crates/core/tedge_api/src/workflow/supervisor.rs Outdated Show resolved Hide resolved
@@ -410,14 +402,14 @@ impl WorkflowRepository {
operation: &OperationType,
command_state: GenericCommandState,
) -> Result<Option<GenericCommandState>, WorkflowExecutionError> {
let operation_name = operation.to_string();
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: I think to_owned better signifies the intent here

Suggested change
let operation_name = operation.to_string();
let operation_name = operation.to_owned();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to_owned() is not appropriate here.

To convey the intent, I replaced to_string() by name(): 33268b9

crates/core/tedge_api/src/workflow/state.rs Outdated Show resolved Hide resolved
crates/core/tedge_api/src/workflow/state.rs Outdated Show resolved Hide resolved
@didier-wenzek didier-wenzek force-pushed the refactor/simplify_command_state_updates branch from 33268b9 to b9fea1b Compare December 19, 2024 17:03
@didier-wenzek didier-wenzek added this pull request to the merge queue Dec 19, 2024
Merged via the queue into thin-edge:main with commit b843d72 Dec 19, 2024
33 checks passed
@didier-wenzek didier-wenzek deleted the refactor/simplify_command_state_updates branch December 19, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants