Skip to content

Fix resource cleanup paths and add GoHawk to CI - #122

Merged
ernestrc merged 4 commits into
unstablebuild:mainfrom
kojah:fix-gohawk-findings
Sep 21, 2026
Merged

ernestrc merged 4 commits into
unstablebuild:mainfrom
kojah:fix-gohawk-findings

Conversation

@kojah

@kojah kojah commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Changes:

  • Release the token cache mutex before returning from a canceled storage lookup.
  • Close telemetry responses and crash report files on every return path.
  • Close tar and gzip writers when walking a worktree fails.
  • Parse font files from memory instead of retaining open file descriptors.
  • Add the pinned GoHawk v0.3.4 binary to the existing lint job, with existing noisy categories disabled so the initial rollout passes.

Testing:

  • go test ./auth ./cmd/rune/ide/apiclient ./internal/debug ./internal/ide/gitpkg
  • xvfb-run -a go test ./internal/term/gui/font
  • gohawk -json -enable-all -disable=exitpolicy,goroutineownership,lockorder,processownership ./...

gohawk found these bugs while I was scanning the repo. I wrote it, so I took the liberty of adding it to the existing CI job along with the fixes. You're very welcome to remove that part if you'd rather not add another tool :)

@ernestrc

ernestrc commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

@kojah totally the opposite, I want this in our pre-commit hooks. For this to get merged though, we need to have it pass; currently I'm getting many errors. For this PR add all of the -disable=<check> such that it passes, and then in subsequent PRs we can incrementally fix categories of errors, thus removing a -disable<check per PR. What do you think?

gohawk.json

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/term/gui/font/manager.go 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kojah

kojah commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor Author

@ernestrc Awesome! I'll work on fixing up the PR so there's less analyzer noise, then, and submit those other ones incrementally like you said. I think the goroutineownership (and perhaps others) can be turned off.

Close the lifecycle gaps found by GoHawk and run the pinned analyzer in the existing CI workflow.

Signed-off-by: James Ko <[email protected]>
@kojah
kojah force-pushed the fix-gohawk-findings branch 2 times, most recently from c9240b4 to 03b9185 Compare September 21, 2026 01:49
@kojah
kojah force-pushed the fix-gohawk-findings branch from 03b9185 to 6207599 Compare September 21, 2026 01:54
@kojah

kojah commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@ernestrc Addressed your feedback! I also fixed an issue with a leaked file in the font loader, since it's one of the tinier changes. Let me know if there's anything else I need to do before merge, otherwise I'll wait and submit the other fixes

@ernestrc
ernestrc enabled auto-merge (squash) September 21, 2026 07:22
@ernestrc
ernestrc merged commit 0e16511 into unstablebuild:main Sep 21, 2026
8 checks passed
@kojah
kojah deleted the fix-gohawk-findings branch September 23, 2026 03:24
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