Skip to content
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

Im 542 get s3 region by analyzing the asset href #224

Merged

Conversation

inigo-cobian
Copy link
Contributor

Changelog:

  • The AWS region of the bucket is now obtained by analyzing the URL of the asset.
  • Removed item_assets compatibility, as it lacked the href field needed for getting the bucket.
  • Changed the name of s3BucketRegion to awsRegion and removed it as a parameter at the importer.

@inigo-cobian inigo-cobian added the java Pull requests that update Java code label Jan 30, 2025
@inigo-cobian inigo-cobian requested a review from a team January 30, 2025 11:15
@inigo-cobian inigo-cobian self-assigned this Jan 30, 2025
} catch (Exception e) {
System.err.println("Exception testing region " + region + ": " + e.getMessage());
// Continue testing other regions if the bucket is not found
continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

This catch is very general, could it be interesting to write a warning to the log file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure about adding the logging class here, as the loop will fail most times. I could manage the exceptions in a more specialized way.

return resolvedRegion;

} catch (Exception e) {
System.err.println("Failed to resolve region dynamically for bucket: " + bucketName + ". Error: " + e.getMessage());
// try another one
Copy link
Contributor

Choose a reason for hiding this comment

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

This catch is very general, could it be interesting to write a warning to the log file?

@inigo-cobian inigo-cobian merged commit 07a89f6 into develop Feb 3, 2025
2 checks passed
@inigo-cobian inigo-cobian deleted the IM-542-Get-S3-region-by-analyzing-the-asset-href branch February 12, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java Pull requests that update Java code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants