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

Adding Xray Source Control Service #2141

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
24d903d
Promoted version to 2.43.0
omerzi Jul 12, 2023
e9cb8b6
Merge branch 'dev' into v2
eyalbe4 Jul 12, 2023
12e17bc
Resove conflicts
eyalbe4 Jul 12, 2023
52da62e
Merge remote-tracking branch 'origin/dev' into v2
omerzi Jul 19, 2023
445071d
Merge remote-tracking branch 'origin/dev' into v2
omerzi Jul 23, 2023
2f56ca8
Merge branch 'dev' into v2
eyalbe4 Jul 24, 2023
1bfa0c1
Merge branch 'dev' into v2
eyalbe4 Jul 31, 2023
b958e74
Merge branch 'dev' into v2
eyalbe4 Aug 3, 2023
f89c9d4
Refactor to interface
EyalDelarea Aug 15, 2023
91e9bff
Split scan service
EyalDelarea Aug 15, 2023
b1ef9b6
Working XSC call
EyalDelarea Aug 16, 2023
65cca65
Merge branch 'dev' of https://github.com/jfrog/jfrog-cli into xsc
EyalDelarea Aug 17, 2023
718c0c2
update go.mod
EyalDelarea Aug 17, 2023
feaf222
Handle XSC/XRAY url provided from flags and config.
EyalDelarea Aug 17, 2023
52cec1e
update go.mod
EyalDelarea Aug 17, 2023
ffbaad3
Refactor
EyalDelarea Aug 17, 2023
a14747e
update deps
EyalDelarea Aug 20, 2023
43410a0
fix gosec
EyalDelarea Aug 21, 2023
c32e160
Update deps
EyalDelarea Aug 21, 2023
a935feb
update deps
EyalDelarea Aug 21, 2023
afa7a25
update dependencies
EyalDelarea Aug 22, 2023
47c759e
Pull dev
EyalDelarea Aug 22, 2023
66009e0
update deps
EyalDelarea Aug 23, 2023
e4ca999
Merge remote-tracking branch 'upstream/dev' into xsc
EyalDelarea Aug 24, 2023
cb85c8f
Add XSC tests
EyalDelarea Aug 24, 2023
0322ea3
trigget test
EyalDelarea Aug 24, 2023
084c270
fix test
EyalDelarea Aug 24, 2023
becb901
turn off and on xray test
EyalDelarea Aug 24, 2023
71d50b8
trigget test
EyalDelarea Aug 24, 2023
2a82b3a
Change test
EyalDelarea Aug 24, 2023
2876765
pull dev
EyalDelarea Aug 28, 2023
b5b80ae
pull dev
EyalDelarea Aug 29, 2023
8d06953
fix merge
EyalDelarea Aug 29, 2023
698e026
update deps
EyalDelarea Aug 29, 2023
0ec3b49
update deps
EyalDelarea Aug 29, 2023
321efb1
Update deps
EyalDelarea Aug 30, 2023
fdfc3a9
pull dev
EyalDelarea Aug 31, 2023
34e89bb
update deps
EyalDelarea Aug 31, 2023
5915ee0
merge dev
EyalDelarea Sep 3, 2023
2bdbdb8
Update deps
EyalDelarea Sep 3, 2023
63276fc
pull dev
EyalDelarea Sep 4, 2023
4bba9e1
Update deps
EyalDelarea Sep 4, 2023
7e559ff
pull dev
EyalDelarea Sep 5, 2023
a064ee4
update deps
EyalDelarea Sep 6, 2023
8a6b7ad
update deps
EyalDelarea Sep 6, 2023
f4825ba
update deps
EyalDelarea Sep 7, 2023
ab18d79
update deps
EyalDelarea Sep 8, 2023
2dad973
update deps
EyalDelarea Sep 8, 2023
f92fb12
CR
EyalDelarea Sep 10, 2023
cd5eb94
change to new xsc
EyalDelarea Sep 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/xrayTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
suite: [ xray, xsc ]
os: [ ubuntu, windows, macos ]
runs-on: ${{ matrix.os }}-latest
env:
Expand Down Expand Up @@ -65,7 +66,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Run Xray tests (without Docker Scan)
run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.xray --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --test.containerRegistry=${{ secrets.CONTAINER_REGISTRY }}
run: go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.${{matrix.suite}} --jfrog.url=${{ secrets.PLATFORM_URL }} --jfrog.adminToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --jfrog.user=${{ secrets.PLATFORM_USER }} --test.containerRegistry=${{ secrets.CONTAINER_REGISTRY }}
if: ${{ matrix.os != 'ubuntu' }}

- name: Run Xray tests (with Docker Scan, only on Ubuntu)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ The available test types are:
| `-test.distribution` | Distribution tests |
| `-test.transfer` | Transfer tests |
| `-test.xray` | Xray tests |
| `-test.xsc` | Xsc tests |

