Skip to content

feat: extensions readme generator #191

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

Merged
merged 12 commits into from
Jun 21, 2023

Conversation

migmartri
Copy link
Member

@migmartri migmartri commented Jun 20, 2023

Generator that updates the loaded extensions Readme files with the input JSON schemas in both raw and table mode.

This generator is now part of the extension development process. The CI checks that the readmes are up to date.

This patch also

  • updates some of the extension directories/names to be consistent. i.e extension id == directory-name
  • Updates all the readme files
  • Factors out some of the code related to schema properties mapping, extracting them from the CLI and moving them to the SDK
  • This generator is idempotent and works in both the cases where the section to populate exists or not.

Example

Registration Input Schema

Field Type Required Description
password string yes OCI repository password
repository string yes OCI repository uri and path
username string yes OCI repository username
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/chainloop-dev/chainloop/app/controlplane/extensions/core/oci-registry/v1/registration-request",
  "properties": {
    "repository": {
      "type": "string",
      "minLength": 1,
      "description": "OCI repository uri and path"
    },
    "username": {
      "type": "string",
      "minLength": 1,
      "description": "OCI repository username"
    },
    "password": {
      "type": "string",
      "minLength": 1,
      "description": "OCI repository password"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "repository",
    "username",
    "password"
  ]
}

Attachment Input Schema

Field Type Required Description
prefix string no OCI images name prefix (default chainloop)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/chainloop-dev/chainloop/app/controlplane/extensions/core/oci-registry/v1/attachment-request",
  "properties": {
    "prefix": {
      "type": "string",
      "minLength": 1,
      "description": "OCI images name prefix (default chainloop)"
    }
  },
  "additionalProperties": false,
  "type": "object"
}
  • Refactor generator code
  • Add generator make target
  • Run in CI

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri marked this pull request as ready for review June 20, 2023 22:12
@migmartri migmartri requested a review from danlishka June 20, 2023 22:12
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri requested a review from danlishka June 21, 2023 08:22

See https://docs.chainloop.dev/guides/dependency-track/


Copy link
Member

Choose a reason for hiding this comment

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

Should we have a separate section with an info on which materials, attestations are supported?

### Supported metadata
The following metadata are supported by this extension:

Materials: CycloneDX
Attestations:  unsupported

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this could be used as a baseline. The scope was just schema for now. but I could see value in generating description input types and so on. Should we do it in another diff?

Copy link
Member

@danlishka danlishka left a comment

Choose a reason for hiding this comment

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

LGTM I would also add which metadata are supported in the future

@migmartri migmartri merged commit 6cc5906 into chainloop-dev:main Jun 21, 2023
@migmartri migmartri deleted the extensions-readme-generator branch June 21, 2023 08:32
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.

2 participants