Skip to content

opcua module #310

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

Merged
merged 4 commits into from
Apr 18, 2025
Merged

opcua module #310

merged 4 commits into from
Apr 18, 2025

Conversation

OutOfBedlam
Copy link
Contributor

This pull request introduces significant updates to the tql module, focusing on integrating OPC UA (Open Platform Communications Unified Architecture) support, improving JavaScript context handling, and fixing minor issues in the codebase. The changes include adding a new OPC UA module, enhancing the JavaScript runtime context, and updating tests to validate the new functionality.

OPC UA Integration:

  • Added a new opcua module to the JavaScript runtime, enabling OPC UA client creation and interactions, such as reading node values. This includes support for MessageSecurityModes and TimestampsToReturn. (mods/tql/fm_script_modules.go, mods/tql/fm_script.go, [1] [2]
  • Introduced tests for the OPC UA module, including scenarios for reading nodes and handling permissions. A mock OPC UA server is also implemented for testing purposes. (mods/tql/fm_script_test.go, mods/tql/fm_script_test.goR1036-R1225)

JavaScript Context Enhancements:

  • Extended the JSContext struct to include context.Context, allowing better control and cancellation of operations within the JavaScript runtime. (mods/tql/fm_script.go, [1] [2]

Dependency Updates:

  • Added github.com/gopcua/opcua and related dependencies to go.mod for OPC UA support. Updated several indirect dependencies to their latest versions. (go.mod, [1] [2]

Minor Fixes and Improvements:

  • Fixed typos in function and variable names, such as saptial_haversine to spatial_haversine and logx to log_x. (mods/tql/fm_script_modules.go, [1] mods/tql/fm_script_test.go, [2]
  • Updated the cspell.json file to include new terms related to the changes, such as opcua, deinit, and EPSG. (cspell.json, [1] [2] [3]

These changes enhance the functionality and maintainability of the tql module, particularly by introducing robust support for OPC UA interactions.

Copy link

codecov bot commented Apr 18, 2025

Codecov Report

Attention: Patch coverage is 65.51724% with 40 lines in your changes missing coverage. Please review.

Project coverage is 41.60%. Comparing base (268ca29) to head (4d8f629).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
mods/tql/fm_script_modules.go 64.60% 33 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
+ Coverage   41.49%   41.60%   +0.11%     
==========================================
  Files         260      261       +1     
  Lines       56791    57354     +563     
==========================================
+ Hits        23564    23861     +297     
- Misses      30911    31130     +219     
- Partials     2316     2363      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@OutOfBedlam OutOfBedlam requested a review from Copilot April 18, 2025 23:48
Copy link

@Copilot 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 pull request adds OPC UA integration into the tql module while enhancing JavaScript context management and updating tests and dependencies.

  • Adds an OPC UA module with functions for client creation and node reading.
  • Enhances JSContext by embedding context.Context to support cancellation.
  • Updates tests and CI workflows, and fixes minor naming typos.

Reviewed Changes

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

File Description
mods/tql/fm_script_test.go Adds tests for OPC UA functionality and updates variable names in the test suite.
mods/tql/fm_script_modules.go Introduces the opcua module, fixes typos in spatial function names, and implements retry logic.
mods/tql/fm_script.go Extends JSContext to support cancellation by embedding context.Context.
.github/workflows/ci-main.yml Updates CI matrix to include Ubuntu 22.04 and ARM architecture configurations.
Files not reviewed (2)
  • cspell.json: Language not supported
  • go.mod: Language not supported

@OutOfBedlam OutOfBedlam merged commit 70f70a3 into main Apr 18, 2025
10 checks passed
@OutOfBedlam OutOfBedlam deleted the module-opcua branch April 18, 2025 23:49
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.

1 participant