-
Notifications
You must be signed in to change notification settings - Fork 54
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
tedge-mapper-c8y service restart is required after a change of supported operation file contents #1970
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Pradeep Kumar K J <pradeepkumar.kj@softwareag.com>
PradeepKiruvale
temporarily deployed
to
Test Pull Request
May 15, 2023 13:48
— with
GitHub Actions
Inactive
Robot Results
Passed Tests
|
Comment on lines
72
to
77
if let Some(detail) = operation.exec() { | ||
if let Some(on_message) = &detail.on_message { | ||
self.operations_by_trigger.insert(on_message.clone(), index); | ||
} | ||
} | ||
self.operations[index] = operation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this key piece of code is duplicated, it's better to introduce a private method to update the triggers.
Suggested change
if let Some(detail) = operation.exec() { | |
if let Some(on_message) = &detail.on_message { | |
self.operations_by_trigger.insert(on_message.clone(), index); | |
} | |
} | |
self.operations[index] = operation; | |
self.operations[index] = operation; | |
self.update_triggers(index, operation); |
Signed-off-by: Pradeep Kumar K J <pradeepkumar.kj@softwareag.com>
PradeepKiruvale
temporarily deployed
to
Test Pull Request
May 15, 2023 14:21
— with
GitHub Actions
Inactive
didier-wenzek
approved these changes
May 15, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
The issue is the custom operation was not updating the
operations_by_trigger
map when a custom operation is added.operations
vector.operations_by_trigger
map was not updated because there is no content in the operation file.map
was updated only when the operation is added at the first time but not when the operation is updated.The proposed solution is:
When the operation content is updated/modify event is triggered, the
operations_by_trigger
map has to be updated withtemplate number
as the key and thecustom operation
position index in theoperation vector
as data, as belowTypes of changes
Paste Link to the issue
#1705
Checklist
cargo fmt
as mentioned in CODING_GUIDELINEScargo clippy
as mentioned in CODING_GUIDELINESFurther comments