Skip to content

20260528 state#256

Merged
iggy merged 8 commits into
masterfrom
20260528-state
May 29, 2026
Merged

20260528 state#256
iggy merged 8 commits into
masterfrom
20260528-state

Conversation

@iggy
Copy link
Copy Markdown
Owner

@iggy iggy commented May 29, 2026

Current state of govern as it has been running in my lab.

  • switch yaml library to github.com/goccy/go-yaml
  • Remove some unnecessary logging output
  • Add some more functionality to pkgrepo laws including the ability to remove old ones
  • laws/file.go: check if a target exists and is a symlink
  • clean up some old commented out code and general polish in the laws parser
  • overhaul mesh support
  • update dependencies

iggy added 8 commits May 28, 2026 19:42
Switch to github.com/goccy/go-yaml which so far is way better than the
old yaml library
Clarify the purpose of one of the roadmap items
Remove some unnecessary logging output
Add some more functionality to pkgrepo laws including the ability to
remove old ones
implement a TODO item to check if a target exists and is a symlink
clean up some old commented out code and general polish
dragonboat turned out to be more trouble than it was worth, switch to
libp2p-go and rework some of the surrounding code

still needs some work

auth
update dependencies
@github-actions
Copy link
Copy Markdown

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 2 0 0 0.01s
⚠️ COPYPASTE jscpd yes 10 no 2.11s
⚠️ GO golangci-lint yes 1 no 52.14s
✅ GO revive yes no no 3.66s
✅ MARKDOWN markdownlint 1 0 0 1.1s
✅ MARKDOWN markdown-table-formatter 1 0 0 0.44s
✅ REPOSITORY checkov yes no no 30.86s
✅ REPOSITORY gitleaks yes no no 0.22s
✅ REPOSITORY git_diff yes no no 0.0s
✅ REPOSITORY grype yes no no 74.82s
✅ REPOSITORY secretlint yes no no 0.86s
✅ REPOSITORY syft yes no no 7.84s
✅ REPOSITORY trivy yes no no 16.99s
✅ REPOSITORY trivy-sbom yes no no 4.03s
✅ REPOSITORY trufflehog yes no no 2.7s
✅ SPELL lychee 5 0 0 0.59s
⚠️ YAML prettier 4 1 2 0.96s
✅ YAML v8r 4 0 0 3.79s
✅ YAML yamllint 4 0 0 0.9s

Detailed Issues

⚠️ GO / golangci-lint - 1 error
../../..cmd/mesh-commands.go:72:4: exitAfterDefer: log.Fatal will exit, and `defer cancel()` will not run (gocritic)
			log.Fatal().Err(err).Msg("dispatch failed")
			^
../../..pkg/mesh/host.go:12:1: File is not properly formatted (gofmt)
	dht "github.com/libp2p/go-libp2p-kad-dht"
^
../../..pkg/mesh/http.go:35:1: File is not properly formatted (gofmt)
	mux.HandleFunc("/exec", h.handleLocal)         // run on local node only
^
../../..pkg/mesh/types.go:68:1: File is not properly formatted (gofmt)
	ID        string          `json:"id"`        // matches Command.ID
^
../../..pkg/laws/user.go:118:2: QF1003: could use tagged switch on facts.Facts.Distro.Family (staticcheck)
	if facts.Facts.Distro.Family == "alpine" {
	^
5 issues:
* gocritic: 1
* gofmt: 3
* staticcheck: 1
⚠️ COPYPASTE / jscpd - 10 errors
Clone found (go):
 - pkg/mesh/service.go [276:7 - 283:4] (7 lines, 81 tokens)
   pkg/mesh/service.go [233:8 - 240:10]

Clone found (go):
 - pkg/mesh/http.go [237:2 - 246:2] (9 lines, 96 tokens)
   pkg/mesh/http.go [215:2 - 224:2]

Clone found (go):
 - pkg/laws/ssh.go [99:3 - 110:2] (11 lines, 131 tokens)
   pkg/laws/ssh.go [70:4 - 82:7]

Clone found (go):
 - pkg/laws/service.go [171:5 - 176:4] (5 lines, 77 tokens)
   pkg/laws/service.go [152:7 - 157:4]

Clone found (go):
 - pkg/laws/file.go [300:2 - 310:4] (10 lines, 97 tokens)
   pkg/laws/file.go [250:2 - 260:6]

Clone found (go):
 - pkg/laws/file.go [333:3 - 352:7] (19 lines, 222 tokens)
   pkg/laws/file.go [282:3 - 300:3]

Clone found (go):
 - pkg/laws/file.go [381:2 - 394:89] (13 lines, 120 tokens)
   pkg/laws/file.go [251:3 - 313:3]

Clone found (go):
 - pkg/laws/file.go [411:5 - 433:7] (22 lines, 259 tokens)
   pkg/laws/file.go [328:5 - 299:2]

Clone found (go):
 - cmd/local-lint.go [48:3 - 62:4] (14 lines, 135 tokens)
   cmd/local-pretend.go [48:3 - 62:4]

Clone found (go):
 - cmd/local-apply.go [48:18 - 63:2] (15 lines, 117 tokens)
   cmd/local-pretend.go [49:12 - 63:4]

┌────────┬────────────────┬─────────────┬──────────────┬──────────────┬──────────────────┬───────────────────┐
│ Format │ Files analyzed │ Total lines │ Total tokens │ Clones found │ Duplicated lines │ Duplicated tokens │
├────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ go     │ 32             │ 5594        │ 41694        │ 10           │ 125 (2.23%)      │ 1335 (3.2%)       │
├────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ Total: │ 32             │ 5594        │ 41694        │ 10           │ 125 (2.23%)      │ 1335 (3.2%)       │
└────────┴────────────────┴─────────────┴──────────────┴──────────────┴──────────────────┴───────────────────┘
Found 10 clones.
HTML report saved to megalinter-reports/copy-paste/html/
ERROR: jscpd found too many duplicates (2.23%) over threshold (0%)
Error: ERROR: jscpd found too many duplicates (2.23%) over threshold (0%)
    at ThresholdReporter.report (/node-deps/node_modules/@jscpd/finder/dist/index.js:615:13)
    at /node-deps/node_modules/@jscpd/finder/dist/index.js:109:18
    at Array.forEach (<anonymous>)
    at /node-deps/node_modules/@jscpd/finder/dist/index.js:108:22
    at async /node-deps/node_modules/jscpd/dist/bin/jscpd.js:9:5
⚠️ YAML / prettier - 1 error
Checking formatting...
[warn] .github/workflows/megalinter.yaml
[warn] Code style issues found in the above file. Run Prettier with --write to fix.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.4.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,COPYPASTE_JSCPD,GO_GOLANGCI_LINT,GO_REVIVE,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_GRYPE,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Comment thread pkg/laws/parser.go Dismissed
Comment thread pkg/laws/parser.go Dismissed
@iggy iggy merged commit 6fd460c into master May 29, 2026
3 checks passed
@iggy iggy deleted the 20260528-state branch May 29, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants