Skip to content

Commit

Permalink
Hammer/generic alerts (#948)
Browse files Browse the repository at this point in the history
* First iteration of generic alerts

Signed-off-by: Aaron Chong <[email protected]>

* Route for unresponded alerts

Signed-off-by: Aaron Chong <[email protected]>

* Basic location complete post route for task

Signed-off-by: Aaron Chong <[email protected]>

* Tests for alert routes

Signed-off-by: Aaron Chong <[email protected]>

* Test for location complete route

Signed-off-by: Aaron Chong <[email protected]>

* Lint and tests

Signed-off-by: Aaron Chong <[email protected]>

* Basic implementation

Signed-off-by: Aaron Chong <[email protected]>

* Basic task based alerts working as expected

Signed-off-by: Aaron Chong <[email protected]>

* Only display and list alerts that have display true

Signed-off-by: Aaron Chong <[email protected]>

* Add doc to location_complete route about instability

Signed-off-by: Aaron Chong <[email protected]>

* Refactored alert db interactions to repository, with lru cache for location alerts checking

Signed-off-by: Aaron Chong <[email protected]>

* Regenerated docs and return early on gateway last location checking

Signed-off-by: Aaron Chong <[email protected]>

* Lint and better typing with static methods

Signed-off-by: Aaron Chong <[email protected]>

* Hammer/generic alerts without location (#951)

* First round of cleanup

Signed-off-by: Aaron Chong <[email protected]>

* Regenerate API

Signed-off-by: Aaron Chong <[email protected]>

---------

Signed-off-by: Aaron Chong <[email protected]>

* Hammer/demo tasks (#925)

* Moved custom deliveries to separate file naively and import naively

Signed-off-by: Aaron Chong <[email protected]>

* Moved patrol

Signed-off-by: Aaron Chong <[email protected]>

* Moved custom-compose

Signed-off-by: Aaron Chong <[email protected]>

* Added clean and delivery

Signed-off-by: Aaron Chong <[email protected]>

* Added delivery, renamed to SimpleDelivery

Signed-off-by: Aaron Chong <[email protected]>

* Clean task added

Signed-off-by: Aaron Chong <[email protected]>

* Moved delivery-custom tests, added return type for forms

Signed-off-by: Aaron Chong <[email protected]>

* Configurable supported tasks and name remapping

Signed-off-by: Aaron Chong <[email protected]>

* Changed directory to types, since it doesn't just handle descriptions

Signed-off-by: Aaron Chong <[email protected]>

* Fix test imports

Signed-off-by: Aaron Chong <[email protected]>

* Using temporary task definition

Signed-off-by: Aaron Chong <[email protected]>

* Refactoring new rename changes

Signed-off-by: Aaron Chong <[email protected]>

* Clean up

Signed-off-by: Aaron Chong <[email protected]>

* Removed problematic and unsused component and test

Signed-off-by: Aaron Chong <[email protected]>

* Lint

Signed-off-by: Aaron Chong <[email protected]>

* Updating pnpm version in github workflow

Signed-off-by: Aaron Chong <[email protected]>

* Reverting update to pnpm version

Signed-off-by: Aaron Chong <[email protected]>

* Fix build now that we use key value strings for labels

Signed-off-by: Aaron Chong <[email protected]>

* Refactored last parts of hard coding categories and rendering forms

Signed-off-by: Aaron Chong <[email protected]>

* Refactor callback names and error handling for misconfigs

Signed-off-by: Aaron Chong <[email protected]>

* Display error as well

Signed-off-by: Aaron Chong <[email protected]>

* Fixed more checks and failures

Signed-off-by: Aaron Chong <[email protected]>

* Split configuration and definition, only handle configurations in resource manager level

Signed-off-by: Aaron Chong <[email protected]>

* Lint

Signed-off-by: Aaron Chong <[email protected]>

* Not using object as a type

Signed-off-by: Aaron Chong <[email protected]>

* Address feedback

Signed-off-by: Aaron Chong <[email protected]>

* Render using validTasks instead

Signed-off-by: Aaron Chong <[email protected]>

* Use useMemo

Signed-off-by: Aaron Chong <[email protected]>

---------

Signed-off-by: Aaron Chong <[email protected]>

* Update ros2 pydantic messages, fix tests

Signed-off-by: Aaron Chong <[email protected]>

* Revert update of pnpm lock file

Signed-off-by: Aaron Chong <[email protected]>

* Lint

Signed-off-by: Aaron Chong <[email protected]>

* Use specific exceptions and more clean up

Signed-off-by: Aaron Chong <[email protected]>

* Port CI fixes from #955 but targeting ubuntu 22 and ROS 2 Humble

Signed-off-by: Aaron Chong <[email protected]>

* Revert "Port CI fixes from #955 but targeting ubuntu 22 and ROS 2 Humble"

This reverts commit 1fd22ee.

Signed-off-by: Aaron Chong <[email protected]>

* Update pnpm version

Signed-off-by: Aaron Chong <[email protected]>

* Setup pnpm and node manually

Signed-off-by: Aaron Chong <[email protected]>

* Using HOME env var of runner

Signed-off-by: Aaron Chong <[email protected]>

* workflow

Signed-off-by: Aaron Chong <[email protected]>

* workflow

Signed-off-by: Aaron Chong <[email protected]>

* Workflow

Signed-off-by: Aaron Chong <[email protected]>

* Address feedback on frontend

Signed-off-by: Aaron Chong <[email protected]>

* Address comments that don't break behavior

Signed-off-by: Aaron Chong <[email protected]>

* Started generic exceptions

Signed-off-by: Aaron Chong <[email protected]>

* Proper db schema for alert request and response

Signed-off-by: Aaron Chong <[email protected]>

* Updated alerts model, frontend tweaks for subscription, using pagination for unackw query, updated API

Signed-off-by: Aaron Chong <[email protected]>

* Attempt to setup minimal RMF during bootstrap step

Signed-off-by: Aaron Chong <[email protected]>

* Fix mistake on ci path

Signed-off-by: Aaron Chong <[email protected]>

* Fix workflow

Signed-off-by: Aaron Chong <[email protected]>

* Revert CI changes

Signed-off-by: Aaron Chong <[email protected]>

* Updated API, renamed event to pushAlert, filter before

Signed-off-by: Aaron Chong <[email protected]>

---------

Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth authored Jul 9, 2024
1 parent 44f4209 commit 090dd9b
Show file tree
Hide file tree
Showing 61 changed files with 2,971 additions and 1,088 deletions.
13 changes: 8 additions & 5 deletions packages/api-client/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Debug from 'debug';
import { io, Socket } from 'socket.io-client';
import {
ApiServerModelsTortoiseModelsAlertsAlertLeaf,
AlertRequest,
AlertResponse,
ApiServerModelsTortoiseModelsBeaconsBeaconStateLeaf as BeaconState,
BuildingMap,
DeliveryAlert,
Expand All @@ -19,8 +20,6 @@ import {
TaskState,
} from './openapi';

type Alert = ApiServerModelsTortoiseModelsAlertsAlertLeaf;

const debug = Debug('rmf-client');

// https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types
Expand Down Expand Up @@ -102,8 +101,12 @@ export class SioClient {
return this.subscribe<TaskEventLog>(`/tasks/${taskId}/log`, listener);
}

subscribeAlerts(listener: Listener<Alert>): Subscription {
return this.subscribe<Alert>(`/alerts`, listener);
subscribeAlertRequests(listener: Listener<AlertRequest>): Subscription {
return this.subscribe<AlertRequest>(`/alerts/requests`, listener);
}

subscribeAlertResponses(listener: Listener<AlertResponse>): Subscription {
return this.subscribe<AlertResponse>(`/alerts/responses`, listener);
}

subscribeDeliveryAlerts(listener: Listener<DeliveryAlert>): Subscription {
Expand Down
Loading

0 comments on commit 090dd9b

Please sign in to comment.