Skip to content

[NAE-2406] S3 storage bucket alias#437

Open
renczesstefan wants to merge 3 commits intorelease/7.0.0-rev10from
NAE-2406
Open

[NAE-2406] S3 storage bucket alias#437
renczesstefan wants to merge 3 commits intorelease/7.0.0-rev10from
NAE-2406

Conversation

@renczesstefan
Copy link
Copy Markdown
Member

@renczesstefan renczesstefan commented May 4, 2026

Description

Implements NAE-2406

Dependencies

No new dependencies were introduced

Third party dependencies

No new dependencies were introduced

Blocking Pull requests

There are no dependencies on other PR

How Has Been This Tested?

This was tested manually and with unit tests. File attached to task.

Test Configuration

Name Tested on
OS macOS Tahoe 26.3
Runtime Java 21
Dependency Manager Maven 3.9.9n
Framework version Spring Boot 3.4.4
Run parameters
Other configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes have been checked, personally or remotely, with @machacjozef
  • I have commented my code, particularly in hard-to-understand areas
  • I have resolved all conflicts with the target branch of the PR
  • I have updated and synced my code with the target branch
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes:
    • Lint test
    • Unit tests
    • Integration tests
  • I have checked my contribution with code analysis tools:
  • I have made corresponding changes to the documentation:
    • Developer documentation
    • User Guides
    • Migration Guides

Summary by CodeRabbit

  • New Features

    • MinIO storage configuration now supports bucket aliases. Buckets are resolved based on host-specific mappings, allowing flexible per-host bucket name assignment for more granular storage configuration control.
  • Chores

    • Removed unused imports from codebase.

- Extended `MinIoHostInfo` class to support `bucketAliases` mapping for enhanced bucket aliasing functionality.
- Updated `MinIoStorageService`:
  - Modified `createStorage` to attach bucket aliases dynamically based on the host.
  - Introduced `getMappedBucketIfExists` for resolving bucket aliases.
  - Adjusted `getBucketOrDefault` to work with the new alias mapping implementation.
- Minor refactoring and cleanup, such as removing unused annotations.
- updated resolution of mapped buckets
@renczesstefan renczesstefan self-assigned this May 4, 2026
@renczesstefan renczesstefan added improvement A change that improves on an existing feature Medium labels May 4, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

Warning

Rate limit exceeded

@renczesstefan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 42 minutes and 6 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 755be1e2-43bf-4585-a883-70b8a7efbfdd

📥 Commits

Reviewing files that changed from the base of the PR and between c902dca and d6e6068.

📒 Files selected for processing (2)
  • application-engine/src/main/java/com/netgrif/application/engine/files/minio/MinIoStorageService.java
  • application-engine/src/main/resources/application-dev.yaml

Walkthrough

The pull request extends MinIO storage configuration with bucket alias support. A new field is added to MinIoHostInfo to store bucket aliases per host. The MinIoStorageService is updated to resolve buckets using host-aware alias mapping instead of static defaults, with a helper method for alias lookup.

Changes

MinIO Bucket Alias Resolution

Layer / File(s) Summary
Data Shape
application-engine/src/main/java/com/netgrif/application/engine/files/minio/MinIoHostInfo.java
MinIoHostInfo adds bucketAliases: Map<String, String> field to store per-host bucket alias mappings.
Core Implementation
application-engine/src/main/java/com/netgrif/application/engine/files/minio/MinIoStorageService.java
createStorage(Data) now resolves buckets via getBucketOrDefault(String host, String bucket) to enable host-aware alias lookup. Method signature changed from static to instance. New helper getMappedBucketIfExists(String host, String aliasKey) queries host bucket aliases and returns mapped values or the original key.
Cleanup
application-engine/src/main/java/com/netgrif/application/engine/files/minio/StorageConfigurationProperties.java, application-engine/src/main/java/com/netgrif/application/engine/startup/runner/StorageRunner.java
Unused imports removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding S3 storage bucket aliasing functionality, directly aligned with the primary modifications in MinIoHostInfo and MinIoStorageService.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 42 minutes and 6 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@application-engine/src/main/java/com/netgrif/application/engine/files/minio/MinIoStorageService.java`:
- Around line 163-170: getMappedBucketIfExists performs four redundant calls to
properties.getMinIo().getHosts(host); cache the result in a local variable
(e.g., var hostConfig or hosts) at the start of the method and use that variable
in the null checks, getBucketAliases() call, containsKey(aliasKey) check and
get(aliasKey) retrieval inside getMappedBucketIfExists to avoid repeated
lookups.
- Around line 52-64: In createStorage in MinIoStorageService, the inner
null-check around data.getStorage().getBucket() prevents getBucketOrDefault from
applying the DEFAULT_BUCKET fallback; remove that inner if and always call
storage.setBucket(getBucketOrDefault(storage.getHost(),
data.getStorage().getBucket())) when data.getStorage().getHost() is non-null so
MinIoStorage.bucket is set (possibly to DEFAULT_BUCKET) as intended; keep the
existing enabled check (properties.getMinIo().isEnabled()) and
StorageNotEnabledException handling unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 876f6072-63f2-4039-9a40-24dded3e9005

📥 Commits

Reviewing files that changed from the base of the PR and between c627375 and c902dca.

📒 Files selected for processing (4)
  • application-engine/src/main/java/com/netgrif/application/engine/files/minio/MinIoHostInfo.java
  • application-engine/src/main/java/com/netgrif/application/engine/files/minio/MinIoStorageService.java
  • application-engine/src/main/java/com/netgrif/application/engine/files/minio/StorageConfigurationProperties.java
  • application-engine/src/main/java/com/netgrif/application/engine/startup/runner/StorageRunner.java
💤 Files with no reviewable changes (2)
  • application-engine/src/main/java/com/netgrif/application/engine/startup/runner/StorageRunner.java
  • application-engine/src/main/java/com/netgrif/application/engine/files/minio/StorageConfigurationProperties.java

- updated according to PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement A change that improves on an existing feature Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant