Skip to content

Fix/default bucket#32

Merged
TrevorBurgoyne merged 4 commits intomasterfrom
fix/default-bucket
Mar 2, 2026
Merged

Fix/default bucket#32
TrevorBurgoyne merged 4 commits intomasterfrom
fix/default-bucket

Conversation

@TrevorBurgoyne
Copy link
Member

@TrevorBurgoyne TrevorBurgoyne commented Mar 2, 2026

Description

PR Checklist

  • Merged latest master
  • Updated version number in pyproject.toml.
  • Update README.md if needed.

Breaking Changes

@github-actions github-actions bot added the bug Something isn't working label Mar 2, 2026
@TrevorBurgoyne TrevorBurgoyne requested a review from Copilot March 2, 2026 21:39
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

Bumps the S3MP package version and adjusts global configuration behavior so changing the default bucket key invalidates cached S3 objects.

Changes:

  • Bump project/package version from 0.8.1 to 0.8.2.
  • Invalidate cached boto3 client/resource/bucket when set_default_bucket_key() is called by introducing clear_boto3_cache().

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
uv.lock Updates locked package version to 0.8.2.
pyproject.toml Updates project version to 0.8.2.
S3MP/global_config.py Adds boto3/bucket cache invalidation tied to default bucket key changes.

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

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

S3MP/global_config.py:94

  • clear_boto3_cache() sets _s3_client/_s3_resource to None, but the lazy initializers (s3_client/s3_resource) rebuild them with boto3.client/resource("s3") even if _iam_role_arn is set. That means calling this method after assume_role() (or after loading iam_role_arn from config) can silently drop the assumed-role credentials and switch back to default AWS credentials. Consider either (a) updating the s3_client/s3_resource properties to re-run assume_role(self._iam_role_arn) when _iam_role_arn is set and the cache is empty, or (b) having clear_boto3_cache() also clear _iam_role_arn (and documenting that it reverts to default credentials).
    def clear_boto3_cache(self) -> None:
        """Clear cached boto3 client and resource."""
        self._s3_client = None
        self._s3_resource = None
        self._bucket = None

@TrevorBurgoyne TrevorBurgoyne merged commit def78cb into master Mar 2, 2026
5 checks passed
@TrevorBurgoyne TrevorBurgoyne deleted the fix/default-bucket branch March 2, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants