Skip to content
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

Merged
merged 5 commits into from
Apr 15, 2024
Merged

Conversation

kevinmram
Copy link
Contributor

added documentation to SiteIntegrationAPI- documenting the purpose and usage of each method within the class.

@kevinmram kevinmram requested a review from a team as a code owner December 3, 2023 18:18
@dti-github-bot
Copy link
Member

dti-github-bot commented Dec 3, 2023

[diff-counting] Significant lines: 38.

Copy link
Collaborator

@andrew032011 andrew032011 left a 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?

@henry-li-06
Copy link
Collaborator

@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.
Copy link
Collaborator

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.
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* 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.
*/
Copy link
Collaborator

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.

@andrew032011
Copy link
Collaborator

@kevinmram doing some cleanup here to this PR doesn't get stale/abandoned. Let's either close this PR, or address these comments?

@kevinmram kevinmram merged commit af232e3 into main Apr 15, 2024
12 of 13 checks passed
@kevinmram kevinmram deleted the si-api-documentation branch April 15, 2024 01:09
oscarwang20 pushed a commit that referenced this pull request May 6, 2024
* added documentation, SiteIntegrationAPI

* added docstring, rejectIDOLChanges

* added/edited suggested changes, prettier.

* yarn install, prettier
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.

5 participants