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

chore: Update release candidate #5185

Merged
merged 59 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d9f0491
chore(ci): switch to small go image (#5099)
thisislawatts Mar 11, 2024
1981628
test: explicitly state project version (#5108)
thisislawatts Mar 12, 2024
f7eb5b4
chore: introduce script to help create release (#5107)
thisislawatts Mar 12, 2024
aaa1074
chore(ci): experiments in parallelism (#5097)
thisislawatts Mar 12, 2024
0cb4c26
chore: enforce pr title formatting (#5111)
thisislawatts Mar 12, 2024
bd6351a
fix: fix add support for dev/alpha/beta/rc python versions (#5106)
MarcusArdelean Mar 13, 2024
ade5860
docs: synchronizing help from snyk/user-docs (#5063)
github-actions[bot] Mar 13, 2024
93b4fcb
fix(ci): End to end test by updating to a newer test image (#5115)
PeterSchafer Mar 13, 2024
9445c90
docs: synchronizing README from GitBook (#5114)
github-actions[bot] Mar 13, 2024
1ef091f
feat: support -dverbose argument when testing maven projects #5117
anthogez Mar 14, 2024
2b37539
chore: disable readme sync workflow schedule (#5120)
mikeromard Mar 15, 2024
c903102
chore(ci): add script to install dev tools on macos (#5059)
PeterSchafer Mar 18, 2024
c9cc908
feat: feat: include new snyk code ignores fakes [IDE-172] (#5100)
teodora-sandu Mar 18, 2024
cd8eb6c
chore: introduce script to create release (#5116)
j-luong Mar 19, 2024
74c864e
chore: publish build image to snyklabs (#5122)
cmars Mar 20, 2024
57fac5c
chore(deps): upgrade slack webhook (#5124)
thisislawatts Mar 20, 2024
9419e14
chore: add go entry point for `snyk code test` (#5121)
thisislawatts Mar 21, 2024
c0d401c
fix: Fix handling of large json data when writing to file via --json …
j-luong Mar 22, 2024
c55af61
fix(ci): add missing node types (#5129)
PeterSchafer Mar 22, 2024
b22b166
feat: support CycloneDX v1.5 (#5123)
dekelund Mar 25, 2024
7c25fdb
chore: support feature flags for snyk code test (#5134)
PeterSchafer Mar 25, 2024
6aca5db
docs: synchronizing help from snyk/user-docs (#5135)
github-actions[bot] Mar 25, 2024
eee1ec5
fix: Fix error in sbom command when using --json-file-output (#5136)
PeterSchafer Mar 25, 2024
a4b4dbb
chore(ci): introduce caching around npm install step (#5110)
thisislawatts Mar 26, 2024
3607eb3
test: refactor to introduce helper to determine port (#5137)
thisislawatts Mar 26, 2024
8438281
chore(deps): upgrade jest to latest (#5112)
thisislawatts Mar 28, 2024
1b5266d
test: migrate code tests to acceptance (#5139)
thisislawatts Mar 28, 2024
2011b90
fix: enhance sbt output width, fixing false positives vulns (#5130)
37IulianPopovici Mar 29, 2024
3711b70
docs: synchronizing help from snyk/user-docs (#5144)
github-actions[bot] Mar 29, 2024
e3925cc
chore: ignore tap files when formatting (#5143)
thisislawatts Apr 2, 2024
e06a383
chore: update ignores and security scans workflow for CICD (#5066)
bikochan Apr 3, 2024
84b5e8b
fix: avoid potentially outputting very large JSON objects (#5147)
j-luong Apr 3, 2024
f645bbe
fix: always finish progress when auto-fixing in language server (#5145)
bastiandoetsch Apr 3, 2024
6b96473
fix: upgrade iac custom rules extension to address vulns [IAC-2921] (…
andreeaneata Apr 4, 2024
0fd8fa6
feat: upgrade snyk-iac-test to v0.51.3 (#5127)
jaspervdj-snyk Apr 4, 2024
08647f2
fix: add --experimental flag for snyk code test (#5151)
thisislawatts Apr 8, 2024
1e51948
fix: make download of CLI in language server more resilient under win…
bastiandoetsch Apr 9, 2024
fc41937
feat: bump language server protocol version to 11 [IDE-236] (#5156)
bastiandoetsch Apr 9, 2024
43c9acf
docs: mention how to test against a binary (#5158)
PeterSchafer Apr 12, 2024
b55fbc8
chore: ignore go sum (#5160)
thisislawatts Apr 15, 2024
5fc3d59
fix(iac): Fix Issue Path in human readable and json output [IAC-2935]…
andreeaneata Apr 15, 2024
efb0488
test: install pip deps during setup (#5162)
thisislawatts Apr 15, 2024
51c717b
feat: use workflow data to determine exit code errors
thisislawatts Apr 15, 2024
05cb9f5
fix(ls): Trigger re-analysis after fixing interfile issues (#5163)
bastiandoetsch Apr 16, 2024
5bd898e
feat(code): Integrate experimental go native code client [CLI-224] (#…
PeterSchafer Apr 16, 2024
a8be764
feat: include additional policy properties, when provided, in plain t…
thisislawatts Apr 16, 2024
86484c9
test: validate applied policy rules in json output (#5167)
j-luong Apr 16, 2024
5400c69
fix(code): Fix error handling for experimental go native code client …
PeterSchafer Apr 16, 2024
7c88a44
chore: extend commit pattern to allow more complex scope (#5171)
PeterSchafer Apr 17, 2024
34bbc95
feat(code): introduce human readable formatting for experimental test…
thisislawatts Apr 17, 2024
216af9c
chore(ci): increase timeouts to reduce flakiness (#5175)
PeterSchafer Apr 18, 2024
ed2e754
feat: snyk woof ro language support and tests (#5166)
mgyorke Apr 18, 2024
ea6293b
feat(sbom): Introduce experimental sbom test command (#5176)
paulrosca-snyk Apr 18, 2024
77d8bfe
docs: synchronizing help from snyk/user-docs (#5179)
github-actions[bot] Apr 18, 2024
dcce4d4
chore(ci): Enable preview and stable deployments (#5178)
PeterSchafer Apr 19, 2024
e54b227
fix(ci): Adapt script to work on different environments (#5182)
PeterSchafer Apr 19, 2024
f18cbce
feat(ci): First release on stable channel (#5183)
PeterSchafer Apr 19, 2024
9d12572
chore: merge main into release-candidate Fri Apr 19 18:03:04 CEST 2024
PeterSchafer Apr 19, 2024
c03cc64
docs: update release notes
PeterSchafer Apr 19, 2024
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
101 changes: 84 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,28 @@ executors:
alpine:
docker:
- image: alpine:3.17
resource_class: xlarge
generic-ubuntu:
docker:
- image: ubuntu:latest
resource_class: small
circle-go:
docker:
- image: cimg/go:1.20
resource_class: medium+
docker-amd64:
docker:
- image: bastiandoetsch209/cli-build:20240214-145818
- image: snyklabs/cli-build:20240319-123447
working_directory: /mnt/ramdisk/snyk
resource_class: large
docker-amd64-xl:
docker:
- image: bastiandoetsch209/cli-build:20240214-145818
working_directory: /mnt/ramdisk/snyk
resource_class: xlarge
docker-arm64:
docker:
- image: bastiandoetsch209/cli-build-arm64:20240214-145818
- image: snyklabs/cli-build-arm64:20240319-123447
working_directory: /mnt/ramdisk/snyk
resource_class: arm.large
linux-ubuntu-mantic-amd64:
Expand Down Expand Up @@ -107,7 +117,7 @@ executors:
shell: powershell
cbl-mariner:
docker:
- image: mcr.microsoft.com/cbl-mariner/base/python:3.9.14-6-cm2.0.20230805-arm64
- image: mcr.microsoft.com/cbl-mariner/base/python:3.9.14-8-cm2.0.20240301-arm64
resource_class: arm.medium

commands:
Expand Down Expand Up @@ -377,6 +387,10 @@ workflows:
- secrets-scan

- code-analysis:
go_target_os: linux
go_os: linux
go_arch: amd64
go_download_base_url: << pipeline.parameters.go_download_base_url >>
context: devex_cli
requires:
- prepare-build
Expand All @@ -395,11 +409,15 @@ workflows:
ignore: main

- test-go:
go_target_os: linux
go_os: linux
go_arch: amd64
go_download_base_url: << pipeline.parameters.go_download_base_url >>
context:
- nodejs-install
- team_hammerhead-cli
requires:
- prepare-build
- secrets-scan
filters:
branches:
ignore: main
Expand Down Expand Up @@ -508,7 +526,7 @@ workflows:
ignore: main
requires:
- build linux amd64
executor: docker-amd64
executor: docker-amd64-xl
test_snyk_command: ./binary-releases/snyk-linux

- acceptance-tests:
Expand Down Expand Up @@ -581,6 +599,7 @@ workflows:
test_snyk_command: binary-releases\\snyk-win.exe
install_deps_extension: windows-full
dont_skip_tests: 0
shards: 4
pre_test_cmds: Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1; RefreshEnv

- sign:
Expand Down Expand Up @@ -850,9 +869,19 @@ jobs:
executor: docker-amd64
steps:
- checkout
- restore_cache:
name: Restore npm cache
keys:
- prepare-build-npm-deps-{{ checksum "package-lock.json" }}
- prepare-build-npm-deps
- run:
name: Installing dependencies
command: npm ci
command: npm ci --no-audit --no-progress --cache .npm --prefer-offline
- save_cache:
name: Save npm cache
key: prepare-build-npm-deps-{{ checksum "package-lock.json" }}
paths:
- .npm
- run:
name: Set version
command: |
Expand All @@ -878,25 +907,40 @@ jobs:
- packages/*

code-analysis:
parameters:
go_os:
type: string
go_target_os:
type: string
go_arch:
type: string
go_download_base_url:
type: string
install_path:
type: string
default: '/tmp'
executor: docker-amd64
steps:
- prepare-workspace
- install-go:
go_os: << parameters.go_os >>
go_target_os: << parameters.go_target_os >>
go_arch: << parameters.go_arch >>
base_url: << parameters.go_download_base_url >>
extraction_path: << parameters.install_path >>
- run:
name: Linting project
command: |
npm run lint
pushd cliv2
make lint
export CGO_ENABLED=1
make lint
popd
- snyk/scan:
fail-on-issues: true
severity-threshold: critical
additional-arguments: --all-projects --exclude=test,dist
- snyk/scan:
command: code test
fail-on-issues: true
monitor-on-build: true
severity-threshold: high
- prodsec/security_scans:
mode: auto
open-source-additional-arguments: --exclude=test,dist
iac-scan: disabled
release-branch: main

test-node:
executor: docker-amd64
Expand All @@ -912,8 +956,26 @@ jobs:

test-go:
executor: docker-amd64
parameters:
go_os:
type: string
go_target_os:
type: string
go_arch:
type: string
go_download_base_url:
type: string
install_path:
type: string
default: '.'
steps:
- prepare-workspace
- install-go:
go_os: << parameters.go_os >>
go_target_os: << parameters.go_target_os >>
go_arch: << parameters.go_arch >>
base_url: << parameters.go_download_base_url >>
extraction_path: << parameters.install_path >>
- run:
name: Running Go unit tests
working_directory: ./cliv2
Expand Down Expand Up @@ -1024,7 +1086,11 @@ jobs:
pre_test_cmds:
type: string
default: 'echo Running tests'
shards:
type: integer
default: 3
executor: << parameters.executor >>
parallelism: << parameters.shards >>
steps:
- prepare-workspace
- install-deps-<< parameters.install_deps_extension >>
Expand All @@ -1035,12 +1101,13 @@ jobs:
no_output_timeout: 30m
command: |
<< parameters.pre_test_cmds >>
npm run test:acceptance -- --selectProjects coreCli
npm run test:acceptance -- --selectProjects coreCli --shard=$(expr $CIRCLE_NODE_INDEX + 1)/<< parameters.shards >>
environment:
TEST_SNYK_FIPS: << parameters.fips >>
TEST_SNYK_COMMAND: << parameters.test_snyk_command >>
TEST_SNYK_DONT_SKIP_ANYTHING: << parameters.dont_skip_tests >>
JEST_JUNIT_OUTPUT_DIR: test/reports
NODE_OPTIONS: --max-old-space-size=4096
- store_test_results:
path: test/reports
- store_artifacts:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/create-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
- uses: docker/setup-buildx-action@v2
- name: Build Docker image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_CLI_BUILD_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_CLI_BUILD_PASSWORD }}
DOCKER_REPO: snyklabs
DOCKER_BUILDKIT: 1
run: scripts/create-build-image.sh
3 changes: 2 additions & 1 deletion .github/workflows/danger-zone.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: 'Danger Zone'
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches: [master, main]

jobs:
Expand All @@ -11,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.16.0'
node-version: '18.19.1'
cache: 'npm'
- run: npm ci
- run: npx danger ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iac-cli-alert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.16.0'
node-version: '18.19.1'
cache: 'npm'
- run: npm ci
- run: npm start
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/synchronize-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Synchronize Readme

on:
workflow_dispatch:
schedule:
- cron: '0 12 * * 1-5' # Mon-Fri at 12
#schedule:
# - cron: '0 12 * * 1-5' # Mon-Fri at 12

jobs:
build:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ tap-output
# Jest
coverage
test/fixtures/basic-swift/.build
test/fixtures/basic-swift/Package.resolved
test/fixtures/basic-swift/Package.resolved
scripts/Brewfile.lock.json
test/fixtures/**/go.sum
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test-output
test-results
test/**/workspaces
.iac-data

.tap
src/cli/commands/test/iac/local-execution/parsers/hcl-to-json/parser.js
src/cli/commands/test/iac/local-execution/parsers/hcl-to-json-v2/parser.js

Expand Down
19 changes: 9 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,11 @@

## Prerequisites

You will need the following software installed:

- Git
- Node.js (and bundled npm)
- Use whichever version is in [`.nvmrc`](./.nvmrc).

Open a terminal and make sure they are available.
To install the required development dependencies in homebrew based environments, execute the following script from the root directory.
The only additional prerequisite is having [homebrew](https://brew.sh/) installed.

```sh
git --version
node --version
npm --version
./scripts/install-dev-dependencies.sh
```

## Setting up
Expand Down Expand Up @@ -62,6 +55,12 @@ You can run tests using standard Jest commands. See: [Jest CLI docs](https://jes
npx jest --runInBand <path>
```

For closed box tests (like User Journey tests, acceptance tests, ...) you will have to specify the binary under test by setting the environment variable **TEST_SNYK_COMMAND**.

```
TEST_SNYK_COMMAND=./binary-releases/snyk-macos npx jest --runInBand <path>
```

If you are working on a specific project, you can filter by project.

```
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ $(BINARY_OUTPUT_FOLDER)/release.json:
$(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md: prepack | $(BINARY_RELEASES_FOLDER_TS_CLI)
npx conventional-changelog-cli -p angular -l -r 1 > $(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md

# if the releease notes are generated locally, the version contains something like X.Y.Z-dev.hash
# the replacement below ensures that the version in the RELEASE_NOTES.md is X.Y.Z
sed -i -e "s/$(shell cat $(BINARY_OUTPUT_FOLDER)/version)/$(shell npx semver --coerce $(shell cat $(BINARY_OUTPUT_FOLDER)/version))/g" $(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md

# Generates a shasum of a target with the same name.
# See "Automatic Variables" in GNU Make docs (linked at the top)
%.sha256:
Expand Down Expand Up @@ -263,6 +267,16 @@ release-pre:
@echo "-- Publishing to S3 /version"
@./release-scripts/upload-artifacts.sh version

.PHONY: release-mgt-prepare
release-mgt-prepare:
@echo "-- Preparing release"
@./release-scripts/prepare-release.sh

.PHONY: release-mgt-create
release-mgt-create:
@echo "-- Creating stable release"
@./release-scripts/create-release.sh

.PHONY: format
format:
@echo "-- Formatting code"
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ The **Snyk CLI brings the functionality of Snyk into your development workflow**

<figure><img src="https://github.com/snyk/user-docs/raw/HEAD/docs/.gitbook/assets/snyk-cli-screenshot.png" alt="Snyk CLI test command output example"><figcaption><p>Snyk CLI test command output</p></figcaption></figure>

Snyk CLI scanning **supports many languages and tools.** For detailed information, see the [summary of supported environments](https://docs.snyk.io/getting-started/introducing-snyk#how-can-snyk-work-in-my-environment).
Snyk CLI scanning **supports many languages and tools.** For detailed information, see the following:

- [Supported languages and frameworks for Open Source and Code](https://docs.snyk.io/getting-started/supported-languages-frameworks-and-feature-availability-overview)
- [Supported operating system distributions for Container](https://docs.snyk.io/scan-with-snyk/snyk-container/how-snyk-container-works/supported-operating-system-distributions)
- [Supported IaC Lanuages and cloud providers](https://docs.snyk.io/scan-with-snyk/snyk-iac/supported-iac-languages-cloud-providers-and-cloud-resources)

This page explains how to install, authenticate, and start scanning using the CLI. Snyk also has an onboarding wizard to guide you through these steps. For a demonstration, view [Starting with Snyk: an overview of the CLI onboarding flow](https://www.youtube.com/watch?v=adj3VF82-v8).

Expand All @@ -37,7 +41,7 @@ Look at the `test` command **report** in your terminal. The report shows the vul

## Scan your development Project

**Note:** Before using the Snyk CLI to test your Open Source Project for vulnerabilities, with limited exceptions, you must **build your Project**. For details, see [Which Projects must be built before testing with CLI?](https://support.snyk.io/hc/en-us/articles/360015552617-Which-projects-must-be-built-before-testing-with-CLI-)
**Note:** Before using the Snyk CLI to test your Open Source Project for vulnerabilities, with limited exceptions, you must **build your Project**. For details, see [Open Source Projects that must be built before testing](https://docs.snyk.io/snyk-cli/scan-and-maintain-projects-using-the-cli/snyk-cli-for-open-source/open-source-projects-that-must-be-built-before-testing-with-the-snyk-cli).

In addition, depending on the language of your open-source Project, you may need to **set up your language environment** before using the Snyk CLI. For details, refer to [Supported languages, frameworks, and feature availability overview.](https://docs.snyk.io/scan-using-snyk/supported-languages-and-frameworks/supported-languages-frameworks-and-feature-availability-overview)

Expand Down Expand Up @@ -115,6 +119,10 @@ For detailed information about the CLI, see the [CLI docs](https://docs.snyk.io/

The Snyk CLI project is open-source, but Snyk does not encourage outside contributors.

You may look into [design decisions for the Snyk CLI](https://github.com/snyk/snyk/blob/master/help/_about-this-project/README.md).

The Snyk CLI repository is a monorepo that also covers other projects and tools, such as [@snyk/protect](https://github.com/snyk/snyk/tree/master/packages/snyk-protect), also available at [npm package for snyk-protect command](https://www.npmjs.com/package/@snyk/protect).

## Security

For any security issues or concerns, see the [SECURITY.md](https://github.com/snyk/snyk/blob/main/SECURITY.md) file in the GitHub repository.
For any security issues or concerns, see the [SECURITY.md](https://github.com/snyk/snyk/blob/master/SECURITY.md) file in the GitHub repository.
9 changes: 9 additions & 0 deletions binary-releases/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [1.1291.0](https://github.com/snyk/snyk/compare/v1.1290.0...v1.1291.0) (2024-04-19)

### Bug Fixes

- **ci:** Adapt script to work on different environments ([#5182](https://github.com/snyk/snyk/issues/5182)) ([e54b227](https://github.com/snyk/snyk/commit/e54b227a4a05de78d3a210f099da93693f77fdc4))

### Features

- **ci:** First release on stable channel ([#5183](https://github.com/snyk/snyk/issues/5183)) ([f18cbce](https://github.com/snyk/snyk/commit/f18cbcec7466b4ea1de9632fa2cef1aa68ff5f4b))
1 change: 1 addition & 0 deletions check-dependencies.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const config: Options = {
'conventional-changelog-cli', // used for generating release notes
'ts-node', // used for various scripts to avoid separate compile step
'jest-junit', // used for CI test reporting
'@types/node', // node types used for alerts
],
ignoreDirs: ['node_modules', 'dist', 'fixtures', 'test-output'],
};
Loading