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

Feature/Create buckets with roles for unit tests #639

Merged
merged 3 commits into from
Oct 13, 2023

Conversation

alexmassen-hane
Copy link
Contributor

For some workflows, usage of Google storage buckets require explicit roles and permissions. For example, OpenAlex requires the following permissions for transferring data between AWS and GCS:

  • roles/storage.objectViewer
  • roles/storage.legacyBucketWriter

These roles are now needed to be explicitly added to buckets, otherwise unit tests will fail due to permission issues. This PR adds the ability to create Google storage buckets with specific roles for usage in unit tests.

Buckets are now added to the ObservatoryEnvironment class as a data dictionary where the keys are the bucket_ids and the values are a set of roles required. I have added the roles in such a way that it should not interfere with existing unit tests for the academic observatory workflows.

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (35360c7) 87.16% compared to head (a9aac8b) 87.26%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #639      +/-   ##
===========================================
+ Coverage    87.16%   87.26%   +0.10%     
===========================================
  Files           34       34              
  Lines         4697     4704       +7     
  Branches       572      574       +2     
===========================================
+ Hits          4094     4105      +11     
+ Misses         486      483       -3     
+ Partials       117      116       -1     
Files Coverage Δ
...rm/observatory/platform/observatory_environment.py 84.81% <100.00%> (+0.18%) ⬆️

... and 1 file with indirect coverage changes

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

keegansmith21
keegansmith21 previously approved these changes Sep 28, 2023
Copy link
Contributor

@keegansmith21 keegansmith21 left a comment

Choose a reason for hiding this comment

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

Thanks Alex, this looks good!

Copy link
Contributor

@jdddog jdddog left a comment

Choose a reason for hiding this comment

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

Thanks Alex, looks good.

@jdddog jdddog enabled auto-merge October 13, 2023 05:50
@jdddog jdddog added this pull request to the merge queue Oct 13, 2023
Merged via the queue into develop with commit 32b12d6 Oct 13, 2023
@jdddog jdddog deleted the feature/create-gcs-bucket-wth-roles branch October 20, 2023 03:49
jdddog added a commit that referenced this pull request Feb 25, 2024
Co-authored-by: Jamie Diprose <5715104+jdddog@users.noreply.github.com>
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