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
@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2022

Codecov Report

Merging #696 (3e3e4f7) into main (c48421b) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #696      +/-   ##
==========================================
- Coverage   43.50%   43.46%   -0.04%     
==========================================
  Files          74       74              
  Lines        8923     8931       +8     
==========================================
  Hits         3882     3882              
- Misses       4671     4679       +8     
  Partials      370      370              
Impacted Files Coverage Δ
cmd/common.go 5.41% <0.00%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c48421b...3e3e4f7. Read the comment docs.

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 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 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 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 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 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.

None yet

5 participants