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

267: Add http json functionality #293

Merged
merged 7 commits into from
Apr 4, 2024

Conversation

paulfgrant01
Copy link
Contributor

@paulfgrant01 paulfgrant01 commented Mar 25, 2024

based on Issue 267
This provider will retrieve a single key from a JSON structure hosted by an HTTP frontend. The signature will require both the domain and the xpath e.g.

ref+httpjson://<DOMAIN>/<PATH>?[insecure=false&floatAsInt=false]#/<XPATH>

@paulfgrant01 paulfgrant01 force-pushed the feature/httpjson#267 branch 3 times, most recently from 469266f to 60e0d66 Compare March 25, 2024 22:03
Signed-off-by: Paul Grant <paulfgrant01@gmail.com>
@paulfgrant01 paulfgrant01 force-pushed the feature/httpjson#267 branch from 60e0d66 to d772c10 Compare March 25, 2024 22:07
@yxxhero
Copy link
Member

yxxhero commented Mar 26, 2024

@paulfgrant01 please fix lint issue.

…ck json server to run testing against

Signed-off-by: Paul Grant <pgrant@williamhill.us>
@paulfgrant01 paulfgrant01 force-pushed the feature/httpjson#267 branch from 471abeb to bbfdac5 Compare March 26, 2024 14:29
"strconv"
"strings"

// nolint
Copy link
Member

Choose a reason for hiding this comment

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

nolint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in favor of:

gci write -s standard -s default -s "prefix(github.com/helmfile/vals)" pkg/providers/httpjson/httpjson.go

vals.go Outdated
@@ -367,6 +372,7 @@ func (r *Runtime) prepare() (*expansion.ExpandRegexMatch, error) {
}

return str, nil

Copy link
Member

Choose a reason for hiding this comment

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

extra empty lint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this line 👍

Signed-off-by: Paul Grant <paulfgrant01@gmail.com>
@paulfgrant01 paulfgrant01 force-pushed the feature/httpjson#267 branch from 70c1ff8 to 3c00eb7 Compare March 27, 2024 14:30
return p
}

func GetXpathFromUri(uri string) (xpath string, err error) {
Copy link
Member

Choose a reason for hiding this comment

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

what will happen if uri is empty? and add unittest for function as possible as you can. thanks so much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added unit testing 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you 🙏

… various fixes

Signed-off-by: Paul Grant <paulfgrant01@gmail.com>
… various fixes

Signed-off-by: Paul Grant <paulfgrant01@gmail.com>
vals_httpjson_test.go Outdated Show resolved Hide resolved
Signed-off-by: Paul Grant <paulfgrant01@gmail.com>
Signed-off-by: Paul Grant <paulfgrant01@gmail.com>
@yxxhero yxxhero merged commit 1e50c98 into helmfile:main Apr 4, 2024
4 checks passed
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