Skip to content

Auto install Cocoapods when Podfile.lock not exist#723

Open
attiasas wants to merge 10 commits intojfrog:devfrom
attiasas:fix_cocoapods_auto_install
Open

Auto install Cocoapods when Podfile.lock not exist#723
attiasas wants to merge 10 commits intojfrog:devfrom
attiasas:fix_cocoapods_auto_install

Conversation

@attiasas
Copy link
Copy Markdown
Collaborator

@attiasas attiasas commented Apr 12, 2026

  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....
  • All static analysis checks passed.
  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • Updated the Contributing page / ReadMe page / CI Workflow files if needed.
  • All changes are detailed at the description. if not already covered at JFrog Documentation, new documentation have been added.

fix(cocoapods): auto-install when Podfile.lock is missing

Summary
CocoaPods BOM / dependency-tree generation now detects a missing Podfile.lock and runs pod install (unless SkipAutoInstall is enabled), so audits can proceed without a pre-generated lockfile. CocoaPods test fixtures are reorganized under cocoapods-project, and a new cocoapods-no-lock-file sample project supports integration coverage. The hidden skip-auto-install flag documentation is generalized to reflect support beyond Yarn/NPM only.

Changes

  • sca/bom/buildinfo/technologies/cocoapods: After resolving the pod executable, if Podfile.lock is absent and auto-install is allowed, run pod install; if auto-install is skipped, return a clear error. Introduce descriptorFileName / lockFileName constants; split getPodExecPath from getPodVersionAndExecPath and improve version-check error wrapping (podcommand.go, cocoapods.go).
  • cli/docs/flags.go: Widen SkipAutoInstall help text to “some package managers.”
  • Tests / fixtures: Move existing Podfile / Podfile.lock under tests/testdata/.../cocoapods/cocoapods-project; add cocoapods-no-lock-file fixture (Podfile + minimal Xcode workspace files). Point unit tests at the new path (cocoapods_test.go). Add TestXrayAuditCocoapodsNoLockFile and parameterize testXrayAuditCocoapods by project name (audit_test.go).
  • git_test.go: Adjust expected violation applicability / scan counts in two JAS-related git audit tests.

Testing

  • TestXrayAuditCocoapods / TestXrayAuditCocoapodsNoLockFile (latter skipped on Windows in code), and full go test ./... / CI as usual.

Notes

  • Auto-install assumes a working pod on PATH and a suitable host toolchain (the new audit test skips on Windows for that reason). SkipAutoInstall preserves the previous strict behavior when no lockfile exists.
  • git_test.go expectation changes are included in this branch; confirm they match the intended Xray/JAS baseline for your environment if those tests are sensitive to server or graph versions.

@attiasas attiasas requested a review from a team April 12, 2026 07:01
@attiasas attiasas added the bug Something isn't working label Apr 12, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 12, 2026
@attiasas attiasas added the safe to test Approve running integration tests on a pull request label Apr 13, 2026
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 13, 2026
@github-actions
Copy link
Copy Markdown

👍 Frogbot scanned this pull request and did not find any new security issues.


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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant