Useful Environment Variables:
- GITLAB_HOST: "gabronickwontdiefromcovid.com"
- GITLAB_TOKEN: can be found in @.npmrc
Steps:
- Use the GitLab API using curl to get the details of merge request $ARGUMENTS[0] from the repository in the current working directory. The repository can be identified by the git remote origin URL.
- Checkout the merge request branch
- Fetch all discussions/comments on the merge request using the GitLab API:
- GET /projects/:id/merge_requests/:merge_request_iid/discussions
- Filter for unresolved discussions (where
resolved is false or null)
- For each unresolved comment/discussion:
a. Read and understand the comment content and the code context it refers to
b. If the comment is on a specific line, read the relevant file and surrounding context
c. Analyze what change is being requested
d. Make the necessary code changes to address the comment
e. After addressing the comment, reply to the discussion using the GitLab API:
- POST /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes
- Include a brief explanation of the changes made
- After all comments are addressed, run linting and type checking: