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

Add validation for draft annotations #71

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

asparuhft
Copy link

@asparuhft asparuhft commented Mar 25, 2024

Description

What

  • Add validation for draft annotations
  • Replace logrus with ft logger
  • Replace vestigo with mux

Why

JIRA Ticket UPPSF-4927

Anything, in particular, you'd like to highlight to reviewers

Mention here sections of code which you would like reviewers to pay extra attention to .E.g

Would appreciate a second pair of eyes on the test
I am not quite sure how this bit works
Is there a better library for doing x

Scope and particulars of this PR (Please tick all that apply)

  • Tech hygiene (dependency updating & other tech debt)
  • Bug fix
  • Feature
  • Documentation
  • Breaking change
  • Minor change (e.g. fixing a typo, adding config)

DoD - Ensure all relevant tasks are completed before marking this PR as "Ready for review"

  • Test coverage is not significantly decreased
  • All PR checks have passed
  • Changes are deployed on dev before asking for review
  • Documentations remains up-to-date
    • OpenAPI definition file is updated
    • README file is updated
    • Documentation is updated in upp-docs and upp-public-docs
    • Architecture diagrams are updated

This Pull Request follows the rules described in our Pull Requests Guide

@asparuhft asparuhft requested a review from a team as a code owner March 25, 2024 13:54
Copy link
Contributor

@ManoelMilchev ManoelMilchev left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -68,13 +69,14 @@ type UPPAnnotationsAPI struct {
endpointTemplate string
username string
password string
httpClient *http.Client
httpClient *http.Client ``
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Are the ticks "``" some kind of leftover here, or they do something I don't know ?

Copy link
Author

Choose a reason for hiding this comment

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

It is some kind of leftover :)


r.Patch("/drafts/content/:uuid/annotations/:cuuid", h.ReplaceAnnotation)
r.HandleFunc("/drafts/content/{uuid}/annotations/{cuuid}", h.ReplaceAnnotation).Methods("PATCH")
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick (non-blocking): I really like to use the http constants when using the Methods functionality, it's just beautiful.

Suggested change
r.HandleFunc("/drafts/content/{uuid}/annotations/{cuuid}", h.ReplaceAnnotation).Methods("PATCH")
r.HandleFunc("/drafts/content/{uuid}/annotations/{cuuid}", h.ReplaceAnnotation).Methods(http.MethodPatch)

Copy link
Author

Choose a reason for hiding this comment

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

Done

@ManoelMilchev ManoelMilchev requested a review from a team March 27, 2024 09:21
@coveralls
Copy link

Coverage Status

coverage: 78.506% (-0.6%) from 79.086%
when pulling db22cd3 on feature/UPPSF-4927-validate
into b302f2d on publishing-cluster.

Copy link
Contributor

@ManoelMilchev ManoelMilchev left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@angelraynovft angelraynovft left a comment

Choose a reason for hiding this comment

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

LGTM

@asparuhft asparuhft merged commit 20f532d into publishing-cluster Mar 28, 2024
3 checks passed
@asparuhft asparuhft deleted the feature/UPPSF-4927-validate branch March 28, 2024 08:39
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.

None yet

4 participants