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(ui): stop using /meta/config endpoint #3684

Merged
merged 2 commits into from
Dec 5, 2024
Merged

Conversation

erka
Copy link
Collaborator

@erka erka commented Dec 3, 2024

/meta/config exposes too much configuration and UI doesn't need that much. There were few leakage of the secrets as people provide configuration options in their way and that fire seem never to stop.
The global idea is to drop /meta/config endpoint and this is a first step to it.

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 86.95652% with 6 lines in your changes missing coverage. Please review.

Project coverage is 64.56%. Comparing base (ae0caa8) to head (929704f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/flipt/main.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3684      +/-   ##
==========================================
+ Coverage   64.41%   64.56%   +0.15%     
==========================================
  Files         170      170              
  Lines       17098    17132      +34     
==========================================
+ Hits        11013    11061      +48     
+ Misses       5400     5382      -18     
- Partials      685      689       +4     
Flag Coverage Δ
unittests 64.56% <86.95%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@erka erka force-pushed the rd/rework-ui-config branch 2 times, most recently from ec271f2 to 48b800c Compare December 3, 2024 22:30
@erka
Copy link
Collaborator Author

erka commented Dec 3, 2024

@markphelps I have to add few tests but I looking for feedback on this.

@erka erka force-pushed the rd/rework-ui-config branch from 48b800c to 0bfccce Compare December 4, 2024 09:03
@erka erka marked this pull request as ready for review December 4, 2024 09:16
@erka erka requested a review from a team as a code owner December 4, 2024 09:16
@@ -3,19 +3,27 @@ package info
import (
"encoding/json"
"net/http"

"go.flipt.io/flipt/internal/config"
)

type Flipt struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have an opportunity to refactor this info API endpoint now I think?

maybe we should make the response it a bit more structured, something like:

{
  version: {
    current:
    latest: {
      version:
      URL:
    },
   build: {
    date: ,
    commit:
    goVersion:
    release:
   },
   authentication: {
    required: 
   },
   analytics: {
     enabled:
   },
   storage: {
    ...
  },
}

this would be an API response breaking change, but since the API is not documented for this endpoint maybe its ok?

wdyt?

Copy link
Collaborator Author

@erka erka Dec 5, 2024

Choose a reason for hiding this comment

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

@markphelps I’ve updated the new fields to match the desired format. However, I'm not ready to update old fields in this PR, as it would introduce too many changes at once.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That sounds good to me

@erka erka force-pushed the rd/rework-ui-config branch from 0bfccce to 9cf73cd Compare December 5, 2024 20:12
@erka erka force-pushed the rd/rework-ui-config branch from 9cf73cd to c224ce5 Compare December 5, 2024 20:23
Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

this looks great! thank you @erka

@erka erka force-pushed the rd/rework-ui-config branch from c224ce5 to 929704f Compare December 5, 2024 20:28
Signed-off-by: Roman Dmytrenko <[email protected]>
@erka erka merged commit 611382a into main Dec 5, 2024
39 checks passed
@erka erka deleted the rd/rework-ui-config branch December 5, 2024 20:53
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.

2 participants