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

fix: Requester pays to check reason and fallback to error message validation #841

Merged
merged 5 commits into from Mar 4, 2022

Conversation

sydney-munro
Copy link
Contributor

@sydney-munro sydney-munro commented Mar 2, 2022

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #824 ☕️

If you write sample code, please follow the samples format.

@sydney-munro sydney-munro requested a review from a team as a code owner March 2, 2022 22:39
@sydney-munro sydney-munro self-assigned this Mar 2, 2022
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage-nio API. label Mar 2, 2022
@droazen
Copy link
Contributor

droazen commented Mar 4, 2022

@sydney-munro Should the requester pays tests disabled in #825 be re-enabled here to ensure that they pass with this patch?

@sydney-munro
Copy link
Contributor Author

@sydney-munro Should the requester pays tests disabled in #825 be re-enabled here to ensure that they pass with this patch?

yes. Those have been added back plus an additional test.

@@ -338,18 +327,20 @@ public void testAutodetectWhenNotRequesterPays() throws IOException {
"");
}

@Test
public void testAutoDetectNoUserProject() throws IOException {
CloudStorageFileSystem testBucket = getRequesterPaysBucket(false, "");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To avoid dealing with this check, we set autodetect to false and then just check the provider value for requesterPays directly.

@sydney-munro sydney-munro merged commit 9f30db3 into main Mar 4, 2022
@sydney-munro sydney-munro deleted the i-824 branch March 4, 2022 20:07
lbergelson added a commit to lbergelson/java-storage-nio that referenced this pull request Mar 8, 2022
Fixes a NullPointerException introduced in googleapis#841 which occured when trying
to check the the requesterPays status of a file while authenticated with an
invalid service account.

Refs: googleapis#849, googleapis#841
cojenco pushed a commit that referenced this pull request Mar 9, 2022
Fixes a NullPointerException introduced in #841 which occured when trying
to check the the requesterPays status of a file while authenticated with an
invalid service account.

Refs: #849, #841
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage-nio API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

As of 2022-02-22 Automatic detection of requesterPays buckets is failing
4 participants