Skip to content

Objectcount#49

Merged
overtrue merged 4 commits intorustfs:mainfrom
GatewayJ:objectcount
Feb 27, 2026
Merged

Objectcount#49
overtrue merged 4 commits intorustfs:mainfrom
GatewayJ:objectcount

Conversation

@GatewayJ
Copy link
Member

Pull Request

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
pnpm test:run

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

Closes #

Screenshots (if applicable)

Additional Notes

@GatewayJ GatewayJ marked this pull request as draft February 12, 2026 09:37
@overtrue overtrue marked this pull request as ready for review February 27, 2026 08:17
Copilot AI review requested due to automatic review settings February 27, 2026 08:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands console permission evaluation and adjusts the browser buckets page so “Object Count” / “Size” columns can be shown even when the user can’t access the underlying usage endpoint (handling 403s locally instead of via the global redirect).

Changes:

  • Extend ConsoleStatement parsing/evaluation to support NotAction and relax Action to optional, plus add console-scope resource handling logic.
  • Add a per-request API client option to suppress the global 403 handler and throw instead.
  • Update the buckets browser page to always request bucket usage and render placeholders ("--") when usage data can’t be fetched.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
lib/console-policy-parser.ts Adds NotAction support and modifies action/resource matching for console scopes.
lib/api-client.ts Introduces suppress403Redirect to bypass the global 403 handler and throw an error.
hooks/use-system.ts Uses suppress403Redirect for /datausageinfo requests.
app/(dashboard)/browser/page.tsx Always shows Object Count/Size columns and avoids populating 0-values when usage can’t be fetched.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 137 to 139
},
[isAdmin, listBuckets, loadBucketUsage],
[listBuckets, loadBucketUsage],
)
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

After removing isAdmin from the hook dependency arrays, isAdmin (and useAuth) appears to be unused in this component, which will trigger no-unused-vars during lint/typecheck. Consider removing the useAuth import and const { isAdmin } = useAuth() if it’s no longer needed.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

@overtrue
Copy link
Collaborator

@copilot fix conflicts

@overtrue
Copy link
Collaborator

@GatewayJ 处理一下冲突

GatewayJ and others added 3 commits February 27, 2026 20:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@GatewayJ
Copy link
Member Author

@GatewayJ 处理一下冲突

ok了 ,done it

@overtrue overtrue merged commit f84d0dc into rustfs:main Feb 27, 2026
11 checks passed
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.

3 participants