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

[match] Add s3_object_prefix option to match's S3Storage. #16682

Merged
merged 5 commits into from Jul 6, 2020

Conversation

atreat
Copy link
Contributor

@atreat atreat commented Jun 25, 2020

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Wanted to use the Match S3 storage option but realized that it would take over the bucket I had planned to use. With a prefix, I'd be able to keep android/ios codesign assets in the same bucket but partitioned off correctly.

Description

This adds the s3_object_prefix (MATCH_S3_OBJECT_PREFIX envvar) as an available option. This can be used to help partition match in an existing bucket.

Testing Steps

I've added RSpec examples for the areas that were updated. Also updated what seemed to be an odd stub mechanism in the runner spec as I did not expect tests to fail because this new optional option was not present.

I also switched over to use this updated option locally and was able to import my existing certificates/profiles into the expected s3 structure.

Austin Emmons added 2 commits June 25, 2020 11:03
This option is used to add a prefix to all objects managed by match.
It does not automatically add a trailing `/` character to specify a
directory.
@atreat
Copy link
Contributor Author

atreat commented Jun 26, 2020

Not sure how best to address the failing build

/usr/local/Homebrew/Library/Homebrew/brew.rb:10:in `<main>': Homebrew must be run under Ruby 2.6! You're running 2.3.3. (RuntimeError)

The step beforehand prints out:

ruby -v
ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-darwin17]

If anyone has any thoughts on the best path forward let me know.

@janpio janpio changed the title Add s3_object_prefix option to match's S3Storage. [match] Add s3_object_prefix option to match's S3Storage. Jun 28, 2020
@janpio
Copy link
Member

janpio commented Jun 28, 2020

I usually just restart the tests - this error message does not make any sense. I fear it is some random machine on Circle CI that just lies to us for some reason. IF you have an idea how to fix it, pleeeeease let me know.

@janpio
Copy link
Member

janpio commented Jun 28, 2020

Uh hey @googlebot, how about the CLA label thing!?

Will prepend this value to all target_paths of uploaded/deleted files
Will strip this value from the object_key when downloading files so the
path in the working directory is maintained.
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

This looks great! I like this addition. Just a few small thoughts on adding back in some checking on the tests 😊

match/spec/runner_spec.rb Outdated Show resolved Hide resolved
match/spec/runner_spec.rb Outdated Show resolved Hide resolved
match/spec/runner_spec.rb Outdated Show resolved Hide resolved
match/spec/runner_spec.rb Outdated Show resolved Hide resolved
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

Just tested this out and it works great for me! Thanks for adding this in! ❤️

@joshdholtz joshdholtz merged commit f892133 into fastlane:master Jul 6, 2020
@fastlane-bot
Copy link

Hey @atreat 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

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

Congratulations! 🎉 This was released as part of fastlane 2.151.0 🚀

minuscorp pushed a commit to minuscorp/fastlane that referenced this pull request Jul 18, 2020
…#16682)

* Adds `s3_object_prefix option to match.

This option is used to add a prefix to all objects managed by match.
It does not automatically add a trailing `/` character to specify a
directory.

* Updates match runner to pass `s3_object_prefix` option to Storage

* Updates S3Storage to handle `s3_object_prefix` option

Will prepend this value to all target_paths of uploaded/deleted files
Will strip this value from the object_key when downloading files so the
path in the working directory is maintained.

* Update regex when stripping s3_object_prefix from object_path

* Reverts changes to Match runner spec
@fastlane fastlane locked and limited conversation to collaborators Sep 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants