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

Unexpected behaviour of cpflow generate command #218

Closed
zzaakiirr opened this issue Jul 24, 2024 · 5 comments · Fixed by #219
Closed

Unexpected behaviour of cpflow generate command #218

zzaakiirr opened this issue Jul 24, 2024 · 5 comments · Fixed by #219
Assignees

Comments

@zzaakiirr
Copy link
Contributor

Command

cpflow generate command's description states:

Description:
  Creates base Control Plane config and template files

  # Creates .controlplane directory with Control Plane config and other templates
  cpflow generate

Expected behaviuor

User expects that invoking this command will create .controlplane directory with basic config and templates

Actual behaviuor

Command fails with error:

ERROR: Can't find project config file at 'project_folder/.controlplane/controlplane.yml', please create it.
@borela
Copy link
Member

borela commented Jul 24, 2024

@rafaelgomesxyz can we change the behavior of the command so that if the user doesn't provide the project config, it generates a default one?

@rafaelgomesxyz
Copy link
Collaborator

@borela This is definitely a bug, it should generate a config file by default. We even have a template for it: https://github.com/shakacode/control-plane-flow/blob/main/lib/generator_templates/controlplane.yml

@rafaelgomesxyz
Copy link
Collaborator

@zzaakiirr This is most likely because VALIDATIONS = [].freeze is missing from Command::Generate. I forgot to add it there when I added the doctor command.

@zzaakiirr
Copy link
Contributor Author

@zzaakiirr This is most likely because VALIDATIONS = [].freeze is missing from Command::Generate. I forgot to add it there when I added the doctor command.

You are right, adding VALIDATIONS = [].freeze to Command::Generate fixed the issue - now expected directory and files are created

@rafaelgomesxyz Can I open PR for this or will you work on this? We need to fix test for this too (spec/command/generate_spec.rb:30)

@rafaelgomesxyz
Copy link
Collaborator

Feel free to open it.

@rafaelgomesxyz rafaelgomesxyz changed the title Unexpected behaviour of cplfow generate command Unexpected behaviour of cpflow generate command Jul 24, 2024
@zzaakiirr zzaakiirr self-assigned this Jul 24, 2024
@rafaelgomesxyz rafaelgomesxyz linked a pull request Aug 20, 2024 that will close this issue
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 a pull request may close this issue.

3 participants