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

fix: improve errors when running against Konnect with workspace config #696

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

GGabriele
Copy link
Collaborator

No description provided.

@GGabriele GGabriele requested a review from a team as a code owner June 7, 2022 07:06
pmalek
pmalek previously approved these changes Jun 7, 2022
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
cmd/common.go Outdated Show resolved Hide resolved
@GGabriele GGabriele requested a review from a team June 15, 2022 06:23
@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2022

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 39.79%. Comparing base (1b875f7) to head (05f0bcd).
Report is 442 commits behind head on main.

Files with missing lines Patch % Lines
cmd/common.go 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #696      +/-   ##
==========================================
- Coverage   39.82%   39.79%   -0.04%     
==========================================
  Files          87       87              
  Lines        9875     9884       +9     
==========================================
  Hits         3933     3933              
- Misses       5563     5572       +9     
  Partials      379      379              

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

cmd/common.go Outdated
@@ -101,6 +101,14 @@ func syncMain(ctx context.Context, filenames []string, dry bool, parallelism,
var kongClient *kong.Client
mode := getMode(targetContent)
if mode == modeKonnect {
if targetContent.Workspace != "" {
return fmt.Errorf("_workspace set in config file.\n" +
Copy link

@jrsmroz jrsmroz Jun 15, 2022

Choose a reason for hiding this comment

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

Does it need to be multi line error message (\n)?

@hbagdi
Copy link
Member

hbagdi commented Aug 10, 2022

Please rebase.

@GGabriele GGabriele force-pushed the fix/workspace-konnect branch from 9ef8a61 to 5810ada Compare August 17, 2022 15:14
@GGabriele GGabriele temporarily deployed to Configure ci August 17, 2022 15:15 Inactive
@GGabriele GGabriele temporarily deployed to Configure ci August 17, 2022 15:15 Inactive
@GGabriele
Copy link
Collaborator Author

Please rebase.

done

@GGabriele GGabriele temporarily deployed to Configure ci August 17, 2022 15:21 Inactive
@GGabriele GGabriele temporarily deployed to Configure ci August 17, 2022 15:21 Inactive
CHANGELOG.md Outdated Show resolved Hide resolved
@GGabriele GGabriele force-pushed the fix/workspace-konnect branch from 5810ada to 5f184eb Compare August 17, 2022 15:25
@GGabriele GGabriele temporarily deployed to Configure ci August 17, 2022 15:25 Inactive
@GGabriele GGabriele temporarily deployed to Configure ci August 17, 2022 15:25 Inactive
@GGabriele GGabriele force-pushed the fix/workspace-konnect branch from 5f184eb to de491a8 Compare August 18, 2022 18:03
@GGabriele GGabriele temporarily deployed to Configure ci August 18, 2022 18:03 Inactive
@GGabriele GGabriele temporarily deployed to Configure ci August 18, 2022 18:03 Inactive
cmd/common.go Outdated
if targetContent.Workspace != "" {
return fmt.Errorf("_workspace set in config file.\n" +
"Workspaces are not supported in Konnect. " +
"Please remove '_workspace: foo' from your configuration and try again")
Copy link
Member

Choose a reason for hiding this comment

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

'foo' seems to be a copy-paste error. Could you please update the error message to include the workspace that the user has provided?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

$ ./deck sync --konnect-token $TOKEN_DEV
Error: _workspace set in config file.
Workspaces are not supported in Konnect. Please remove '_workspace: test' from your configuration and try again

@GGabriele GGabriele force-pushed the fix/workspace-konnect branch from de491a8 to 02f125d Compare August 18, 2022 22:40
@GGabriele GGabriele temporarily deployed to Configure ci August 18, 2022 22:40 Inactive
@GGabriele GGabriele temporarily deployed to Configure ci August 18, 2022 22:40 Inactive
@GGabriele GGabriele requested a review from hbagdi August 18, 2022 23:36
@GGabriele GGabriele force-pushed the fix/workspace-konnect branch from 02f125d to 05f0bcd Compare September 26, 2022 13:30
@GGabriele GGabriele temporarily deployed to Configure ci September 26, 2022 13:30 Inactive
@GGabriele GGabriele temporarily deployed to Configure ci September 26, 2022 13:30 Inactive
@GGabriele GGabriele merged commit c7262ae into main Sep 26, 2022
@GGabriele GGabriele deleted the fix/workspace-konnect branch September 26, 2022 14:30
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.

5 participants