When running the tests, builds and repositories with timestamps will be created, for example: `cli-rt1-1592990748` and `cli-rt2-1592990748`. The content of these repositories will be deleted once the tests are completed.

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ require (

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230828134416-f0db33dd9344

replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230907095444-fd00f19be95d
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/eyaldelarea/jfrog-cli-core/v2 v2.0.0-20230910120756-f1d0181a0403

// replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.2.6-0.20230418122323-2bf299dd6d27

replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20230906115540-2c3c91d271d6
replace github.com/jfrog/jfrog-client-go => github.com/eyaldelarea/jfrog-client-go v1.28.1-0.20230910120113-823b4c7b06b7

replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20230905120411-62d1bdd4eb38
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/eyaldelarea/jfrog-cli-core/v2 v2.0.0-20230910120756-f1d0181a0403 h1:A7QvUrYpcqNmXpqGvZIwCet2u0C4VmMsqOW1aw0/K7g=
github.com/eyaldelarea/jfrog-cli-core/v2 v2.0.0-20230910120756-f1d0181a0403/go.mod h1:D5BnCwgET5TWtmyPYgfoUhShN9egbpfdSSP1cqvS99M=
github.com/eyaldelarea/jfrog-client-go v1.28.1-0.20230910120113-823b4c7b06b7 h1:g97j04e90zFXJMabA8RmccWbEXxDwKpQ+afBeainJmg=
github.com/eyaldelarea/jfrog-client-go v1.28.1-0.20230910120113-823b4c7b06b7/go.mod h1:soD5VL3X+G+0KKUNSlb0CSdF9nwHsQZCr0xqOGedAHM=
github.com/forPelevin/gomoji v1.1.8 h1:JElzDdt0TyiUlecy6PfITDL6eGvIaxqYH1V52zrd0qQ=
github.com/forPelevin/gomoji v1.1.8/go.mod h1:8+Z3KNGkdslmeGZBC3tCrwMrcPy5GRzAD+gL9NAwMXg=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
Expand Down Expand Up @@ -239,10 +243,6 @@ github.com/jfrog/build-info-go v1.8.9-0.20230905120411-62d1bdd4eb38 h1:XyAcwWP2a
github.com/jfrog/build-info-go v1.8.9-0.20230905120411-62d1bdd4eb38/go.mod h1:QEskae5fQpjeY2PBzsjWtUQVskYSNDF2sSmw/Gx44dQ=
github.com/jfrog/gofrog v1.3.0 h1:o4zgsBZE4QyDbz2M7D4K6fXPTBJht+8lE87mS9bw7Gk=
github.com/jfrog/gofrog v1.3.0/go.mod h1:IFMc+V/yf7rA5WZ74CSbXe+Lgf0iApEQLxRZVzKRUR0=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230907095444-fd00f19be95d h1:7Qlsj5PkqSfayuNaM07L8W+H0bBqEGd+iPusoJOU6w8=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230907095444-fd00f19be95d/go.mod h1:PCRqGSz6tKQNtiITSk9WZGflJjno/Vg4DvXPLkH6xO8=
github.com/jfrog/jfrog-client-go v1.28.1-0.20230906115540-2c3c91d271d6 h1:9mNCAUu/uHx80s4rMc9PeI1lllrZ1MOPUesIMglFoTY=
github.com/jfrog/jfrog-client-go v1.28.1-0.20230906115540-2c3c91d271d6/go.mod h1:soD5VL3X+G+0KKUNSlb0CSdF9nwHsQZCr0xqOGedAHM=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jszwec/csvutil v1.8.0 h1:G7vS2LGdpZZDH1HmHeNbxOaJ/ZnJlpwGFvOkTkJzzNk=
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func setupIntegrationTests() {
if *tests.TestPlugins {
InitPluginsTests()
}
if *tests.TestXray {
if *tests.TestXray || *tests.TestXsc {
InitXrayTests()
}
if *tests.TestAccess {
Expand Down
4 changes: 4 additions & 0 deletions utils/tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var (
TestPoetry *bool
TestPlugins *bool
TestXray *bool
TestXsc *bool
TestAccess *bool
TestTransfer *bool
TestLifecycle *bool
Expand Down Expand Up @@ -104,6 +105,7 @@ func init() {
TestPoetry = flag.Bool("test.poetry", false, "Test Poetry")
TestPlugins = flag.Bool("test.plugins", false, "Test Plugins")
TestXray = flag.Bool("test.xray", false, "Test Xray")
TestXsc = flag.Bool("test.xsc", false, "Test Xsc")
TestAccess = flag.Bool("test.access", false, "Test Access")
TestTransfer = flag.Bool("test.transfer", false, "Test files transfer")
TestLifecycle = flag.Bool("test.lifecycle", false, "Test lifecycle")
Expand Down Expand Up @@ -403,6 +405,7 @@ func GetNonVirtualRepositories() map[*string]string {
TestPoetry: {&PoetryRemoteRepo},
TestPlugins: {&RtRepo1},
TestXray: {},
TestXsc: {},
TestAccess: {&RtRepo1},
TestTransfer: {&RtRepo1, &RtRepo2, &MvnRepo1, &MvnRemoteRepo, &DockerRemoteRepo},
TestLifecycle: {&RtDevRepo, &RtProdRepo},
Expand All @@ -428,6 +431,7 @@ func GetVirtualRepositories() map[*string]string {
TestPoetry: {&PoetryVirtualRepo},
TestPlugins: {},
TestXray: {},
TestXsc: {},
TestAccess: {},
}
return getNeededRepositories(virtualReposMap)
Expand Down
5 changes: 5 additions & 0 deletions xray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,11 @@ func TestCurationAudit(t *testing.T) {
}
}

func TestXscAudit(t *testing.T) {
output := testXrayAuditNpm(t, string(utils.SimpleJson))
verifySimpleJsonScanResults(t, output, 1, 1)
}

func getCurationExpectedResponse(config *config.ServerDetails) []coreCuration.PackageStatus {
expectedResp := []coreCuration.PackageStatus{
{
Expand Down
Loading