Skip to content

Conversation

@koonpeng
Copy link
Collaborator

What's new

Supports labels without requiring the schema to be strongly defined. This is still a bit hacky, it still assumes the label is a json with a description field while labels in RMF are free-form strings. RMF needs to support key value pair labels for us to be able to use them "natively".

Another issue is that tortoise-orm is lacking many features which prevent us to implement proper sorting on generic labels so we must still use hacks for the pickup and destination fields. We could use raw sql for this or drop support for sorting by labels.

Self-checks

  • I have prototyped this new feature (if necessary) on Figma
  • I'm familiar with and follow this Typescript guideline
  • I added unit-tests for new components
  • I tried testing edge cases
  • I tested the behavior of the components that interact with the backend, with an e2e test

Discussion

Sorry, something went wrong.

koonpeng added 2 commits May 27, 2024 17:52

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Signed-off-by: Teo Koon Peng <[email protected]>
@koonpeng koonpeng requested a review from aaronchongth May 28, 2024 08:09
koonpeng added 2 commits May 29, 2024 10:48
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

Looks good, just 1 question about the query route

),
pickup: Optional[str] = Query(
None, description="comma separated list of pickup names"
None, description="comma separated list of pickup names", deprecated=True
Copy link
Member

Choose a reason for hiding this comment

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

why is this marked as deprecated? Same for the destination query below

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are being replaced with label=name=value, in main. Let me see if I can port generic label filtering over (already tested sorting doesn't work due to tortoise bug).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

managed to port label sorting over, this also fixes an issue with filtering where if you try to filter by pickup and destination you get no result even though there is a task that meets the criteria.

@koonpeng koonpeng requested a review from aaronchongth June 3, 2024 04:04
koonpeng added 2 commits June 3, 2024 12:09
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

Looks like with the extra fields in the API, anywhere using this API needs to be updated too

koonpeng added 2 commits June 5, 2024 12:10
Signed-off-by: Teo Koon Peng <[email protected]>
Signed-off-by: Teo Koon Peng <[email protected]>
Copy link
Member

@aaronchongth aaronchongth left a comment

Choose a reason for hiding this comment

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

Thanks for setting this up! LGTM

@aaronchongth aaronchongth merged commit d39a031 into deploy/hammer Jun 5, 2024
@aaronchongth aaronchongth deleted the koonpeng/generic-labels branch June 5, 2024 06:32
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.

None yet

3 participants