Title: Slight refactor of scbctl by ddddddO · Pull Request #2682 · secureCodeBox/secureCodeBox · GitHub
Open Graph Title: Slight refactor of scbctl by ddddddO · Pull Request #2682 · secureCodeBox/secureCodeBox
X Title: Slight refactor of scbctl by ddddddO · Pull Request #2682 · secureCodeBox/secureCodeBox
Description: Description Refactor scbctl👍! Remove extra processing in scbctl cmd's buildTree function ( 80f408b ) Replace Map to Slice ( 1e1ac14 ) Golang's map does not guarantee ordering, so I changed it from a map to a slice so that the result of each execution is the same each time. I think it will solve the problem. The following is a log of multiple runs of go test before and after the change at local. Before ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.027s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.021s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.019s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.020s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 --- FAIL: TestBuildTree (0.00s) --- FAIL: TestBuildTree/Complex_cascade (0.00s) cascading_test.go:125: Error Trace: /home/ddddddo/github.com/ddddddO/secureCodeBox/scbctl/cmd/cascading_test.go:125 Error: Not equal: expected: "Scans\n└── root\n ├── child1\n │ └── grandchild\n └── child2\n" actual : "Scans\n└── root\n ├── child2\n └── child1\n └── grandchild\n" Diff: --- Expected +++ Actual @@ -2,5 +2,5 @@ └── root - ├── child1 - │ └── grandchild - └── child2 + ├── child2 + └── child1 + └── grandchild Test: TestBuildTree/Complex_cascade 🆕 Creating a new scan with name 'nmap' and parameters 'scanme.nmap.org' 🚀 Successfully created a new Scan 'nmap' 🆕 Creating a new scan with name 'nmap' and parameters 'scanme.nmap.org -p 90' 🚀 Successfully created a new Scan 'nmap' 🆕 Creating a new scan with name 'scanme-nmap-org' and parameters 'scanme.nmap.org' 🚀 Successfully created a new Scan 'scanme-nmap-org' 🆕 Creating a new scan with name 'nmap' and parameters 'scanme.nmap.org' 🚀 Successfully created a new Scan 'nmap' 🆕 Creating a new scan with name 'kubeaudit' and parameters '--namespace some-other-namespace' 🚀 Successfully created a new Scan 'kubeaudit' Error: you must use '--' to separate scan parameters Error: you must use '--' to separate scan parameters triggered new Scan for ScheduledScan 'nmap' Error: could not find ScheduledScan 'nonexistent-scan' in namespace 'foobar' Error: accepts 1 arg(s), received 0 triggered new Scan for ScheduledScan 'nmap' FAIL FAIL github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.025s FAIL ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ ↓ After ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.019s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.019s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.025s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.023s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.017s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.025s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.019s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.034s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.019s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.021s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.023s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.022s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.024s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.020s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.018s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.026s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... -count=1 ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd 0.021s ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ Checklist Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests. ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ go test ./... ok github.com/secureCodeBox/secureCodeBox/scbctl/cmd (cached) ddddddo@debian:~/github.com/ddddddO/secureCodeBox/scbctl/cmd$ Make sure that all your commits are signed-off and that you are added to the Contributors file. Make sure that all CI finish successfully. Optional (but appreciated): Make sure that all commits are Verified.
Open Graph Description: Description Refactor scbctl👍! Remove extra processing in scbctl cmd's buildTree function ( 80f408b ) Replace Map to Slice ( 1e1ac14 ) Golang's map does not guarantee ordering, so I chan...
X Description: Description Refactor scbctl👍! Remove extra processing in scbctl cmd's buildTree function ( 80f408b ) Replace Map to Slice ( 1e1ac14 ) Golang's map does not guarantee ordering, s...
Opengraph URL: https://github.com/secureCodeBox/secureCodeBox/pull/2682
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:a45e0f5b-7ef1-c528-6379-4d66c2af4f3a |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 8B02:D2DF1:6AC8F2:75BE61:698FA171 |
| html-safe-nonce | 58b41cadd7c0ae57966a645cf3c627bde1136b87ec271edcefe2a3ae43ff36a8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjAyOkQyREYxOjZBQzhGMjo3NUJFNjE6Njk4RkExNzEiLCJ2aXNpdG9yX2lkIjoiMzUzNTEwOTgzNTYxMDYyODQ2NSIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | 340078ac0db8bcefbde0f4e978dd928aab48463c588e867c5a958bb24a0824ca |
| hovercard-subject-tag | pull_request:2095943182 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/secureCodeBox/secureCodeBox/pull/2682/checks |
| twitter:image | https://avatars.githubusercontent.com/u/41510086?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/41510086?s=400&v=4 |
| og:image:alt | Description Refactor scbctl👍! Remove extra processing in scbctl cmd's buildTree function ( 80f408b ) Replace Map to Slice ( 1e1ac14 ) Golang's map does not guarantee ordering, so I chan... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f47eb8d0aaafbfcb6a8220a40bd81431acf688857c575e6489670c394cfa36f |
| turbo-cache-control | no-preview |
| go-import | github.com/secureCodeBox/secureCodeBox git https://github.com/secureCodeBox/secureCodeBox.git |
| octolytics-dimension-user_id | 34573705 |
| octolytics-dimension-user_login | secureCodeBox |
| octolytics-dimension-repository_id | 80711933 |
| octolytics-dimension-repository_nwo | secureCodeBox/secureCodeBox |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 80711933 |
| octolytics-dimension-repository_network_root_nwo | secureCodeBox/secureCodeBox |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 17aba3d160d69b8c2b37695ebd174d8101af8896 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width