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: merge release into main #5222

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
6cb942c
chore: Merge pull request #5185 from snyk/tmp/1713542475-release-cand…
PeterSchafer Apr 22, 2024
ab00867
fix(ci): add deployment steps to release branches
PeterSchafer Apr 22, 2024
a146b0f
chore: Merge pull request #5193 from snyk/fix/CLI-287_release_steps
PeterSchafer Apr 22, 2024
2e9b139
fix: support cyclic dependencies in maven with dverbose
MarcusArdelean Apr 25, 2024
8b3e37d
Merge pull request #5200 from snyk/hotfix/v1.1290.0-dverbose-cyclic-fix
MarcusArdelean Apr 29, 2024
101201f
chore: curate RELEASE_NOTES (#5209)
PeterSchafer Apr 29, 2024
d3be47f
chore: Merge branch 'release-candidate'
PeterSchafer May 6, 2024
fa9d512
fix(sbom): Fix container purl generation for apt and rpm (#5207)
paulrosca-snyk May 7, 2024
1fbad58
chore(logs): add extra debug logging for target info (#5229)
j-luong May 8, 2024
1e8b962
chore(ci): upgrade to newer windows runner (#5216)
PeterSchafer May 8, 2024
36e2460
feat: parse data from output workflow (#5226)
thisislawatts May 9, 2024
46769cc
feat: [OSM-1040] Added pnpm support under 'enablePnpmCli' feature fla…
gemaxim May 10, 2024
de20397
fix: remove dependency for release notes (#5221)
PeterSchafer May 10, 2024
f60ee97
fix(ci): allow Merge commits (#5227)
PeterSchafer May 10, 2024
bf99af2
docs: update release notes
PeterSchafer Apr 19, 2024
5910587
fix: support cyclic dependencies in maven with dverbose
MarcusArdelean Apr 25, 2024
9c1fc60
chore: curate RELEASE_NOTES (#5209)
PeterSchafer Apr 29, 2024
0c8f41f
Merge branch 'chore/test_update_main' of github.com:snyk/cli into cho…
PeterSchafer May 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ executors:
resource_class: macos.m1.medium.gen1
win-server2022-amd64:
machine:
image: windows-server-2022-gui:2023.07.1
image: windows-server-2022-gui:2024.01.1
resource_class: windows.large
shell: powershell
win-server2019-amd64:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ $(BINARY_OUTPUT_FOLDER)/release.json:
# We're using this to remove CLIv2 changes in v1's changelogs.
# :(exclude) syntax: https://git-scm.com/docs/gitglossary.html#Documentation/gitglossary.txt-exclude
# Release notes uses version from package.json so we need to prepack beforehand.
$(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md: prepack | $(BINARY_RELEASES_FOLDER_TS_CLI)
$(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md:
npx conventional-changelog-cli -l -r 1 -n ./release-scripts/conventional-changelog-cli-config.js > $(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md

$(BINARY_OUTPUT_FOLDER)/fips/RELEASE_NOTES.md: $(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md $(BINARY_OUTPUT_FOLDER)/fips
Expand Down
12 changes: 12 additions & 0 deletions binary-releases/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# [1.1291.0](https://github.com/snyk/snyk/compare/v1.1290.0...v1.1291.0) (2024-04-30)

The Snyk CLI is being deployed to different deployment channels, users can select the stability level according to their needs. For details please see [this documentation](https://docs.snyk.io/snyk-cli/releases-and-channels-for-the-snyk-cli)

### News

- This is the first **stable release** of the CLI
- It makes use of semantic versioning and is the successor of [1.1290.0](https://github.com/snyk/cli/releases/tag/v1.1290.0)

### Bug Fixes

- **test:** Fix support of cyclic dependencies in maven with dverbose [#5208](https://github.com/snyk/cli/pull/5208)
5 changes: 3 additions & 2 deletions cliv2/cmd/cliv2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ func runWorkflowAndProcessData(engine workflow.Engine, logger *zerolog.Logger, n
data, err := engine.Invoke(workflow.NewWorkflowIdentifier(name))

if err == nil {
_, err = engine.InvokeWithInput(localworkflows.WORKFLOWID_OUTPUT_WORKFLOW, data)
var output []workflow.Data
output, err = engine.InvokeWithInput(localworkflows.WORKFLOWID_OUTPUT_WORKFLOW, data)
if err == nil {
err = getErrorFromWorkFlowData(data)
err = getErrorFromWorkFlowData(output)
}
} else {
logger.Print("Failed to execute the command!", err)
Expand Down
51 changes: 32 additions & 19 deletions cliv2/cmd/cliv2/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,30 +278,42 @@ func Test_getErrorFromWorkFlowData(t *testing.T) {
})
}

func addEmptyWorkflows(t *testing.T, engine workflow.Engine, commandList []string) {
t.Helper()
for _, v := range commandList {
fn := func(invocation workflow.InvocationContext, input []workflow.Data) ([]workflow.Data, error) {
return []workflow.Data{}, nil
}

workflowConfig := workflow.ConfigurationOptionsFromFlagset(pflag.NewFlagSet("pla", pflag.ContinueOnError))
workflowId1 := workflow.NewWorkflowIdentifier(v)
_, err := engine.Register(workflowId1, workflowConfig, fn)
if err != nil {
t.Fatal(err)
}
}
}

func Test_runWorkflowAndProcessData(t *testing.T) {
defer cleanup()
globalConfiguration = configuration.New()
globalConfiguration.Set(configuration.DEBUG, true)
globalEngine = workflow.NewWorkFlowEngine(globalConfiguration)

testCmnd := "subcmd1"
addEmptyWorkflows(t, globalEngine, []string{"output"})
workflowId1 := workflow.NewWorkflowIdentifier("output")

outputFn := func(invocation workflow.InvocationContext, input []workflow.Data) ([]workflow.Data, error) {
summaryPayload, _ := json.Marshal(json_schemas.TestSummary{
Results: []json_schemas.TestSummaryResult{{
Severity: "critical",
Total: 99,
Open: 97,
Ignored: 2,
}, {
Severity: "medium",
Total: 99,
Open: 97,
Ignored: 2,
}},
Type: "sast",
})
data := workflow.NewData(workflow.NewTypeIdentifier(workflowId1, "workflowData"), content_type.TEST_SUMMARY, summaryPayload)
return []workflow.Data{
data,
}, nil
}

workflowConfig := workflow.ConfigurationOptionsFromFlagset(pflag.NewFlagSet("pla", pflag.ContinueOnError))

_, err := globalEngine.Register(workflowId1, workflowConfig, outputFn)
if err != nil {
t.Fatal(err)
}

fn := func(invocation workflow.InvocationContext, input []workflow.Data) ([]workflow.Data, error) {
typeId := workflow.NewTypeIdentifier(invocation.GetWorkflowIdentifier(), "workflowData")
Expand All @@ -316,7 +328,9 @@ func Test_runWorkflowAndProcessData(t *testing.T) {
},
Type: "sast",
}
d, err := json.Marshal(testSummary)

var d []byte
d, err = json.Marshal(testSummary)
if err != nil {
t.Fatal(err)
}
Expand All @@ -329,7 +343,6 @@ func Test_runWorkflowAndProcessData(t *testing.T) {

// setup workflow engine to contain a workflow with subcommands
wrkflowId := workflow.NewWorkflowIdentifier(testCmnd)
workflowConfig := workflow.ConfigurationOptionsFromFlagset(pflag.NewFlagSet("pla", pflag.ContinueOnError))

entry, err := globalEngine.Register(wrkflowId, workflowConfig, fn)
assert.Nil(t, err)
Expand Down
2 changes: 1 addition & 1 deletion cliv2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/snyk/cli-extension-iac-rules v0.0.0-20240422133948-ae17a4306672
github.com/snyk/cli-extension-sbom v0.0.0-20240426130148-b83c2ebc75c4
github.com/snyk/container-cli v0.0.0-20240322120441-6d9b9482f9b1
github.com/snyk/go-application-framework v0.0.0-20240426112848-21dc9ca24101
github.com/snyk/go-application-framework v0.0.0-20240508135435-dbabe7469be4
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65
github.com/snyk/snyk-iac-capture v0.6.5
github.com/snyk/snyk-ls v0.0.0-20240507082100-cc93dfb3c69e
Expand Down
4 changes: 2 additions & 2 deletions cliv2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,8 @@ github.com/snyk/code-client-go v1.5.3 h1:EnHogM2uNnvkrfIJbkOGa9X1bOkU6bJR/QRQCwb
github.com/snyk/code-client-go v1.5.3/go.mod h1:Kkr7pQc8ItsBZSYd6A1S4r4VHO6HNyTWZsqi18sAtwQ=
github.com/snyk/container-cli v0.0.0-20240322120441-6d9b9482f9b1 h1:9RKY9NdX5DrJAoVXDP0JiqrXT+4Nb9NH8pjEcA0NsLA=
github.com/snyk/container-cli v0.0.0-20240322120441-6d9b9482f9b1/go.mod h1:38w+dcAQp9eG3P5t2eNS9eG0reut10AeJjLv5lJ5lpM=
github.com/snyk/go-application-framework v0.0.0-20240426112848-21dc9ca24101 h1:KNgM4LuGcXcj0WxhAY0TpH20vtGFq9ZxxzGt6rhnZ8c=
github.com/snyk/go-application-framework v0.0.0-20240426112848-21dc9ca24101/go.mod h1:or9vKR9k7r8CJZ7F5n+SF+r5pMg/PrWAXZXdFdk375M=
github.com/snyk/go-application-framework v0.0.0-20240508135435-dbabe7469be4 h1:MRULCD+mTn1X33p8wLUxyy6w27aEoD1m4CVScQw0z18=
github.com/snyk/go-application-framework v0.0.0-20240508135435-dbabe7469be4/go.mod h1:vaYv1/l5tZzVFXtko7wil2yfPaahEMri+QNerrDPRU8=
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65 h1:CEQuYv0Go6MEyRCD3YjLYM2u3Oxkx8GpCpFBd4rUTUk=
github.com/snyk/go-httpauth v0.0.0-20240307114523-1f5ea3f55c65/go.mod h1:88KbbvGYlmLgee4OcQ19yr0bNpXpOr2kciOthaSzCAg=
github.com/snyk/policy-engine v0.30.11 h1:wUy5LMar2vccMbNM62MSBRdjAQAhAbIm7aNXXO+g2tk=
Expand Down
2 changes: 1 addition & 1 deletion dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs');
const MAX_COMMIT_MESSAGE_LENGTH = 72;

function checkCommitMessage(commitMessage, url) {
const firstLineRegex = /^(feat|fix|chore|test|docs|refactor|revert)(\([a-z0-9-_]+\))?:(.+)$/;
const firstLineRegex = /^Merge.*|(feat|fix|chore|test|docs|refactor|revert)(\([a-z0-9-_]+\))?:(.+)$/;
if (!firstLineRegex.test(commitMessage)) {
fail(
`"[${commitMessage}](${url})" is not using a valid commit message format. For commit guidelines, see: [CONTRIBUTING](https://github.com/snyk/snyk/blob/main/CONTRIBUTING.md#creating-commits).`,
Expand Down