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/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:517e85c9-7802-c7ae-375c-06cc57520b37 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9556:1DF886:63FBAE:81061A:698FB39E |
| html-safe-nonce | 6e54fcb6f0c902aa179b49131b873415e65f332d4fc8ff6190cc752eba4f33e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTU2OjFERjg4Njo2M0ZCQUU6ODEwNjFBOjY5OEZCMzlFIiwidmlzaXRvcl9pZCI6IjcxMDI2MTgyNDQxNDY1MDg3MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f3bd2762af975b16f3ea3682c4965c0dbb7bef63a36497855e35054afed38558 |
| hovercard-subject-tag | pull_request:2095943182 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/files |
| 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 | 6df359c0989bb4eb7656e0047ab7a57a6657880db88f5a202f4e51ddbc3dfce8 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d09a7639fca70dcd33f2b127cabd422a73b10aef |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width