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] import cert key profiles path args #21723

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bitsofinfo
Copy link

@bitsofinfo bitsofinfo commented Dec 13, 2023

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 see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

#21712

I have a need to manage profiles/certs independently in my match cert/key/profile repo from headless automation. I added some additional config options that lets someone specify paths to certs/keys and profiles rather than having to be prompted for them as well as import them independently from one another.

Description

You can now import certs/keys and profiles independently as well as not be prompted for the paths, but via args, such as the below. Without using any of the new options, the existing behavior works the same (the user gets prompted by the UI). If you are only importing profiles but not certs, the apple connect cert import operations won't occur.

# cert/key only
fastlane match import \
    --import_certificate_file_path /tmp/ccc/ABCD39Z700.cer \
    --import_certificate_private_key_file_path /tmp/ccc/ABCD39Z700.p12 \
    --git_url https://[email protected]/myrepo/mymatchrepo.git \
    --git_branch development \
    --skip_certificate_matching true \
    --import_suppress_ui_file_path_prompts true

# profile only
fastlane match import \
    --import_provisioning_profile_file_path /tmp/pprofile/my_001.mobileprovision \
    --git_url https://[email protected]/myrepo/mymatchrepo.git \
    --git_branch development \
    --import_suppress_ui_file_path_prompts true

# cert/key + profile
fastlane match import \
    --import_certificate_file_path /tmp/ccc/ABCD39Z700.cer \
    --import_certificate_private_key_file_path /tmp/ccc/ABCD39Z700.p12 \
    --import_provisioning_profile_file_path /tmp/pprofile/my_001.mobileprovision \
    --git_url https://[email protected]/myrepo/mymatchrepo.git \
    --git_branch development \
    --import_suppress_ui_file_path_prompts true

Testing Steps

See above, see unit tests.

docs

regarding the docs, i'd like to add info about this here: https://github.com/fastlane/docs/blob/master/docs/generated/actions/match.md?plain=1 however the source says this doc is auto-generated... however its unclear where the bulk of the content is coming.... as the source file referenced at https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/sync_code_signing.rb has none of that content.

…ose import locations via config arguments and make UI prompting for files optional
@bitsofinfo bitsofinfo changed the title Match import cert key profiles path args [match] import cert key profiles path args Dec 13, 2023
Copy link
Contributor

@nekrich nekrich left a comment

Choose a reason for hiding this comment

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

Thanks. Nice improvement for the import.

match/lib/match/importer.rb Outdated Show resolved Hide resolved
match/lib/match/importer.rb Outdated Show resolved Hide resolved
match/lib/match/importer.rb Show resolved Hide resolved
match/lib/match/importer.rb Outdated Show resolved Hide resolved
@bitsofinfo
Copy link
Author

also @nekrich regarding docs, can you point me in the right direction please?

i'd like to add info about this here: https://github.com/fastlane/docs/blob/master/docs/generated/actions/match.md?plain=1 however the source says this doc is auto-generated... however its unclear where the bulk of the content is coming.... as the source file referenced at https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/sync_code_signing.rb has none of that content.

@bitsofinfo
Copy link
Author

Hi! How can I help move this forward?

match/lib/match/importer.rb Outdated Show resolved Hide resolved
match/lib/match/importer.rb Outdated Show resolved Hide resolved
match/lib/match/importer.rb Outdated Show resolved Hide resolved
match/lib/match/importer.rb Show resolved Hide resolved
@lucgrabowski
Copy link
Contributor

The majority of actions has documentation generated based on contents of actions implementation files in ruby, but sync_code_signing has a custom documentation in file:
https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/docs/sync_code_signing.md

Docs update is started on release, you could check how it's generated in here:
https://github.com/fastlane/fastlane/blob/master/fastlane/Fastfile (update_docs)
https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb

@bitsofinfo
Copy link
Author

Hi @lucgrabowski - i'm just getting back to this PR to move it forward. Latest build again failed on doc but not sure why: https://app.circleci.com/pipelines/github/fastlane/fastlane/6347/workflows/b344c11f-ac30-41a3-887f-8f4376e0fb83/jobs/98623?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary

Regarding "The majority of actions has documentation generated based on contents of actions implementation files in ruby", I guess I'm still not following this. I'm not a ruby developer by trade so I'm going to need some assistance w/ this part; much appreciated.

What specific steps do I need to take to see that the additional arguments in the options.rb here show up in the generated docs? I would assume given the match doc already has a section for the options, and I just added some new ones, that they should be auto generated.

@bitsofinfo bitsofinfo requested a review from lacostej April 3, 2024 20:13
@bitsofinfo
Copy link
Author

Hi! How can I help move this forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants