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

chore(cli): improve warnings #1115

Merged
merged 3 commits into from
Dec 13, 2023
Merged

chore(cli): improve warnings #1115

merged 3 commits into from
Dec 13, 2023

Conversation

Tieske
Copy link
Member

@Tieske Tieske commented Nov 19, 2023

2 commits;

  • describe changes when switching to new commands
  • diplay message when reading from stdin

EDIT: 2nd commit moved here: Kong/go-database-reconciler#17

@Tieske Tieske requested a review from a team November 19, 2023 19:21
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2023

Codecov Report

Attention: 39 lines in your changes are missing coverage. Please review.

Comparison is base (fdb5b59) 5.95% compared to head (2486281) 5.91%.
Report is 1 commits behind head on main.

Files Patch % Lines
cmd/gateway_validate.go 0.00% 9 Missing ⚠️
cmd/gateway_diff.go 0.00% 7 Missing ⚠️
cmd/file_convert.go 0.00% 6 Missing ⚠️
cmd/gateway_sync.go 0.00% 6 Missing ⚠️
cmd/gateway_dump.go 0.00% 5 Missing ⚠️
cmd/gateway_ping.go 0.00% 3 Missing ⚠️
cmd/gateway_reset.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1115      +/-   ##
========================================
- Coverage   5.95%   5.91%   -0.04%     
========================================
  Files         31      31              
  Lines       3126    3144      +18     
========================================
  Hits         186     186              
- Misses      2930    2948      +18     
  Partials      10      10              

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

@mheap
Copy link
Member

mheap commented Nov 19, 2023

Based on feedback so far I think we should keep -s as the default, even in the new aliases. It should be a 1:1 implementation for the existing command (with positional arguments in place so that we don't break BC for people that already migrated).

With that in mind, this PR provides inaccurate guidance and shouldn't be merged.

@rspurgeon
Copy link
Collaborator

As discussed, let's make -s/--state and positional arguments for the gateway commands both supported and I think we should change the documentation to say something like the following that indicates why a user may want to switch from the -s to positional:

Use 'deck gateway diff' instead.
Note:
  - see 'deck gateway diff --help' for changes to the command\n"+
  - The new command supports the '-s/--state' flag for backward compatibility but also supports specifying state files as positional arguments which allows for alternative shell expansions (`*.yaml`).

@mheap
Copy link
Member

mheap commented Nov 20, 2023

We shouldn’t provide two ways to do the same thing long term. If positional arguments are the future, then the PR is ok, but I’d like @hbagdi to sign off. We chose flags for a reason in the original design

@rspurgeon
Copy link
Collaborator

My feedback is driven to help a user understand the differences in capabilities of the two options, which it seems we have established are staying in the tool (-s to maintain BC and positional to maintain BC with early adopters). IIUC the two options provide different capabilities on the shell, so we should document that.

@RobSerafini
Copy link

@Tieske Is the CI failing because you tried to remove code coverage from the CI? Can we separate the warnings work from the code coverage change?

@Tieske
Copy link
Member Author

Tieske commented Nov 27, 2023

@RobSerafini just flaky CI

@rspurgeon
Copy link
Collaborator

Here is the change that needs to occur with the current deprecation messages for all commands that have been marked deprecated by this change.

Currently the messages read as follows:

Warning: 'deck sync' is DEPRECATED and will be removed in a future version. Use 'deck gateway sync' instead.

These will change to:

Info: 'deck sync' functionality has moved to `deck gateway sync` and will be removed in a future MAJOR version of deck. Migration to `deck gateway sync` is recommended.
    Note:
        - see 'deck gateway sync --help' for changes to the command
	- files changed to positional arguments without the '-s/--state' flag
	- the default changed from 'kong.yaml' to '-' (stdin/stdout)

rspurgeon
rspurgeon previously approved these changes Dec 8, 2023
Copy link
Collaborator

@rspurgeon rspurgeon left a comment

Choose a reason for hiding this comment

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

lgtm

@rspurgeon
Copy link
Collaborator

@Kong/team-deck can we get this merged in and a release built? tag @teb510

@RobSerafini
Copy link

@mikefero @mflendrich - I think this just needs an approval and merge and a new build of Deck. Can you guys help move this along?

cmd/file_convert.go Outdated Show resolved Hide resolved
Co-authored-by: Gabriele <gabrielegerbino@gmail.com>
Copy link
Collaborator

@GGabriele GGabriele left a comment

Choose a reason for hiding this comment

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

Added a minor comment. Otherwise, LGTM

@Tieske Tieske changed the title improve warnings chore(cli): improve warnings Dec 13, 2023
@Tieske Tieske merged commit 675a51c into main Dec 13, 2023
35 checks passed
@Tieske Tieske deleted the warnings branch December 13, 2023 15:26
AntoineJac pushed a commit that referenced this pull request Jan 23, 2024
Co-authored-by: Gabriele <gabrielegerbino@gmail.com>
Co-authored-by: Rick Spurgeon <rspurgeon@users.noreply.github.com>
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.

6 participants