Skip to content

[#225] 테스트플라이트 자동 배포가 실패하는 현상을 해결한다#240

Merged
opficdev merged 21 commits intodevelopfrom
fix/#225-fastlane
Mar 10, 2026
Merged

[#225] 테스트플라이트 자동 배포가 실패하는 현상을 해결한다#240
opficdev merged 21 commits intodevelopfrom
fix/#225-fastlane

Conversation

@opficdev
Copy link
Owner

No description provided.

@opficdev opficdev self-assigned this Mar 10, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 TestFlight 자동 배포 실패 문제를 해결하기 위해 Fastlane 설정을 개선합니다. 주요 변경 사항은 빌드 번호 관리 로직을 고도화하고, CI 환경에서의 코드 사이닝 안정성을 강화하며, Fastlane 레인 구성을 명확하게 재정비하는 것입니다. 이를 통해 TestFlight 배포 프로세스의 견고함과 신뢰성을 향상시키는 것을 목표로 합니다.

Highlights

  • Fastlane 빌드 번호 관리 개선: TestFlight에 배포할 최신 빌드 번호를 가져오는 fetch_latest_testflight_build_number 프라이빗 레인을 추가하여, 기존 빌드 번호에 1을 더해 새로운 빌드 번호를 자동으로 할당하도록 변경했습니다.
  • Fastlane 환경 변수 설정 추가: build_for_store 레인에 FASTLANE_XCODEBUILD_SETTINGS_TIMEOUTFASTLANE_XCODEBUILD_SETTINGS_RETRIES 환경 변수를 설정하는 로직을 추가하여 빌드 안정성을 높였습니다.
  • CI 환경 코드 사이닝 설정 강화: CI 환경에서 App Store 프로비저닝 프로파일이 누락되지 않도록 확인하고, 수동 코드 사이닝 설정을 업데이트하는 로직을 build_for_store 레인에 추가했습니다.
  • Fastlane 레인 이름 변경 및 추가: 기존 beta 레인의 이름을 deploy_testflight로 변경하고, 빌드만 수행하는 testflight_build_only 레인을 새로 추가했습니다.
  • Fastlane 설정 상수화 및 빌드 옵션 추가: Xcode 프로젝트, 앱 식별자, 타겟 이름을 상수로 정의하여 재사용성을 높였으며, build_app 액션에 -skipPackagePluginValidation xcargs를 추가했습니다.
  • .gitignore 업데이트: Fastlane 관련 파일인 fastlane/README.md.gitignore에 추가하여 불필요한 파일이 버전 관리되지 않도록 했습니다.
Changelog
  • .gitignore
    • fastlane/README.md 파일을 무시 목록에 추가했습니다.
  • fastlane/Fastfile
    • XCODE_PROJ, APP_IDENTIFIER, TARGET_NAME 상수를 정의했습니다.
    • 최신 TestFlight 빌드 번호를 가져오는 fetch_latest_testflight_build_number 프라이빗 레인을 추가했습니다.
    • build_for_store 레인에 FASTLANE_XCODEBUILD_SETTINGS_TIMEOUTFASTLANE_XCODEBUILD_SETTINGS_RETRIES 환경 변수 설정을 추가했습니다.
    • build_for_store 레인에서 최신 TestFlight 빌드 번호를 기반으로 빌드 번호를 증가시키도록 로직을 수정했습니다.
    • build_for_store 레인에 development 타입의 match 액션을 추가했습니다.
    • CI 환경에서 코드 사이닝 설정을 업데이트하는 조건부 로직을 build_for_store 레인에 추가했습니다.
    • build_app 액션에서 정의된 상수를 사용하고 -skipPackagePluginValidation xcargs를 추가했습니다.
    • 기존 beta 레인의 이름을 deploy_testflight로 변경했습니다.
    • 빌드만 수행하는 testflight_build_only 레인을 새로 추가했습니다.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/build.yml
    • .github/workflows/release.yml
    • .github/workflows/testflight.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@opficdev opficdev merged commit 5bf1ea1 into develop Mar 10, 2026
1 check failed
@opficdev opficdev deleted the fix/#225-fastlane branch March 10, 2026 02:02
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 TestFlight 자동 배포 실패 문제를 해결하기 위해 Fastlane 설정을 수정했습니다. Fastfile에 TestFlight에서 최신 빌드 번호를 가져오는 로직을 추가하고, 이를 사용하여 빌드 번호를 증가시키도록 변경되었습니다. 또한, CI 환경에서의 코드 서명 설정과 빌드 옵션이 수정되었습니다. 리뷰에서는 Ruby 코드 스타일 컨벤션에 따라 변수명을 수정하는 것을 제안했습니다.

I am having trouble creating individual review comments. Click here to see my feedback.

fastlane/Fastfile (8-35)

medium

Ruby에서는 변수명으로 스네이크 케이스(snake_case)를 사용하는 것이 일반적인 컨벤션입니다. apiKeyversionNumberapi_keyversion_number로 변경하여 코드 스타일의 일관성을 높이는 것을 제안합니다.

  private_lane :fetch_latest_testflight_build_number do |options|
    require "spaceship"

    api_key = options[:api_key]
    version_number = options[:version]

    Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.create(**api_key)

    app = Spaceship::ConnectAPI::App.find(APP_IDENTIFIER)
    UI.user_error!("Could not find app for #{APP_IDENTIFIER}") if app.nil?

    filter = {
      "state" => "PROCESSING,FAILED,COMPLETE",
      "cfBundleShortVersionString" => version_number,
      "platform" => Spaceship::ConnectAPI::Platform.map("ios")
    }

    build = Spaceship::ConnectAPI.get_build_uploads(
      app_id: app.id,
      filter: filter,
      sort: "-uploadedDate",
      limit: 1
    ).first

    next 0 if build.nil?

    next build.cf_build_version.to_i
  end

fastlane/Fastfile (46-110)

medium

Ruby에서는 변수명으로 스네이크 케이스(snake_case)를 사용하는 것이 일반적인 컨벤션입니다. versionNumber, latestTestflightBuildNumber, provisioningProfileSpecifier와 같은 변수명을 스네이크 케이스로 변경하여 코드 스타일의 일관성을 높이는 것을 제안합니다.

  private_lane :build_for_store do
    if ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"].to_s.strip.empty?
      ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "30"
    end

    if ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"].to_s.strip.empty?
      ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"] = "5"
    end

    api_key = asc_api_key

    version_number = get_version_number(
      xcodeproj: XCODE_PROJ,
      target: TARGET_NAME
    )

    latest_testflight_build_number = fetch_latest_testflight_build_number(
      api_key: api_key,
      version: version_number
    )

    setup_ci if ENV["CI"]

    increment_build_number(
      xcodeproj: XCODE_PROJ,
      build_number: latest_testflight_build_number + 1
    )

    match(
      api_key: api_key,
      type: "development",
      readonly: ENV["CI"] == "true"
    )

    match(
      api_key: api_key,
      type: "appstore",
      readonly: ENV["CI"] == "true"
    )

    if ENV["CI"] == "true"
      provisioning_profile_specifier = lane_context[SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING][APP_IDENTIFIER].to_s
      UI.user_error!("Missing App Store provisioning profile mapping for #{APP_IDENTIFIER}") if provisioning_profile_specifier.empty?

      update_code_signing_settings(
        use_automatic_signing: false,
        path: XCODE_PROJ,
        sdk: "iphoneos*",
        team_id: ENV["APP_STORE_TEAM_ID"],
        targets: [TARGET_NAME],
        build_configurations: ["Release"],
        code_sign_identity: "Apple Distribution",
        profile_name: provisioning_profile_specifier
      )
    end

    build_app(
      project: XCODE_PROJ,
      scheme: TARGET_NAME,
      export_method: "app-store",
      xcargs: "-skipPackagePluginValidation"
    )

    next api_key
  end

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant