-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): add more detail + filter to project list page #2201
Conversation
Signed-off-by: Remington Breeze <remington@breeze.software>
✅ Deploy Preview for docs-kargo-akuity-io ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2201 +/- ##
==========================================
- Coverage 46.30% 46.29% -0.01%
==========================================
Files 242 242
Lines 16775 16797 +22
==========================================
+ Hits 7767 7776 +9
- Misses 8636 8645 +9
- Partials 372 376 +4 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Remington Breeze <remington@breeze.software>
Signed-off-by: Remington Breeze <remington@breeze.software>
I'm a little bit worried about the size of the responses from the new endpoint. It's well within the realm of possibility that the response will contain thousands of Stages -- and Stages can be rather large, given the extent of their Status subresources. I'd feel better about it if we introduced paging to both the new endpoint and the Projects page -- sorry I know that's a fair bit of scope creep. If we were to do that, I think it would be tenable to make Ultimately, that would remove the need for the new endpoint. The extent of the back-end changes would just be the addition of paging to the existing list Project endpoint. Tangentially, I think there may be some security considerations to weigh here as well. Regardless of whether we were to make the suggested changes above or not, there may very likely be an issue of users who are able to list all Projects being unable to list Stages, which makes all of this a tad trickier. If we were to swap to the paging approach and using existing endpoints, I think we'd just have to make the UI silently ignore 403s from list Stages requests for any given project. |
Signed-off-by: Remington Breeze <remington@breeze.software>
@krancour Agreed! Updated this PR accordingly, and added simple string filtering in the process |
Signed-off-by: Remington Breeze <remington@breeze.software>
ResourceType string `json:"resourceType,omitempty" protobuf:"bytes,1,opt,name=resourceType"` | ||
ResourceName string `json:"resourceName,omitempty" protobuf:"bytes,2,opt,name=resourceName"` | ||
Verbs []string `json:"verbs,omitempty" protobuf:"bytes,3,rep,name=verbs"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to figure out why these struct tags were absent before and have now shown up all of the sudden. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is non-blocking, btw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering the same thing. Maybe a library used in the tooling was updated recently, but this is the first PR since which had any codegen?
optional int32 page_size = 1; | ||
optional int32 page = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for thinking to make these optional! It preventing breaking the CLI!
@rbreeze took this for a test drive and works very nicely. Excellent work on this. I did notice that the list Stages endpoint isn't returning Stages lexically ordered by name. That's not something new you introduced, but the updated Projects page is making that discrepancy more noticeable. (Surprised no one noticed this when using the CLI.) Would you mind adding a sort here? kargo/internal/api/list_stages_v1alpha1.go Lines 32 to 38 in be15310
|
Signed-off-by: Remington Breeze <remington@breeze.software>
@krancour Good idea! Updated ListStage endpoint with a sort. |
internal/api/list_stages_v1alpha1.go
Outdated
sort.Slice(list.Items, func(i, j int) bool { | ||
return list.Items[i].Name < list.Items[j].Name | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Go 1.21, this is the preferred way to sort:
sort.Slice(list.Items, func(i, j int) bool { | |
return list.Items[i].Name < list.Items[j].Name | |
}) | |
slices.SortFunc(list.Items, func(a, b kargoapi.Stage) int { | |
return strings.Compare(a.Name, b.Name) | |
}) |
Note, we do have a lot of places in the code base where it's still done the older way and I'll open a separate chore issue for fixing those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks for catching that! Updated the ListProject sort too. Sorry for the back and forth
Signed-off-by: Remington Breeze <remington@breeze.software>
Fixes #1836
Includes new API endpoint that provides a list of Stages for each Project.