Skip to content

Exclude webapp/node_modules from go vet scans#1291

Closed
nevyangelova wants to merge 1 commit intomasterfrom
fix/exclude-webapp-node-modules-from-govet
Closed

Exclude webapp/node_modules from go vet scans#1291
nevyangelova wants to merge 1 commit intomasterfrom
fix/exclude-webapp-node-modules-from-govet

Conversation

@nevyangelova
Copy link
Copy Markdown
Contributor

@nevyangelova nevyangelova commented Mar 23, 2026

Summary

  • Exclude webapp/node_modules from go vet scans in the Makefile by filtering through go list and excluding /webapp/ packages.
  • Third-party npm packages (e.g. flatted v3.4.2) can ship .go files that fail the Mattermost license header check. This unblocks dependabot PRs like Bump flatted from 3.3.3 to 3.4.2 in /webapp #1289.

Test plan

Made with Cursor

Change Impact: 🟢 Low

Reasoning: This is an isolated build-time change that adds a defensive filter to exclude webapp packages from go vet scans. The modification only affects which code paths are analyzed during linting, not the actual server code or runtime behavior. The change directly addresses a known issue with third-party npm packages containing .go files with missing license headers.

Regression Risk: Minimal. The change filters out webapp/node_modules from go vet analysis by appending | grep -v /webapp/ to the go list ./... command in two places. This is purely a scope adjustment for the linter and doesn't alter what gets built or tested in the server code. The grep filter is a simple, well-established pattern with negligible failure risk. No shared dependencies, APIs, or core logic paths are affected.

QA Recommendation: Manual QA can be skipped. Verification should focus on: (1) confirming that the CI lint check passes successfully, and (2) re-running the dependent Dependabot PR (#1289 for flatted v3.4.2) to verify it now passes without license header violations. The change is mechanical and its success criteria are clearly defined—the build pipeline simply needs to complete without style check failures.

Third-party npm packages (e.g. flatted v3.4.2) can ship .go files
that fail the Mattermost license header check. Filter go vet to
only scan server packages.

Made-with: Cursor
@nevyangelova nevyangelova requested a review from a team as a code owner March 23, 2026 13:10
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 32cf23a2-c127-45ac-ac28-b99072a1f42d

📥 Commits

Reviewing files that changed from the base of the PR and between d3cec53 and 07ad16b.

📒 Files selected for processing (1)
  • Makefile

📝 Walkthrough

Walkthrough

The Makefile's golangci-lint prerequisite vet commands have been updated to run go vet exclusively on packages returned by $(go list ./...) while excluding the /webapp/ directory, replacing the previous ./... pattern across both standard and mattermost-govet invocations.

Changes

Cohort / File(s) Summary
Makefile Build Configuration
Makefile
Updated two go vet invocations (basic vet and mattermost-govet with flags) in the golangci-lint prerequisite to exclude /webapp/ from the vetting scope by using $(go list ./...) filtered via grep instead of the ./... wildcard pattern.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/exclude-webapp-node-modules-from-govet

Comment @coderabbitai help to get the list of available commands and usage tips.

@nevyangelova nevyangelova deleted the fix/exclude-webapp-node-modules-from-govet branch March 23, 2026 13:11
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.

1 participant