-
Notifications
You must be signed in to change notification settings - Fork 88
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
Require the AWS region to be specified if using AWS S3 for blob storage #1055
Conversation
@@ -325,16 +325,9 @@ private void ValidateUploadOptions(MigrateRepoCommandArgs args) | |||
throw new OctoshiftCliException("Either --aws-secret-key or AWS_SECRET_ACCESS_KEY environment variable must be set."); | |||
} | |||
|
|||
if (GetAwsSessionToken(args).HasValue() && GetAwsRegion(args).IsNullOrWhiteSpace()) | |||
if (GetAwsRegion(args).IsNullOrWhiteSpace()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem like we should have to have this validation here because AwsApiFactory
will validate that the region is set when it is initialized. But in the tests, there are some cases which skip that path and this validation gets run.
Fixes #857. |
3a4cb82
to
17dd230
Compare
The tests pass for me locally, but we get failures like this in CI:
I'm not sure how to debug that. |
When I run it in a codespace I see the same failing tests. You might not be seeing it locally because you have some AWS env vars set that the CI doesn't? |
That's a great point. I definitely do. I'll give it a go on a Codespace on Monday. Another reason why clean, separated environments are a good idea...! |
Thanks to @dylan-smith for the [suggestion][1]! [1]: #1055 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
A few months ago, we changed the CLI to allow an AWS region to be specified when using AWS S3 for blob storage in
gh gei
andgh bbs2gh
.We added support for specifying an AWS region because:
For backwards compatibility, we made the region optional - unless you're using an AWS session token specified with
--aws-session-token
orAWS_SESSION_TOKEN
, in which case the region is mandatory. If you don't specify it, we allow you to continue, but print a warning saying that providing a region is recommended and will soon be mandatory.This updates the behaviour, completing our breaking change, making it mandatory to specify the session token.
ThirdPartyNotices.txt
(if applicable)