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] Manually manage the fastlane match Repo was broken #13521

Closed
vitaminBW opened this issue Oct 11, 2018 · 15 comments

Comments

Projects
None yet
10 participants
@vitaminBW
Copy link

commented Oct 11, 2018

New Regression Checklist

Regression Information

Using this instruction docs.fastlane сommand GitHelper.clone not working. I'm trying to add existing certificates to the private git repository.

  • Breaking version: [e.g. 2.106.0]
  • Last working version: [e.g. 2.105.2]

Regression Description

Complete output when running fastlane, including the stack trace and command used
2.4.2 :023 > workspace = Match::GitHelper.clone(git_url, shallow_clone, manual_password: manual_password)
NameError: uninitialized constant Match::GitHelper
Did you mean?  Match::Helper
	from (irb):23
	from /Users/User1/.rvm/rubies/ruby-2.4.2/bin/irb:11:in `<main>'

Environment

Do this from an interactive Ruby console
@joshdholtz

This comment has been minimized.

Copy link
Member

commented Oct 11, 2018

@vitaminBW Looking into!

@vitaminBW

This comment has been minimized.

Copy link
Author

commented Oct 16, 2018

@joshdholtz i have found the method to download and decrypt repo from last commits
fastlane match decrypt
It would be fantastic if you would have method encrypt and upload also. For example -
fastlane match encrypt

@stanBienaives

This comment has been minimized.

Copy link

commented Oct 16, 2018

@vitaminBW the Match::GitHelper.clone method is not available since this commit cc282f2

Here is a workaround I am using in my custom actions:

config = FastlaneCore::Configuration.create(Match::Options.available_options, {}).load_configuration_file('Matchfile').options

config[:clone_branch_directly] = true
config[:skip_docs] = true
config[:shallow_clone] = true

# clone repo to get path
storage = Match::Storage.for_mode('git', config)
storage.download

encryption = Match::Encryption.for_storage_mode('git', {
  git_url: config[:git_url],
  working_directory: storage.working_directory
})
encryption.decrypt_files

#use path to the directory to manipulate files: 
storage.working_directory

Hope it helps.

In my opinion this is not very handy. It was cleaner to call a wrapper that took care of both cloning and decrypting.

@JCMais

This comment has been minimized.

Copy link

commented Oct 23, 2018

can we have a official word here? This was something that was supported and documented, so I suppose this is a breaking change.

I had written about using this method to use existing certificates / profiles with fastlane: https://medium.com/me/stats/post/a325be69dac6

@tpoche

This comment has been minimized.

Copy link

commented Oct 24, 2018

Agreed, this was something we used often to incorporate existing certificates and provisioning profiles into Match. Would love to have this working again or another way to achieve the same end result.

@lparenteau

This comment has been minimized.

Copy link

commented Oct 24, 2018

@vitaminBW the Match::GitHelper.clone method is not available since this commit cc282f2

Here is a workaround I am using in my custom actions:

config = FastlaneCore::Configuration.create(Match::Options.available_options, {}).load_configuration_file('Matchfile').options

config[:clone_branch_directly] = true
config[:skip_docs] = true
config[:shallow_clone] = true

# clone repo to get path
storage = Match::Storage.for_mode('git', config)
storage.download

encryption = Match::Encryption.for_storage_mode('git', {
  git_url: config[:git_url],
  working_directory: storage.working_directory
})
encryption.decrypt_files

#use path to the directory to manipulate files: 
storage.working_directory

Hope it helps.

In my opinion this is not very handy. It was cleaner to call a wrapper that took care of both cloning and decrypting.

To save changes once you're done :

encryption.encrypt_files
storage.save_changes!()
@tpoche

This comment has been minimized.

Copy link

commented Oct 25, 2018

@lparenteau Thanks for this workaround. Note that in my case, I also had to add the following config value to get it working properly:
config[:git_branch] = 'master'

Seems like that should've been the default, but I was getting an exception when calling the storage.download method without that included.

@LizCira

This comment has been minimized.

Copy link

commented Oct 26, 2018

It's not ideal, but you can also just regress your Fastlane gem version, as the original post points out, it still works at 2.105.2

@JAManfredi

This comment has been minimized.

Copy link

commented Nov 2, 2018

We frequently use this as well, please fix.

@janpio janpio added the tool: match label Nov 19, 2018

@janpio

This comment has been minimized.

Copy link
Collaborator

commented Nov 19, 2018

Hey, could someone please summarize for me what exactly is broken? Whole manual management? Only decrypt, only encrypt? Where does this Match::GitHelper.clone thing come from?

@joshdholtz

This comment has been minimized.

Copy link
Member

commented Nov 19, 2018

Hey everyone 👋 Just wanted to give the official response/announcement to this...

Match::GitHelper was replaced a few fastlane ago (since 2.106.0 which happened in #13405). This big internal rewrite was to allow for other storage and encryption schemes to be integrated in the near future - so that's its not only git storage and not only AES ecryption using OpenSSL.

Match::GitHelper was removed in this PR but we could add something similar back in to help make this easier to do manually.

The docs have been updated accordingly here - https://docs.fastlane.tools/advanced/other/#decryption-instructions

@janpio

This comment has been minimized.

Copy link
Collaborator

commented Nov 19, 2018

(That link unfortunately does not work directly, you have to go to https://docs.fastlane.tools/advanced/other/#manually-manage-the-fastlane-match-repo first an un-collapse the "Instructions")

@fastlane-bot

This comment has been minimized.

Copy link

commented Dec 20, 2018

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@janpio

This comment has been minimized.

Copy link
Collaborator

commented Dec 22, 2018

Hey all, the documentation linked above seems to work and have the expected result. Looks like you, @JCMais, also updated your post at https://medium.com/@jonathancardoso/using-fastlane-match-with-existing-certificates-without-revoking-them-a325be69dac6 to include the new commands.

Can we close this?

@JCMais

This comment has been minimized.

Copy link

commented Dec 22, 2018

I think so, thanks everyone for posting solutions and for updating the official docs.

@janpio janpio closed this Jan 2, 2019

@fastlane fastlane locked and limited conversation to collaborators Mar 4, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.