Skip to content

build(make): update template-validate cmds#6385

Merged
ehsandeep merged 1 commit intodevfrom
dwisiswant0/build/make/update-template-validate-cmds
Aug 15, 2025
Merged

build(make): update template-validate cmds#6385
ehsandeep merged 1 commit intodevfrom
dwisiswant0/build/make/update-template-validate-cmds

Conversation

@dwisiswant0
Copy link
Member

@dwisiswant0 dwisiswant0 commented Aug 14, 2025

Proposed changes

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • Chores
    • Updated validation configuration to a multi-line format for improved readability in scripts.
    • Broadened the validation scope exclusions to cover additional directories and code sections while preserving workflow checks.
    • Maintains existing test targets and validation options elsewhere.
    • No impact on application functionality, performance, or user interface.

Signed-off-by: Dwi Siswanto <git@dw1.io>
@dwisiswant0 dwisiswant0 requested a review from ehsandeep August 14, 2025 03:42
@auto-assign auto-assign bot requested a review from dogancanbakir August 14, 2025 03:42
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 14, 2025

Walkthrough

Updated Makefile target template-validate: replaced single-line nuclei validate invocations with multi-line forms, added exclusions for .github/, helpers/payloads/, and -ept code, kept -ut unchanged, and retained second call with -w workflows.

Changes

Cohort / File(s) Summary
Build & Validation (Makefile)
Makefile
Converted two nuclei validate commands to multi-line with backslashes; added exclusions (-et .github/, -et helpers/payloads/, -ept code) to both; preserved -ut flags and workflows (-w) on the second call.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

I twitch my whiskers at the Makefile’s tune,
Two lines become many, exclusions in bloom.
Hops through .github/ I carefully skip,
Helpers and code get a gentle nip.
Validations tidy, workflows in sight—
Carrot-approved checks, compiled just right.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dwisiswant0/build/make/update-template-validate-cmds

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dwisiswant0
Copy link
Member Author

@coderabbitai create an issue and linking to this PR.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 14, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

I'll examine the PR changes first to create a meaningful issue for you.


🏁 Script executed:

#!/bin/bash
# Get details about the PR changes
gh pr view 6385 --json title,body,files,additions,deletions,changedFiles

# Get the actual diff to understand what was changed
gh pr diff 6385

Length of output: 1729


Now I'll create a follow-up issue related to this PR's template validation improvements:


🏁 Script executed:

#!/bin/bash
# Create a GitHub issue related to the template validation improvements
gh issue create \
  --title "Document template validation exclusions and improve testing coverage" \
  --body "## Summary

This issue tracks the need to document and improve testing coverage for the template validation exclusions that were recently updated in PR #6385.

## Background

PR #6385 enhanced the \`template-validate\` Makefile target by adding exclusions for:
- \`.github/\` directory
- \`helpers/payloads/\` directory  
- \`code\` template type

## Proposed Actions

1. **Documentation**: Add documentation explaining why these directories and template types are excluded from validation
2. **Testing**: Create tests to ensure the validation exclusions work as expected
3. **Configuration**: Consider moving these exclusions to a configuration file for easier maintenance

## Related

- PR: https://github.com/projectdiscovery/nuclei/pull/6385
- Requested by: @dwisiswant0

## Acceptance Criteria

- [ ] Document the rationale behind validation exclusions
- [ ] Add tests covering the exclusion functionality
- [ ] Consider configuration-driven approach for exclusions" \
  --assignee dwisiswant0

Length of output: 1146


@dwisiswant0 I've created issue #6386 to track follow-up work related to your template validation improvements in this PR.

The issue focuses on:

  • Documenting the rationale behind the new validation exclusions (.github/, helpers/payloads/, and code template type)
  • Adding test coverage for the exclusion functionality
  • Considering a configuration-driven approach for future maintenance

You can view the issue here: #6386

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
Makefile (3)

149-159: DRY the repeated validate flags via a make variable

The two invocations repeat the same exclude flags. Factor them into a single variable to reduce duplication and ease future maintenance.

Apply this diff within the target:

 	./bin/nuclei -validate \
-		-et .github/ \
-		-et helpers/payloads/ \
-		-et http/technologies \
-		-ept code
+		$(NUC_VALIDATE_EXCLUDES)
 	./bin/nuclei -validate \
 		-w workflows \
-		-et .github/ \
-		-et helpers/payloads/ \
-		-et http/technologies \
-		-ept code
+		$(NUC_VALIDATE_EXCLUDES)

Add this variable definition once (suggest near other top-level vars):

# Common excludes for nuclei template validation
NUC_VALIDATE_EXCLUDES := -et .github -et helpers/payloads -et http/technologies -ept code

151-158: Normalize trailing slashes in -et paths

You mix trailing slashes on .github/ and helpers/payloads/ but omit it on http/technologies. Normalize to one style to avoid edge-case mismatches and improve readability. Suggest dropping trailing slashes across the board.

-		-et .github/ \
-		-et helpers/payloads/ \
+		-et .github \
+		-et helpers/payloads \
 		-et http/technologies \

And the same normalization in the second invocation.


149-159: Optional: add a brief comment explaining the exclusions

Future contributors may not immediately know why .github, helpers/payloads, http/technologies, or code protocol are excluded. A short comment preserves intent.

 template-validate: build
 template-validate:
 	./bin/nuclei -ut
+	# Exclude GitHub metadata, payload helpers, technology definitions, and code protocol from template validation
 	./bin/nuclei -validate \
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6996b4a and 47cd378.

📒 Files selected for processing (1)
  • Makefile (1 hunks)

@ehsandeep ehsandeep merged commit 7e95d9a into dev Aug 15, 2025
6 checks passed
@ehsandeep ehsandeep deleted the dwisiswant0/build/make/update-template-validate-cmds branch August 15, 2025 00:35
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