Skip to content

fix: nilpointer in lint workflowtemplate. Fixes: #13190 - #13868

Open
tooptoop4 wants to merge 1 commit into
argoproj:mainfrom
tooptoop4:lintnil
Open

fix: nilpointer in lint workflowtemplate. Fixes: #13190#13868
tooptoop4 wants to merge 1 commit into
argoproj:mainfrom
tooptoop4:lintnil

Conversation

@tooptoop4

@tooptoop4 tooptoop4 commented Nov 6, 2024

Copy link
Copy Markdown
Contributor

Fixes #13190

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error handling to provide clear validation messages when workflow templates are incomplete or missing from requests.

@tooptoop4

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds a defensive nil check in the LintWorkflowTemplate function to validate that the request body contains a template. If the template is missing, the function returns an InvalidArgument error instead of proceeding to downstream calls that assume a non-nil value.

Changes

Cohort / File(s) Summary
Nil Check Addition
server/workflowtemplate/workflow_template_server.go
Added defensive nil check for req.Template at the beginning of LintWorkflowTemplate to return an InvalidArgument error if the template is not provided in the request body, preventing downstream nil pointer dereference.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal but provides the issue reference. However, it lacks Motivation, Modifications, Verification, and Documentation sections specified in the template. Expand the description with Motivation (why the fix is needed), Modifications (what changed), Verification (how it was tested), and Documentation sections per the template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly identifies the fix as addressing a nil pointer issue in lint workflowtemplate and references issue #13190.
Linked Issues check ✅ Passed The PR change adds a nil check for req.Template before using it, directly addressing the root cause of the nil pointer panic reported in issue #13190.
Out of Scope Changes check ✅ Passed The change is scoped and focused only on fixing the nil pointer issue in LintWorkflowTemplate, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Joibel

Joibel commented Aug 25, 2026

Copy link
Copy Markdown
Member

This has been taken over by #16538.

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.

nil pointer error in /api/v1/workflow-templates/{namespace}/lint

2 participants