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

[actions] add filter date to download_dsyms #17228

Merged
merged 4 commits into from Sep 15, 2020

Conversation

mwoollard
Copy link
Contributor

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
    Note that on my system the keychain tests fail, but this occurs before PR:
Fastlane
  Fastlane::FastFile
    Create keychain Integration
      with name and password options
        works when keychain doesn't exist
        work when keychain already exist
        works with a password that contain spaces or `"` (FAILED - 1)
        works with keychain-settings (FAILED - 2)
        works with default_keychain (FAILED - 3)
        works with unlock (FAILED - 4)
        works with all params (FAILED - 5)
        sets the correct keychain path
      with path and password options
        successfully creates the keychain
        sets the correct keychain path
  • 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

Currently download_dsyms can fetch all dsym files, or specific files based on app version, build, live or latest. For some situations when an app may have live version, and multiple versions in development / TestFlight, these options don't provide a means to ensure all dsyms are downloaded without requesting all files every time the command is run.

By adding an option to download files newer than a given uploaded_date, and providing the most recent date of files downloaded during a pass, a controlling script can track the date and request only newer files each time.

Description

The PR adds a new command option after_uploaded_date which takes a date / time string in any format supported by the ruby date parser. When provided only downloads dsym files for builds with an uploaded date more recent than the option.

The most recent uploaded date of the builds that symbols were downloaded for is added to the SharedValues hash as DSYM_LATEST_UPLOADED_DATE.

Additionally the DSYM_LATEST_UPLOADED_DATE SharedValue is cleared by clean_build_artifacts. Although this is not a build artifact it is logical that it would be reset along with DSYM_FILES.

Testing Steps

Have added additional unit test to download_dsyms_specs to validate the correct download calls are made:

$ bundle exec rspec --pattern "**{,/*/**}/download_dsyms_spec.rb"
NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
Gem::Specification#rubyforge_project= called from /Users/markw/.gem/specifications/open4-1.3.4.gemspec:16.
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
Changing stdout to /var/folders/6w/4yzk82317zbc8jwwdr9cn2xw0000gp/T/fastlane_tests, set `DEBUG` environment variable to print to stdout (e.g. when using `pry`)

Fastlane
  Fastlane::FastFile
    download_dsyms
      with no special options
        downloads all dsyms of all builds in all trains
      with version with leading zero
        downloads all dsyms of all builds in train 1.07.0
      when build_number is an integer
        downloads the correct dsyms
      when version is latest
        downloads only dsyms of latest build in latest train
      when version is live
        downloads only dsyms of live build
      when min_version is set
        downloads only dsyms of trains newer than or equal min_version
      with after_uploaded_date
        downloads dsyms with more recent uploaded_date

Finished in 0.12012 seconds (files took 3.53 seconds to load)
7 examples, 0 failures

Have run on our developer accounts and applications to check it correctly selects the expected dsyms when the new option is provided, and that the DSYM_LATEST_UPLOADED_DATE is correct.

Finally, this is my first dive into ruby + fastlane codebase so all feedback appreciated !

@joshdholtz joshdholtz changed the title Dsym download date filter [actions] add filter date to download_dsyms Sep 15, 2020
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! Thank you so much for updating and adding tests 😊 Really appreciate the contribution ❤️

@joshdholtz joshdholtz merged commit 908f06e into fastlane:master Sep 15, 2020
@fastlane-bot
Copy link

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

@stherold
Copy link

Cool directly implemented 👍

@fastlane fastlane locked and limited conversation to collaborators Nov 16, 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