Govstack API: filter work orders and runs via REST API by UUIDs or status#4553
Govstack API: filter work orders and runs via REST API by UUIDs or status#4553taylordowns2000 wants to merge 3 commits intomainfrom
Conversation
Code Review: Work Orders API — ID Filter & Show ActionOverviewThree files changed: added an 1. Status Codes: 401 vs 403Finding: 401 is consistent with the codebase, but technically wrong per HTTP spec. The chain works like this:
Every API controller ( Per RFC 7235, 401 means "not authenticated" and 403 means "authenticated but not authorized". The entire API layer has this backwards — but our test asserting 401 is consistent with the existing pattern. This is a pre-existing issue, not something introduced by this PR. If you want to fix it platform-wide, that's a separate effort. 2. Authorization PoliciesFinding: Authorization is correct. The
Role coverage: The One gap worth noting: There is no test for the 3. Regression Risk AnalysisRisk: Very Low
No impact on:
One minor code quality note: The Summary
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4553 +/- ##
==========================================
+ Coverage 89.49% 89.64% +0.15%
==========================================
Files 441 441
Lines 21249 21282 +33
==========================================
+ Hits 19017 19079 +62
+ Misses 2232 2203 -29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…rdcoding Expose Run.states/0 and WorkOrder.states/0 as public functions so consumers derive valid states from the schema rather than duplicating them. Update Invocation.Query to use these functions instead of hardcoded ~w() lists. Remove duplicate curl example comments from API controller test files (canonical versions remain in controller moduledocs).
stuartc
left a comment
There was a problem hiding this comment.
Please resolve the duplicate test files for the controller, LightningWeb.API.WorkflowsControllerTest.
And trim or remove the curl examples in the tests. My opinion is that they are noise, happy to keep them if you don't agree.
Description
This PR closes #4552 by adding tests for the
showcase on the work order REST API and adding the ability to pass a list of IDs into theindexcase on the work order REST API.Validation steps
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)