Skip to content

feat: Initial run of Semgrep scan#1084

Open
adimoft wants to merge 14 commits into
mainfrom
semgrep-initial-run
Open

feat: Initial run of Semgrep scan#1084
adimoft wants to merge 14 commits into
mainfrom
semgrep-initial-run

Conversation

@adimoft

@adimoft adimoft commented Jun 18, 2026

Copy link
Copy Markdown

This pull request introduces several improvements to Windows-specific code and GitHub workflow automation. The most significant changes include refactoring Windows system calls to use the golang.org/x/sys/windows package for better reliability and maintainability, adding a Semgrep security scan workflow, and making minor adjustments to CI and release workflows.

Windows system code modernization and reliability:

  • Refactored all Windows system calls in cmd/app/tray_windows.go to use the golang.org/x/sys/windows package instead of the standard syscall package, improving compatibility and future-proofing the code. This includes changes to mutex handling, DLL loading, and process attributes. [1] [2] [3]
  • Cleaned up and clarified mutex acquisition and probing logic, and improved error handling and code readability in ensureSingleInstance, acquireInstanceMutex, and probeInstanceMutex.
  • Improved user notification logic for already-running instances by updating the use of Windows APIs and simplifying process launching.

Security and CI/CD workflow enhancements:

  • Added a new .github/workflows/semgrep.yml workflow to automatically run Semgrep security scans on pushes and pull requests to main, enhancing code security checks.
  • Enabled workflow_dispatch triggers for both the CI and Semgrep workflows, allowing manual workflow runs from the GitHub UI. [1] [2]
  • Updated the release workflow to fix environment variable naming (GITHUB_REF_NAME) and improved how branches are passed to semantic-release, ensuring correct versioning behavior.

---
Subject: Added initial Semgrep scan
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.44%. Comparing base (82728e6) to head (c43dee2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1084   +/-   ##
=======================================
  Coverage   43.44%   43.44%           
=======================================
  Files         143      143           
  Lines       13621    13621           
=======================================
  Hits         5917     5917           
  Misses       7143     7143           
  Partials      561      561           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adimoft adimoft marked this pull request as ready for review June 19, 2026 10:20
@adimoft adimoft requested a review from a team as a code owner June 19, 2026 10:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial Semgrep scanning workflow to the repository and includes a few workflow and Windows tray-related tweaks.

Changes:

  • Added a new GitHub Actions workflow to run Semgrep on pushes/PRs.
  • Updated the Windows tray single-instance logic to use golang.org/x/sys/windows APIs.
  • Adjusted CI/release workflows (added workflow_dispatch; tweaked semantic-release invocation/output handling).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
cmd/app/tray_windows.go Switches Win32 interop from syscall to x/sys/windows; refactors mutex and browser-launch code.
.github/workflows/semgrep.yml Introduces a Semgrep scan workflow using a pinned container image and reusable action.
.github/workflows/release.yml Updates the dry-run semantic-release step environment variable usage and output redirection quoting.
.github/workflows/ci.yml Adds YAML document marker and enables manual dispatch.

Comment thread cmd/app/tray_windows.go
Comment thread cmd/app/tray_windows.go
Comment thread cmd/app/tray_windows.go Outdated
Comment thread .github/workflows/semgrep.yml
@sudhir-intc

Copy link
Copy Markdown
Contributor

@adimoft : can you please resolve the copilot review comments

adimoft and others added 3 commits June 22, 2026 12:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/semgrep.yml Outdated
Comment thread cmd/app/tray_windows.go Outdated
adimoft and others added 2 commits June 22, 2026 12:30
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants