Repository navigation
Conversation
Signed-off-by: Shrish Kulkarni <shrish.kulkarni@ni.com>
Signed-off-by: Shrish Kulkarni <shrish.kulkarni@ni.com>
zhindes
left a comment
There was a problem hiding this comment.
Concern about the maintainability of the PR yml and how to break compat if we need to.
| # API Compatibility | ||
|
|
||
| Pull requests run Griffe to check the generated public API against the pull request's base commit. | ||
| The check covers the package and the modules in the API reference separately because package |
There was a problem hiding this comment.
Is this something we should fix instead of working around?
| nidaqmx.system.storage.persisted_task nidaqmx.system.system nidaqmx.system.watchdog \ | ||
| nidaqmx.task nidaqmx.task.channels nidaqmx.task.collections nidaqmx.task.triggering \ | ||
| nidaqmx.types nidaqmx.utils; do | ||
| if ! griffe check --search generated --against "$BASE_SHA" --format github "$module"; then |
There was a problem hiding this comment.
Good, --format github creates GitHub annotations. Can you please link to a workflow log that shows what these look like?
There was a problem hiding this comment.
Also please post a screenshot, since the workflow log will expire and no longer be accessible.
Signed-off-by: Shrish Kulkarni <shrish.kulkarni@ni.com>
…pi-compatibility-checks Signed-off-by: Shrish Kulkarni <shrish.kulkarni@ni.com>
|
Updated the PR with Poetry-managed tools, the shared Python default, and a reusable workflow called from CI. It defaults to the latest tag and supports explicit bases and manual previous-release comparisons. The manual package list is replaced by documentation-derived visibility, with regression tests. Approved breaking changes are documented; operational errors remain fatal. @bkeryan, regarding fixing the underlying exports: would you prefer that cleanup in this PR or a follow-up? Updating current exports would improve consistency, but historical release comparisons would still need additional visibility handling. Also, could you please approve the workflow run? Once an approved run demonstrates compatibility findings, I’ll post the log link and annotation screenshot. |
follow-up PR |
@bkeryan @zhindes I feel the rest of the changes are in. Once the workflow is approved, I’ll post the log link and annotation screenshot. |
You can test out workflow changes in your personal fork of this repo. |
There was a problem hiding this comment.
Why are you doing this? It seems like you ran into some sort of problem, but you haven't clearly communicated what that problem is. Instead, you went off and wrote an elaborate workaround.
You wrote this in the PR description:
The documentation-derived policy covers documented APIs in private implementation modules and public aliases. Each snapshot uses its own documentation, preventing removal of documentation from hiding a previously documented API break.
I have no idea what policy you are talking about. Is this something you made up? Is this something that griffe implements? Is this something that was output from an LLM?
griffe is a tool that I have used before. Please use it in a normal way. If there are problems with doing that, please communicate what those problems are so that we can discuss how to solve them.
The GitHub issue includes an example of how to use griffe. I tried it again, and it still works:
PS C:\dev\nidaqmx-python> griffe check --search generated nidaqmx -a 1.3.0 --verbose
generated\nidaqmx\stream_readers\_analog_multi_channel_reader.py:140: AnalogMultiChannelReader.read_waveforms(timeout):
Parameter default was changed:
Old: 10
New: 10.0
generated\nidaqmx\stream_readers\_analog_single_channel_reader.py:112: AnalogSingleChannelReader.read_waveform(timeout):
Parameter default was changed:
Old: 10
New: 10.0
generated\nidaqmx\stream_readers\_digital_multi_channel_reader.py:489: DigitalMultiChannelReader.read_waveforms(timeout):
Parameter default was changed:
Old: 10
New: 10.0
generated\nidaqmx\system\system.py:80: System.DriverVersion:
Attribute value was changed:
Old: collections.namedtuple('DriverVersion', ['major_version', 'minor_version', 'update_version'])
New: nidaqmx.types.DriverVersion
generated\nidaqmx\task\_task.py:364: Task.close:
Public object points to a different kind of object:
Old: function
New: attribute
These are all intentional changes to the API signature that are not expected to break compatibility for normal use cases.
There was a problem hiding this comment.
You're right that I should have explained the problem before adding the custom logic. I reproduced one case using Griffe 2.3.0: removing the documented DeviceCollection.device_names property produced no findings with stock Griffe, while my custom pass detected the removal. Do you think this edge case is important enough to justify the extra logic? If not, I'm happy to remove the custom script and use Griffe normally.
| permissions: | ||
| contents: read | ||
| with: | ||
| base: ${{ github.event_name == 'pull_request' && startsWith(github.base_ref, 'releases/') && github.event.pull_request.base.sha || '' }} |
There was a problem hiding this comment.
For CI runs triggered on push, I think the base branch is probably specified by github.ref_name. Please test this out in your personal fork of the repo and link to the resulting workflow log.
https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#github-context
| branches: | ||
| - master | ||
| - 'releases/**' | ||
| types: [opened, synchronize, reopened, edited, labeled, unlabeled] |
There was a problem hiding this comment.
I listed these so CI reruns when it matters: opened, synchronize, and reopened cover the usual PR lifecycle; edited catches a change to the target branch, which can change the comparison baseline (though title/body edits will rerun it too); and labeled/unlabeled recheck the result when the breaking-change label changes. If we decide the custom compatibility or label behavior isn’t needed, I’ll remove the extra triggers too.
I've updated CHANGELOG.md if applicable.No client-facing library behavior changes.What does this Pull Request accomplish?
Adds automated API compatibility checks using Griffe.
masterand release branches.compatibilitydependency group.Fixes #914.
Why should this Pull Request be merged?
Detects potential API-breaking changes before merging, rather than relying solely on internal tests after merge.
The documentation-derived policy covers documented APIs in private implementation modules and public aliases. Each snapshot uses its own documentation, preventing removal of documentation from hiding a previously documented API break.
Source exports and generated API files are unchanged. Export cleanup is a separate public API decision requiring maintainer agreement and would not retroactively repair historical release snapshots.
The
breaking-changelabel allows maintainer-approved compatibility findings without hiding annotations. Operational failures remain fatal.What testing has been done?
DeviceCollection.device_namesremoval.nidaqmx.Taskand gRPC session-option aliases while implementation classes remain.:members:selections and:undoc-members:behavior.1.6.0and the current upstream base passed.1.3.0completed with five expected compatibility findings.origin/masterwas merged without conflicts; all 35 tests and lockfile validation passed afterward.Hardware-dependent regression tests were not run because this change affects CI tooling, not library runtime behavior.