Skip to content

Proposal: code generation output metadata #809

@a-hilaly

Description

@a-hilaly

Is your feature request related to a problem?
Currently it is not possible to know what aws-sdk-go or code-generator versions were used to generate a certain controller. Which makes it harder for new contributors to get hands on already generated controllers. Also current contributors are prone to make mistakes easily and frequently shoot them self in the foot (e.g me with ecr and dynamodb)

Describe the solution you'd like
When calling ack-generate it would be useful if we can create a file called ack-output.json where we can store the last ENV vars and parameters used to generate the controller. Additionally we can use the same file to continue generating controllers using the same flags (defaulting the ENV vars to ack-output.json stored metadata if they exist)

Thinking something similar to:

{
    "lastUpdated": "jeu. 03 juin 2021 13:27:10 CEST",
    "ack-generate" : {
        "version": "v0.2.1",
        "apisArgs": "--version v1alpha1 --generator-config-path ./somedir",
        "controllerArgs": "--version v1alpha1 --generator-config-path ./somedir",
        "releaseArgs": ""
    },
    "controller-gen": {
        "version": "v0.4.0",
        "crdArgs": "crd:allowDangerousTypes=true paths=./... output:crd:artifacts:config=/somedir/crd/bases",
        "rbacArgs": "rbac:roleName=ackrole paths=./... output:rbac:artifacts:config=/somedir/rbac"
    },
    "env" : {
        "AWS_SDK_GO_VERSION": "v1.33.35"
        ...
    }
}

I'm not sure if this is something that should go to ackdev or be implemented in scripts/build-controller.sh

Describe alternatives you've considered
Another alternative would be to put some of this metadata in the Go files boilerplates.

/priority awaiting-more-evidence
/cc @aws-controllers-k8s/code-generator-maintainer

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/code-generationIssues or PRs as related to controllers or docs code generationkind/enhancementCategorizes issue or PR as related to existing feature enhancements.priority/awaiting-more-evidenceLowest priority. Possibly useful, but not yet enough support to actually get it done.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions