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

Refactor: Add Payload Validators + Middleware In Go Code #366

Merged
merged 46 commits into from
Sep 12, 2024

Conversation

harrisoncramer
Copy link
Owner

@harrisoncramer harrisoncramer commented Sep 12, 2024

This MR refactors the Go code to introduce a middleware pattern. It then moves several repeated patterns into these middleware and improves the endpoints by adding validators. It makes the following changes:

  • Adds validators to the payloads to enforce required payload fields
  • Moves method validation into middleware
  • Moves payload validation into middleware
  • Moves getting the MR ID into middleware
  • Updates + simplifies error responses + status codes
  • Adds global logging for both to/from Go server, and to/from Gitlab, changes logging configuration slightly

@harrisoncramer harrisoncramer changed the base branch from main to develop September 12, 2024 17:56
@harrisoncramer harrisoncramer marked this pull request as ready for review September 12, 2024 18:51
@harrisoncramer harrisoncramer merged commit 9f963d5 into develop Sep 12, 2024
6 checks passed
harrisoncramer added a commit that referenced this pull request Sep 14, 2024
fix: format of date when MR was closed or merged (#367)
refactor: Add Payload Validators + Middleware In Go Code (#366)
fix: Add better checks for leaving comments (#369)
fix: regex support for http credentials embedded in remote url (#372)
fix: Comment on single line selects two lines (#371)

This is a #PATCH release.
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