Skip to content

Dev#5

Open
sandeshjangam wants to merge 3 commits intostagingfrom
dev
Open

Dev#5
sandeshjangam wants to merge 3 commits intostagingfrom
dev

Conversation

@sandeshjangam
Copy link
Contributor

No description provided.

@@ -3,10 +3,12 @@ const { OpenAI } = require('openai');
const core = require("@actions/core");
Copy link

Choose a reason for hiding this comment

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

What: The addition of 'instructions' as a parameter in the constructor is a change that should also have a validation check.

Why: Ensuring that all parameters passed to the constructor are validated can prevent runtime errors and ensure the integrity of the data.

How: Add validation logic to check if 'instructions' is either a string or undefined before assigning it to 'this.instructions'.

@@ -285,14 +287,17 @@ class AiHelper {
for (const comments of prComments) {
Copy link

Choose a reason for hiding this comment

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

What: The new comment formatting for review comments does not provide validation for the 'severity' and 'priority' fields.

Why: Lack of validation allows potential for unexpected data to be processed, which can lead to confusion or errors when the comment is generated.

How: Implement checks to ensure 'severity' and 'priority' are among the expected values (e.g., 'High', 'Medium', 'Low'). You can use a utility function like isValidSeverity(severity) to validate these.

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