Skip to content

Remove duplicate session_pb2 codegen, add ni-apis submodule and dependency on ni.grpcdevice.v1.proto#2176

Open
rahur-NI wants to merge 6 commits intoni:masterfrom
rahur-NI:sessionProtoFileFromNiApisRepo
Open

Remove duplicate session_pb2 codegen, add ni-apis submodule and dependency on ni.grpcdevice.v1.proto#2176
rahur-NI wants to merge 6 commits intoni:masterfrom
rahur-NI:sessionProtoFileFromNiApisRepo

Conversation

@rahur-NI
Copy link
Copy Markdown
Contributor

@rahur-NI rahur-NI commented Apr 13, 2026

  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

Replaces the duplicate session_pb2 protobuf codegen in each nimi-python driver modules with a dependency on ni.grpcdevice.v1.proto (similar to [ni/nidaqmx-python#859].

  • Replaced relative import from . import session_pb2 with absolute import session_pb2 in _grpc_stub_interpreter.py.mako
  • Install ni.grpcdevice.v1.proto>=1.0.0 as part of installers for modules that support grpc.
  • Updated mak files to remeve generation of session_pb2.py and session_pb2_grpc.py
  • Added third_party/ni-apis as a git submodule pointing to [https://github.com/ni/ni-apis]
  • Deleted session.proto file

List issues fixed by this Pull Request below, if any.

What testing has been done?

  • A successful tox.
  • Codegen files have no changes other than importing from installed ni.grpcdevice.v1.proto package than importing from locally generated session_pb2 file as before.

@rahur-NI rahur-NI marked this pull request as ready for review April 13, 2026 19:18
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.73%. Comparing base (304563a) to head (2f8c08f).

Files with missing lines Patch % Lines
generated/nirfsg/nirfsg/_grpc_stub_interpreter.py 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2176      +/-   ##
==========================================
- Coverage   89.85%   88.73%   -1.12%     
==========================================
  Files          73       73              
  Lines       19006    19006              
==========================================
- Hits        17077    16865     -212     
- Misses       1929     2141     +212     
Flag Coverage Δ
codegenunittests 84.90% <ø> (ø)
nidcpowersystemtests 94.61% <100.00%> (ø)
nidcpowerunittests 89.53% <ø> (ø)
nidigitalsystemtests 92.26% <100.00%> (ø)
nidigitalunittests 68.44% <ø> (ø)
nidmmsystemtests 92.72% <100.00%> (ø)
nifakeunittests 86.01% <100.00%> (ø)
nifgensystemtests 94.61% <100.00%> (ø)
nimodinstsystemtests 73.85% <ø> (ø)
nimodinstunittests 94.20% <ø> (ø)
nirfsgsystemtests 72.70% <0.00%> (-8.43%) ⬇️
niscopesystemtests 92.94% <100.00%> (ø)
niscopeunittests 43.20% <ø> (ø)
nisesystemtests 91.50% <ø> (ø)
niswitchsystemtests 82.03% <100.00%> (ø)
nitclksystemtests 94.87% <ø> (ø)
nitclkunittests 98.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ated/nidcpower/nidcpower/_grpc_stub_interpreter.py 89.40% <100.00%> (ø)
...ated/nidigital/nidigital/_grpc_stub_interpreter.py 89.60% <100.00%> (ø)
generated/nidmm/nidmm/_grpc_stub_interpreter.py 87.91% <100.00%> (ø)
generated/nifake/nifake/_grpc_stub_interpreter.py 85.11% <100.00%> (ø)
generated/nifgen/nifgen/_grpc_stub_interpreter.py 88.03% <100.00%> (ø)
...enerated/niscope/niscope/_grpc_stub_interpreter.py 85.57% <100.00%> (ø)
...erated/niswitch/niswitch/_grpc_stub_interpreter.py 81.45% <100.00%> (ø)
generated/nirfsg/nirfsg/_grpc_stub_interpreter.py 0.00% <0.00%> (-78.33%) ⬇️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 304563a...2f8c08f. Read the comment docs.

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

Comment thread tox.ini Outdated
Comment thread tools/install_local_wheel.py Outdated
Comment thread src/shared_protos/session.proto Outdated
@rahur-NI rahur-NI changed the title Remove duplicate session_pb2 codegen and add dependency on ni.grpcdevice.v1.proto Remove duplicate session_pb2 codegen, add ni-apis submodule and dependency on ni.grpcdevice.v1.proto Apr 14, 2026
@ni-jfitzger
Copy link
Copy Markdown
Collaborator

ni-jfitzger commented Apr 15, 2026

Please revert these ni-api changes until there's actually something to pull in.

I've been told we actually do need these, so disregard this comment.

@bkeryan
Copy link
Copy Markdown
Contributor

bkeryan commented Apr 15, 2026

Please revert these ni-api changes until there's actually something to pull in.

protoc needs a copy of session.proto in order to handle import "session.proto";

@ni-jfitzger
Copy link
Copy Markdown
Collaborator

Please revert these ni-api changes until there's actually something to pull in.

protoc needs a copy of session.proto in order to handle import "session.proto";

@bkeryan I don't understand. Doesn't ni.grpcdevice.v1.proto have the results of compiling the session.proto?

@ni-jfitzger
Copy link
Copy Markdown
Collaborator

Please revert these ni-api changes until there's actually something to pull in.

protoc needs a copy of session.proto in order to handle import "session.proto";

@bkeryan I don't understand. Doesn't ni.grpcdevice.v1.proto have the results of compiling the session.proto?

Oh, dang. We need it in order to compile our api-specific .proto files? That's annoying.

Comment on lines +62 to +63
with:
submodules: true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we need this.
This action is for running system tests. System tests do not involve tox -e codegen.

Comment on lines +31 to +32
with:
submodules: true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Like the other workflows in this folder, this is just runs system tests and examples.
I don't think we'll need submodules for that because it shouldn't involve codegen.

Comment thread build/defines.mak
METADATA_FILES := $(wildcard $(METADATA_DIR)/*.py)
SHARED_PROTOS_DIR := $(ROOT_DIR)/src/shared_protos
PROTO_DIRS := $(METADATA_DIR) $(SHARED_PROTOS_DIR)
NI_APIS_PROTOS_DIR := $(ROOT_DIR)/third_party/ni-apis/ni/grpcdevice/v1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this the right place to get session.proto from or should it be this one?
https://github.com/ni/ni-apis-python/blob/main/proto/session.proto

The one in ni-apis is pretty bare.

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.

session.proto should be replaced with a dependency on ni.grpcdevice.v1.proto

4 participants