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

draft: reproduce issue #1

Draft
wants to merge 5 commits into
base: feat/ep-with-PROJECT
Choose a base branch
from

Conversation

Eileen-Yu
Copy link
Owner

@Eileen-Yu Eileen-Yu commented Aug 31, 2023

Description:

This is a draft PR only to reproduce the issue I met when trying to switch cfg from string to v3/cfg go struct.

This main problem is the default definition in v3/cfg for version is a Version struct.
This would cause error when marshalling / unmarshalling as it would be :

{
  ...
  "command": "create webhook",
  ...
  "config": {
    "version": "3"
    ...
  }
}

@Eileen-Yu Eileen-Yu changed the base branch from master to feat/ep-with-PROJECT August 31, 2023 16:28
@@ -37,7 +40,7 @@ type PluginRequest struct {
Universe map[string]string `json:"universe"`

// Config stores the project configuration file.
Config string `json:"config"`
Config v3.Cfg `json:"config"`
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is where the v3/cfg is used for the config definition.

@@ -52,13 +56,26 @@ func (p *createAPISubcommand) BindFlags(fs *pflag.FlagSet) {
}

func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
configBytes, err := yaml.Marshal(p.config)
Copy link
Owner Author

Choose a reason for hiding this comment

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

The marshalling would fail as p.config does not respect v3/cfg.

@Eileen-Yu Eileen-Yu force-pushed the feat/ep-with-PROJECT branch 2 times, most recently from a0ba688 to 65ae4a3 Compare February 15, 2024 04:26
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.

1 participant