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

DM-34188: Use Client.bucket and not Client.get_bucket #11

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

timj
Copy link
Member

@timj timj commented Mar 24, 2022

Deriving Blobs from a bucket obtained by get_bucket seems
to require more permissions than using a blob obtained
from Client.bucket().

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 87.22%. Comparing base (50f28d4) to head (29facc9).

Files Patch % Lines
python/lsst/resources/gs.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #11   +/-   ##
=======================================
  Coverage   87.22%   87.22%           
=======================================
  Files          27       27           
  Lines        4367     4367           
  Branches      890      890           
=======================================
  Hits         3809     3809           
  Misses        413      413           
  Partials      145      145           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -110,7 +110,7 @@ def client(self) -> storage.Client:
@property
def bucket(self) -> storage.Bucket:
if self._bucket is None:
self._bucket = self.client.get_bucket(self.netloc, retry=_RETRY_POLICY)
self._bucket = self.client.bucket(self.netloc)
Copy link
Member

Choose a reason for hiding this comment

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

I agree that this line should not require any permissions (since Client.bucket does not perform a remote operation). However, I don't know enough about the overall class to say whether it satisfies the requirements of DM-34188.

Would it be possible to set up a test framework that has carefully controlled permissions? You mentioned that this version works on IDF, but you also said the old version worked there.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rra if this fix looks right to you I can merge it and see if that allows you to lower your permissions request.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good to me. I'm happy to test the permission change again with this change.

@timj timj force-pushed the tickets/DM-34188 branch from e8e0ccf to c2290cd Compare March 29, 2022 22:29
@timj timj force-pushed the tickets/DM-34188 branch from c2290cd to 0d10d70 Compare April 29, 2023 01:24
@timj timj force-pushed the tickets/DM-34188 branch from 820d4dd to ff8045d Compare January 22, 2024 19:12
Deriving Blobs from a bucket obtained by get_bucket seems
to require more permissions than using a blob obtained
from Client.bucket().
@timj timj force-pushed the tickets/DM-34188 branch from ff8045d to 29facc9 Compare June 6, 2024 16:25
@timj timj merged commit 86b975e into main Jun 6, 2024
15 of 16 checks passed
@timj timj deleted the tickets/DM-34188 branch June 6, 2024 23:45
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