Skip to content

Removed unbufferedMsg references from motorq example#8

Merged
zakharenkodmytro merged 10 commits intomainfrom
cloud_event_no_subject_and_producer
Jun 12, 2025
Merged

Removed unbufferedMsg references from motorq example#8
zakharenkodmytro merged 10 commits intomainfrom
cloud_event_no_subject_and_producer

Conversation

@zakharenkodmytro
Copy link
Copy Markdown
Contributor

  • removed unbufferedMsg references from motorq example
  • removed ConvertToCloudEvent since we assume that all messages will come as CE

- removed ConvertToCloudEvent since we assume that all messages will come as CE

This comment was marked as outdated.

Comment thread internal/convert/convert.go Outdated
}

// mapDataToSignals maps the data from the message to the default DIS signals
func mapDataToSignals(data models.Data, ts time.Time) ([]*defaultmodule.Signal, error) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Im still leaving that function in case if we want to validate if vssNaming exists and correct from payload we received from kafka

zakharenkodmytro and others added 2 commits June 11, 2025 17:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zakharenkodmytro zakharenkodmytro requested a review from Copilot June 11, 2025 21:42

This comment was marked as outdated.

@zakharenkodmytro zakharenkodmytro requested a review from Copilot June 12, 2025 12:32

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zakharenkodmytro zakharenkodmytro requested a review from Copilot June 12, 2025 12:42

This comment was marked as outdated.

@zakharenkodmytro zakharenkodmytro requested a review from Copilot June 12, 2025 12:45

This comment was marked as outdated.

Comment thread internal/config/settings.go
Copy link
Copy Markdown
Member

@JamesReate JamesReate left a comment

Choose a reason for hiding this comment

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

Discussed that this still needs code to set the source, produce and subject based on settings and information from db.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes all references to unbuffered messages and the ConvertToCloudEvent flag from the motorq example, updating tests and service logic to assume incoming messages are already in CloudEvent format. Key changes include replacing unbufferedMsg variables with a valid CloudEvent message in tests, removing the ConvertToCloudEvent conditional logic in the service, and cleaning up unused types and tests.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/service/oracle_test.go Updated test data to use valid CloudEvent messages and removed ConvertToCloudEvent usage.
internal/service/oracle.go Simplified event handling logic by eliminating deprecated conversion paths.
internal/models/models.go Removed the UnbufferedMessageValue type no longer needed.
internal/convert/convert_test.go Deleted obsolete tests related to unbuffered message conversion.
internal/convert/convert.go Refactored conversion functions to only set CloudEvent fields and validate signals.
internal/config/settings.go Removed the ConvertToCloudEvent setting to reflect the new assumptions.
go.mod Removed the unused dependency.
Comments suppressed due to low confidence (2)

internal/service/oracle_test.go:27

  • Verify that the updated VIN value is intentional and that it aligns with expectations for test data consistency.
const vin = "1GGCM82633A123456"

internal/convert/convert.go:16

  • Consider updating the function comment to clarify that SetProducerAndSubject only sets CloudEvent fields and always returns nil, to better inform readers of its intended usage.
func SetProducerAndSubject(veh dbmodels.Vin, ce *cloudevent.CloudEvent[json.RawMessage], settings config.Settings) error {

Comment thread internal/convert/convert.go Outdated
zakharenkodmytro and others added 2 commits June 12, 2025 10:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@JamesReate JamesReate left a comment

Choose a reason for hiding this comment

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

let's get the linter to pass and then good to merge

@zakharenkodmytro zakharenkodmytro merged commit 64ec713 into main Jun 12, 2025
3 checks passed
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.

3 participants