[match] Fix match_nuke certificate_id filtering#30022
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes match_nuke so the certificate_id option is honored even when force: true, ensuring only the selected certificate and its dependent provisioning profiles/files are targeted.
Changes:
- Apply
certificate_idfiltering before the existingforceshort-circuit inMatch::Nuke#filter_by_cert. - Refactor certificate/profile/file filtering into helper methods to reuse the same selection logic.
- Add specs covering the
force: true+certificate_idregression and the “unknown certificate_id” error path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
match/lib/match/nuke.rb |
Ensures certificate_id drives certificate/profile/file selection (even with force: true) and centralizes filtering logic. |
match/spec/nuke_spec.rb |
Adds regression + error-path unit coverage for certificate_id behavior in the nuke flow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0cafe31 to
a95af18
Compare
There was a problem hiding this comment.
Hey @nakshatrasinghh 👋
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 month, 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 🚀"
…30022) Co-authored-by: Nakshatra Singh <[email protected]>
There was a problem hiding this comment.
Congratulations! 🎉 This was released as part of fastlane 2.234.0 🚀
Checklist
bundle exec rspecfrom the root directory to see all new and existing tests passbundle exec rubocop -ato ensure the code style is validci/circlecibuilds in the "All checks have passed" section of my PRMotivation and Context
match_nukeexposes thecertificate_idoption, but the nuke flow did not use it when filtering certificates, provisioning profiles, or files.As a result, running
match_nukewith bothforce: trueand a specificcertificate_idcould still list and revoke/delete every fetched certificate and matching provisioning profile, instead of only the selected certificate and profiles that depend on it.Resolves #30015
Description
This change makes
match_nukehonorcertificate_idbefore the existingforcebehavior short-circuits certificate filtering.When
certificate_idis provided,match_nukenow:certificate_iddoes not match any fetched certificateI also added unit coverage for the
force: truecase reported in the issue, plus coverage for the invalidcertificate_idpath.No documentation update was needed because
certificate_idwas already documented formatch_nuke; this fixes the implementation to match the documented behavior.Testing Steps
Added regression coverage that simulates the
match_nukeenvironment from #30015:force: truecertificate_id: "1111111111"1111111111and2222222222.cer,.p12, and.mobileprovisionfiles for both certificates/profilesThe spec calls
filter_by_certand verifies that only the selected certificate, its key, and its dependent provisioning profile remain queued for deletion. It also verifies that an unmatchedcertificate_idraises an explicit error.Ran the focused
match_nukespecs covering this change:env -u NO_COLOR bundle exec rspec match/spec/nuke_spec.rbResult:
Ran RuboCop on the touched files:
env -u NO_COLOR RUBOCOP_CACHE_ROOT=/private/tmp/rubocop-cache bundle exec rubocop match/lib/match/nuke.rb match/spec/nuke_spec.rbResult:
Ran the full RuboCop suite:
RUBOCOP_CACHE_ROOT=/private/tmp/rubocop-cache bundle exec rubocopResult:
Ran docs validation:
env -u NO_COLOR bundle exec fastlane validate_docsResult: passed.