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: cleanup and move API #95

Merged
merged 88 commits into from
Feb 8, 2024
Merged

refactor: cleanup and move API #95

merged 88 commits into from
Feb 8, 2024

Conversation

lvlcn-t
Copy link
Member

@lvlcn-t lvlcn-t commented Jan 30, 2024

Motivation

To finish the refactoring started in #91, where the checks' handler methods were removed from the interface.

Closes #92

Changes

  • I've refactored the API to a dedicated component in another package behind an interface. We partly discussed this here.
  • I've refactored the Sparrow struct into a composition structure in order to improve code organization and clarity. This includes setting apart different responsibilities into checkCoordinator and errorHandler types.
  • I've removed functionalities and sections of code that were no longer needed.

(I also adjusted the docs of one dns metric that has changed)

Tests done

  • I've moved/refactored the unit tests for the API
  • I've added some more unit tests
  • Unit tests suceeded.
  • E2E tests succeeded.

TODO

  • I've assigned this PR to myself
  • I've labeled this PR correctly

lvlcn-t and others added 30 commits January 14, 2024 20:00
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
…m/sparrow into feat/simplify-helm-chart-config
Signed-off-by: Bruno Bressi <[email protected]>
Signed-off-by: Bruno Bressi <[email protected]>
@lvlcn-t lvlcn-t added refactoring Refactoring of existing code housekeeping area/api Issues/PRs related to the API labels Jan 30, 2024
@lvlcn-t lvlcn-t added this to the 0.4.0 milestone Jan 30, 2024
@lvlcn-t lvlcn-t self-assigned this Jan 30, 2024
pkg/api/api.go Show resolved Hide resolved
Copy link
Member

@puffitos puffitos left a comment

Choose a reason for hiding this comment

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

All in all, everything seems fine. The Run method of the sparrow has to change, to keep the focus on its responsibility.

pkg/api/api.go Outdated Show resolved Hide resolved
pkg/sparrow/run.go Outdated Show resolved Hide resolved
pkg/sparrow/run.go Show resolved Hide resolved
pkg/sparrow/run.go Show resolved Hide resolved
pkg/api/api.go Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Outdated Show resolved Hide resolved
pkg/api/api.go Show resolved Hide resolved
@lvlcn-t lvlcn-t merged commit ea6fdca into main Feb 8, 2024
11 checks passed
@lvlcn-t lvlcn-t deleted the refactor/api branch February 8, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Issues/PRs related to the API housekeeping refactoring Refactoring of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup API with dynamic Handler
3 participants