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

feat(file): add render command #874

Closed
wants to merge 3 commits into from
Closed

feat(file): add render command #874

wants to merge 3 commits into from

Conversation

zekth
Copy link
Member

@zekth zekth commented Mar 23, 2023

Proposal of a new format for convert command. Possible things to address:

  • Mocking the env variables
  • compatibility with older kong versions

@zekth zekth temporarily deployed to Configure ci March 23, 2023 14:28 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 09:32 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 09:32 — with GitHub Actions Inactive
@zekth zekth changed the title feat(render): add new command feat(convert): add new format Mar 24, 2023
@zekth zekth temporarily deployed to Configure ci March 24, 2023 09:37 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 09:37 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 13:30 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 13:31 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 13:35 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 13:36 — with GitHub Actions Inactive
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 21.31% and project coverage change: -0.08 ⚠️

Comparison is base (3184491) 35.59% compared to head (a964bb6) 35.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #874      +/-   ##
==========================================
- Coverage   35.59%   35.52%   -0.08%     
==========================================
  Files          92       92              
  Lines       11273    11309      +36     
==========================================
+ Hits         4013     4017       +4     
- Misses       6867     6897      +30     
- Partials      393      395       +2     
Impacted Files Coverage Δ
cmd/convert.go 0.00% <0.00%> (ø)
convert/convert.go 74.26% <23.07%> (-15.10%) ⬇️
file/writer.go 14.86% <23.52%> (+0.32%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zekth zekth temporarily deployed to Configure ci March 24, 2023 14:08 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 14:08 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 14:11 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 24, 2023 14:11 — with GitHub Actions Inactive
@zekth zekth changed the title feat(convert): add new format feat(convert): add distributed format Mar 24, 2023
@zekth zekth marked this pull request as ready for review March 24, 2023 14:17
@zekth zekth requested a review from a team as a code owner March 24, 2023 14:17
@zekth zekth temporarily deployed to Configure ci March 26, 2023 10:03 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 26, 2023 10:03 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 27, 2023 11:58 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 27, 2023 11:58 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 27, 2023 12:00 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci March 27, 2023 12:00 — with GitHub Actions Inactive
convert/convert.go Outdated Show resolved Hide resolved
convert/convert.go Outdated Show resolved Hide resolved
convert/convert.go Outdated Show resolved Hide resolved
convert/convert.go Outdated Show resolved Hide resolved
convert/convert.go Outdated Show resolved Hide resolved
convert/convert.go Outdated Show resolved Hide resolved
file/readfile.go Show resolved Hide resolved
file/readfile.go Show resolved Hide resolved
convert/convert.go Outdated Show resolved Hide resolved
@zekth zekth temporarily deployed to Configure ci April 12, 2023 07:54 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci April 12, 2023 07:54 — with GitHub Actions Inactive

// convertDistributedToKong is used to convert one or many distributed format
// files to create one Kong Gateway declarative config. It also leverages some
// deck features like the defaults/centralized plugin configurations.
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO: add link to official Kong documentation here

@zekth zekth temporarily deployed to Configure ci April 13, 2023 12:23 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci April 13, 2023 12:23 — with GitHub Actions Inactive
@GGabriele
Copy link
Collaborator

@zekth it seems a test is failing due to some nil reference:

=== RUN   Test_Convert/converts_from_distributed_to_kong_gateway_(no_deck_specific_fields)
--- FAIL: Test_Convert (0.24s)
    --- PASS: Test_Convert/errors_out_due_to_invalid_conversion (0.03s)
    --- PASS: Test_Convert/errors_out_due_to_invalid_conversion#01 (0.02s)
    --- PASS: Test_Convert/errors_out_when_a_nameless_service_is_present_in_the_input (0.01s)
    --- PASS: Test_Convert/errors_out_when_input_file_doesn't_exist (0.00s)
    --- PASS: Test_Convert/converts_from_Kong_Gateway_to_Konnect_format (0.09s)
    --- PASS: Test_Convert/converts_from_Kong_Gateway_2.x_to_Kong_Gateway_3.x_format (0.04s)
    --- PASS: Test_Convert/converts_from_Kong_Gateway_2.x_to_Kong_Gateway_3.x_format_(no__format_version_input) (0.04s)
    --- FAIL: Test_Convert/converts_from_distributed_to_kong_gateway_(no_deck_specific_fields) (0.01s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb421ef]

Would you mind checking?

@zekth zekth temporarily deployed to Configure ci April 17, 2023 16:21 — with GitHub Actions Inactive
@zekth zekth temporarily deployed to Configure ci April 17, 2023 16:21 — with GitHub Actions Inactive
@zekth zekth force-pushed the feat/deck-render branch 2 times, most recently from a99388b to 1b238b4 Compare June 15, 2023 21:53
@Tieske Tieske added this to the 1.24.0 milestone Jul 14, 2023
@Tieske
Copy link
Member

Tieske commented Jul 14, 2023

As per internal discussion, this functionality is to land in its own command "render", which is to be a subcommand of the new "file" command.

Since the "file" command is introduced in #939 , it makes sense to target that branch for now, instead of main.

@zekth zekth changed the base branch from main to feat/apiops July 14, 2023 12:56
@zekth zekth changed the title feat(convert): add distributed format feat(file): add render command Jul 14, 2023
Base automatically changed from feat/apiops to main July 14, 2023 16:11
@Tieske
Copy link
Member

Tieske commented Jul 14, 2023

closing in favour of #963

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