Move the OpenAPI schema check from pre-commit to CI #11792

Closed
opened 2025-12-29 21:49:56 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Oct 29, 2025).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

  • Remove the pre-commit rule which calls the verify-openapi.sh script if any API files have been modified.
  • Add a step in ci.yml to run the script

Justification

Generating the OpenAPI schema takes a considerable amount of time, which would be disruptive if we had to do it for every commit. We applied the file path check to the pre-commit rule in an effort to mitigate this, however we've found that changes not captured by this qualifier can still result in changes to the spec.

Moving this check to CI will be less disruptive for individual developers while also ensuring consistent coverage, without significantly impacting the duration of a CI job.

Originally created by @jeremystretch on GitHub (Oct 29, 2025). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes - Remove the pre-commit rule which calls the `verify-openapi.sh` script if any API files have been modified. - Add a step in `ci.yml` to run the script ### Justification Generating the OpenAPI schema takes a considerable amount of time, which would be disruptive if we had to do it for _every_ commit. We applied the file path check to the pre-commit rule in an effort to mitigate this, however we've found that changes not captured by this qualifier can still result in changes to the spec. Moving this check to CI will be less disruptive for individual developers while also ensuring consistent coverage, without significantly impacting the duration of a CI job.
adam added the status: acceptedtype: housekeepingnetbox labels 2025-12-29 21:49:56 +01:00
adam closed this issue 2025-12-29 21:49:56 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 31, 2025):

Ran into some issues running manage.py spectacular in CI (it appears to need a database in place?) so I'll likely just remove it from the workflow as it's become more trouble than it's worth. Will keep the script itself in place though.

@jeremystretch commented on GitHub (Oct 31, 2025): Ran into some issues running `manage.py spectacular` in CI (it appears to need a database in place?) so I'll likely just remove it from the workflow as it's become more trouble than it's worth. Will keep the script itself in place though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11792