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

Command to create a "scaffolding" for module creation #1742

Closed
9 tasks done
janmedrek opened this issue Aug 23, 2023 · 0 comments · Fixed by #1859
Closed
9 tasks done

Command to create a "scaffolding" for module creation #1742

janmedrek opened this issue Aug 23, 2023 · 0 comments · Fixed by #1859
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@janmedrek
Copy link
Contributor

janmedrek commented Aug 23, 2023

Description

Some time ago we introduced a new way of creating modules - by providing a specific metadata file and basic information on the module.

It requires quite a vast input in the form of different files, it would be great to have a command for creating empty files that can be populated with data by the module creator.

Reasons

We want to have a smooth experience for the module creation.

Acceptance Criteria

  • Command to generate input scaffolding available
  • Metadata YAML is always created
  • For the required fields add an option to pass the values inline and have them already filled in the generated files
  • Parameters to control which additional files are generated:
    • defaultCR YAML
    • manifest YAML
      • Empty yaml file named manifest.yaml
    • security scanners config YAML
    • File references in metadata YAML are provided upfront and point to generated files (depending on the listed above)
    • Generated files have a generated structure/description of what should be put into them
      • think about creating a file structure and adding field explanations
  • Fields and files have their explanations and placeholders in them, for example (see examples in the Attachments section)
  • File descriptions and explanations aligned with the Technical Writers
  • Find a way to introduce proper testing related to the create command chaining with scaffolding of modul-config (write a test or create a ticket with a proposal)

Attachments

Example for generated metadata YAML (make sure it is up-to-date with the features create module command):

name:         # required (string), the name of the Module
channel:           # required (string), channel that should be used in the ModuleTemplate
version:           # required (string), the version of the Module
# resourceName:      # optional (string), default={NAME}-{CHANNEL}, the name for the ModuleTemplate that will be created

manifest:         # required (string), reference to the manifests, can be a name of a file or whole directory
# security:          # optional (string), name of the security scanners config file
# defaultCR:       #optional (string), reference to a YAML file containing the default CR for the module, must be a relative file name

#internal:            # optional (bool), default=false, determines whether the ModuleTemplate should have the internal flag or not
#beta:                # optional (bool), default=false, determines whether the ModuleTemplate should have the beta flag or not

#labels:                   # optional, additional labels for the ModuleTemplate
#  - operator.kyma-project.io/label={LABEL}
#annotations:              # optional, additional annotations for the ModuleTemplate
#  - operator.kyma-project.io/doc-url={DOCUMENTATION_URL}

Example for generated metadata defaultCR file (make sure it is up-to-date with the features create module command):

# This is the file that contains the defaultCR for your module, which is the Custom Resource that will be created upon module enablement.
# Make sure this file contains *ONLY* the Custom Resource (not the Custom Resource Definition, which should be a part of your module manifest)

Example for generated metadata security scanners config file (make sure it is up-to-date with the features create module command):

module-name: # string, name of your module
protecode: # includes the list of images which must be scanned by the Protecode scanner (aka. Black Duck Binary Analysis)
  - europe-docker.pkg.dev/kyma-project/prod/myimage:1.2.3
  - europe-docker.pkg.dev/kyma-project/prod/external/ghcr.io/mymodule/anotherimage:4.5.6
whitesource: # whitesource (aka. Mend) security scanner specific configuration
  language: # string, indicating the programming language the scanner has to analyze.
  exclude: # the list of directories within the repository which should not be scanned
    - "**/test/**"
    - "**/*_test.go"
@janmedrek janmedrek added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 23, 2023
@amritanshusikdar amritanshusikdar self-assigned this Oct 12, 2023
@amritanshusikdar amritanshusikdar removed their assignment Nov 3, 2023
@LeelaChacha LeelaChacha self-assigned this Nov 6, 2023
LeelaChacha added a commit to LeelaChacha/kyma-cli that referenced this issue Nov 27, 2023
…folding-command

# Conflicts:
#	pkg/module/security_scan.go
@LeelaChacha LeelaChacha removed their assignment Nov 27, 2023
@Tomasz-Smelcerz-SAP Tomasz-Smelcerz-SAP self-assigned this Nov 29, 2023
LeelaChacha added a commit to LeelaChacha/kyma-cli that referenced this issue Dec 3, 2023
@lindnerby lindnerby removed their assignment Dec 19, 2023
@LeelaChacha LeelaChacha self-assigned this Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants