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

Cocoapods support for audit #196

Open
wants to merge 69 commits into
base: dev
Choose a base branch
from

Conversation

barv-jfrog
Copy link
Contributor

@barv-jfrog barv-jfrog commented Sep 30, 2024

  • 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.
  • All changes are detailed at the description. if not already covered at JFrog Documentation, new documentation have been added.

Description:
jf audit for cocoapods package manager


Depends on:
jfrog/jfrog-cli-core#1274


audit example on nanopb package in a cocoapods project:
image


Minimum pod version - 1.15.2

@attiasas attiasas self-requested a review October 13, 2024 09:33
@attiasas attiasas added the new feature Automatically generated release notes label Oct 13, 2024
@attiasas attiasas changed the title Cocoapods audit Cocoapods support for audit Oct 13, 2024
Copy link
Contributor

@attiasas attiasas left a comment

Choose a reason for hiding this comment

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

Nice, take a look at my comments:

  1. Add integration tests to artifactory_test.go
  2. Add integraion tests to audit_test.go
  3. Add screen shot of the table results running on a cocoapods project to the PR details

Java CodeLanguage = "java"
CSharp CodeLanguage = "C#"
CPP CodeLanguage = "C++"
CocoapodsLang CodeLanguage = "any"
Copy link
Contributor

Choose a reason for hiding this comment

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

why its any? is it not used for objective C / swift languages?
Is there a Cocoapods Lang that is used in the files?

Copy link
Contributor

Choose a reason for hiding this comment

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

Cocoapods actually houses packages built with many languages, not just ObjC / Swift

Copy link
Contributor

Choose a reason for hiding this comment

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

please add this as a comment above.
Change the name of the const to Any / Multiple

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this? why is missing-context related to this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Will be removed from PR

}

func GetDependenciesData(exePath, currentDir string) (string, error) {
_, _, err := cocoapods.RunPodCmd(exePath, currentDir, []string{"install"})
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have to install everytime? what if the user already have Podfile.lock?

Copy link
Contributor

Choose a reason for hiding this comment

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

Will add a test to skip installation if Podfile.lock exists and has newer ModTime than Podfile

commands/audit/sca/cocoapods/cocoapods.go Show resolved Hide resolved
commands/audit/sca/cocoapods/cocoapods_test.go Outdated Show resolved Hide resolved
commands/audit/sca/cocoapods/cocoapods_test.go Outdated Show resolved Hide resolved
commands/audit/sca/cocoapods/cocoapods.go Outdated Show resolved Hide resolved
commands/audit/sca/cocoapods/cocoapods.go Outdated Show resolved Hide resolved
commands/audit/sca/cocoapods/cocoapods.go Show resolved Hide resolved
@srmish-jfrog srmish-jfrog mentioned this pull request Nov 2, 2024
6 tasks
@barv-jfrog barv-jfrog added the safe to test Approve running integration tests on a pull request label Nov 12, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 12, 2024
Copy link

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/jfrog/jfrog-cli-security 0.00% (ø)
github.com/jfrog/jfrog-cli-security/commands/audit 0.00% (ø)
github.com/jfrog/jfrog-cli-security/commands/audit/sca/cocoapods 0.00% (ø)
github.com/jfrog/jfrog-cli-security/tests 0.00% (ø)
github.com/jfrog/jfrog-cli-security/tests/utils/integration 0.00% (ø)
github.com/jfrog/jfrog-cli-security/utils/techutils 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/jfrog/jfrog-cli-security/commands/audit/sca/cocoapods/cocoapods.go 0.00% (ø) 0 0 0
github.com/jfrog/jfrog-cli-security/commands/audit/sca/cocoapods/podcommand.go 0.00% (ø) 0 0 0
github.com/jfrog/jfrog-cli-security/commands/audit/scarunner.go 0.00% (ø) 0 0 0
github.com/jfrog/jfrog-cli-security/tests/config.go 0.00% (ø) 0 0 0
github.com/jfrog/jfrog-cli-security/tests/consts.go 0.00% (ø) 0 0 0
github.com/jfrog/jfrog-cli-security/tests/utils/integration/test_integrationutils.go 0.00% (ø) 0 0 0
github.com/jfrog/jfrog-cli-security/utils/techutils/techutils.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/jfrog/jfrog-cli-security/artifactory_test.go
  • github.com/jfrog/jfrog-cli-security/audit_test.go
  • github.com/jfrog/jfrog-cli-security/commands/audit/sca/cocoapods/cocoapods_test.go

@barv-jfrog barv-jfrog added the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@barv-jfrog barv-jfrog added the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@barv-jfrog barv-jfrog added the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@barv-jfrog barv-jfrog added the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@barv-jfrog barv-jfrog added the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 13, 2024
@barv-jfrog barv-jfrog added the safe to test Approve running integration tests on a pull request label Nov 14, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 14, 2024
@barv-jfrog barv-jfrog added the safe to test Approve running integration tests on a pull request label Nov 14, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Automatically generated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants