[GH-ISSUE #734] feat(signing): Phase 2 create-missing profile reconciliation + write-back #200

Closed
opened 2026-02-26 21:33:59 +03:00 by kerem · 1 comment
Owner

Originally created by @rudrankriyam on GitHub (Feb 23, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/734

Depends on

  • #PHASE1

Problem

Phase 1 enables readonly bootstrap from a pre-populated signing repo, but teams still need a write path to keep profiles current.

Phase 2 Goal

Extend asc signing sync with profile reconciliation and create-missing write-back (still Git-only backend), while keeping operations deterministic and non-interactive.

Proposed CLI (Phase 2)

asc signing sync \
  --bundle-id com.example.app \
  --profile-type IOS_APP_DEVELOPMENT \
  --git-url "git@github.com:org/signing.git" \
  --git-branch main \
  --create-missing \
  --device "UDID1,UDID2" \
  --passphrase-env ASC_SIGNING_PASSPHRASE \
  --output ./signing

New behavior flags

  • --create-missing (create profile if no active matching profile exists)
  • --device (required for development-style profiles when creating)
  • optional: --commit-message override for write-back commit

Scope

  1. Add profile reconciliation logic against current ASC state.
  2. Detect active matching profile by bundle ID + profile type.
  3. If missing and --create-missing set, create profile with selected certificates/devices.
  4. Store newly created/updated profile in encrypted Git store and push commit.
  5. Preserve readonly behavior when --readonly is set.

Implementation Notes

  • Reuse existing client methods and validation patterns from profiles and signing fetch.
  • Ensure pagination is handled consistently for profile/certificate lookups.
  • Keep deterministic repo layout and commit payloads.
  • No silent mutation: write path must be explicit (--create-missing) and auditable.

Test Plan (TDD)

  • Validation tests:
    • --create-missing + development profile without --device -> exit code 2
    • readonly + create-missing combination should error clearly
  • Reconciliation tests:
    • existing active profile found -> no create, no push
    • missing profile + create-missing -> create + push path
  • API interaction tests:
    • certificate/profile pagination correctness
  • Git write tests:
    • deterministic commit content
    • push failure handling with actionable errors

Always run:

  • make format
  • make lint
  • ASC_BYPASS_KEYCHAIN=1 make test

Acceptance Criteria

  • --create-missing write path works for profiles.
  • Readonly mode never creates/pushes.
  • Device requirements for development profiles are validated.
  • Deterministic, test-covered write-back behavior.
  • Tests and lint/format pass.

Out of Scope (Phase 3+)

  • Certificate creation/renewal lifecycle.
  • .p12 keychain import/install flow.
  • Password rotation/import/migration commands.
Originally created by @rudrankriyam on GitHub (Feb 23, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/734 ## Depends on - #PHASE1 ## Problem Phase 1 enables readonly bootstrap from a pre-populated signing repo, but teams still need a write path to keep profiles current. ## Phase 2 Goal Extend `asc signing sync` with **profile reconciliation and create-missing write-back** (still Git-only backend), while keeping operations deterministic and non-interactive. ## Proposed CLI (Phase 2) ~~~bash asc signing sync \ --bundle-id com.example.app \ --profile-type IOS_APP_DEVELOPMENT \ --git-url "git@github.com:org/signing.git" \ --git-branch main \ --create-missing \ --device "UDID1,UDID2" \ --passphrase-env ASC_SIGNING_PASSPHRASE \ --output ./signing ~~~ ### New behavior flags - `--create-missing` (create profile if no active matching profile exists) - `--device` (required for development-style profiles when creating) - optional: `--commit-message` override for write-back commit ## Scope 1. Add profile reconciliation logic against current ASC state. 2. Detect active matching profile by bundle ID + profile type. 3. If missing and `--create-missing` set, create profile with selected certificates/devices. 4. Store newly created/updated profile in encrypted Git store and push commit. 5. Preserve readonly behavior when `--readonly` is set. ## Implementation Notes - Reuse existing client methods and validation patterns from `profiles` and `signing fetch`. - Ensure pagination is handled consistently for profile/certificate lookups. - Keep deterministic repo layout and commit payloads. - No silent mutation: write path must be explicit (`--create-missing`) and auditable. ## Test Plan (TDD) - Validation tests: - `--create-missing` + development profile without `--device` -> exit code `2` - readonly + create-missing combination should error clearly - Reconciliation tests: - existing active profile found -> no create, no push - missing profile + create-missing -> create + push path - API interaction tests: - certificate/profile pagination correctness - Git write tests: - deterministic commit content - push failure handling with actionable errors Always run: - `make format` - `make lint` - `ASC_BYPASS_KEYCHAIN=1 make test` ## Acceptance Criteria - [ ] `--create-missing` write path works for profiles. - [ ] Readonly mode never creates/pushes. - [ ] Device requirements for development profiles are validated. - [ ] Deterministic, test-covered write-back behavior. - [ ] Tests and lint/format pass. ## Out of Scope (Phase 3+) - Certificate creation/renewal lifecycle. - `.p12` keychain import/install flow. - Password rotation/import/migration commands.
kerem 2026-02-26 21:33:59 +03:00
Author
Owner

@rudrankriyam commented on GitHub (Feb 26, 2026):

Closing for now due scope/priority. We can reopen when this work is prioritized again.

<!-- gh-comment-id:3964494587 --> @rudrankriyam commented on GitHub (Feb 26, 2026): Closing for now due scope/priority. We can reopen when this work is prioritized again.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#200
No description provided.