-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added documentation, SiteIntegrationAPI #568
Conversation
[diff-counting] Significant lines: 38. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Add a docstring for rejectIDOLChanges
?
@andrew032011 I would also really suggest not documenting this file for the sake of adding documentation. |
@@ -5,6 +5,12 @@ import { PermissionError, BadRequestError } from '../utils/errors'; | |||
|
|||
require('dotenv').config(); | |||
|
|||
/** | |||
* Triggers a dispatch event to pull changes from the IDOL backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be a little more specific about what this does.
e.g. Triggers a dispatch event for the pull-from-idol GitHub action. This job (blah blah blah brief description of what the job does).
export const getIDOLChangesPR = async (user: IdolMember): Promise<{ pr: PRResponse }> => { | ||
await checkPermissions(user); | ||
const foundPR = await findBotPR(); | ||
return { pr: foundPR }; | ||
}; | ||
|
||
/** | ||
* Accepts and merges the IDOL backend changes pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should mention what happens when the PR is merged (i.e. triggering a deploy).
@@ -59,6 +77,12 @@ export const acceptIDOLChanges = async ( | |||
return { pr: foundPR, merged: acceptedPR.data.merged }; | |||
}; | |||
|
|||
/** | |||
* Rejects and closes the IDOL backend changes pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Rejects and closes the IDOL backend changes pull request. | |
* Closes the IDOL backend changes pull request. |
* @param {IdolMember} user - The user attempting to reject the changes. | ||
* @returns {Promise<{pr: PRResponse; closed: boolean}>} - A promise that resolves to an object containing the pull request details and a boolean indicating if the rejection was successful. | ||
* @throws {PermissionError} - If the user lacks permission to reject the pull request. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also throws a BadRequestError if no PR is found.
@kevinmram doing some cleanup here to this PR doesn't get stale/abandoned. Let's either close this PR, or address these comments? |
* added documentation, SiteIntegrationAPI * added docstring, rejectIDOLChanges * added/edited suggested changes, prettier. * yarn install, prettier
added documentation to SiteIntegrationAPI- documenting the purpose and usage of each method within the class.