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

Sharing label definitions #82

Closed
lachmanfrantisek opened this issue Apr 12, 2018 · 5 comments
Closed

Sharing label definitions #82

lachmanfrantisek opened this issue Apr 12, 2018 · 5 comments

Comments

@lachmanfrantisek
Copy link
Member

lachmanfrantisek commented Apr 12, 2018

We need to provide the solution allowing:

  • Have one definition for one label (description, links, ..)
  • Allow using the same definition for the image, container and dockerfile
  • Allow specifying target type for the check in ruleset JSON.

Related to #78


When we are in changing of the ruleset file structure, what about some metadata/versioning.
(Or move check groups from the root level to be able to extend the scheme.)

@lachmanfrantisek
Copy link
Member Author

First approach

  • Encapsulate filtered checks into the dictionary:
{
  "labels": {
    "required": [
      "name",
      "release_capital_deprecated",
      {
        "type": [
          "Container",
          "Image"
        ],
        "checks": [
          "architecture",
          "com_redhat_build-host",
          "authoritative-source-url",
          "vendor",
          "release",
          "url",
          "build-date",
          "distribution-scope",
          "vcs-ref",
          "vcs-type"
        ]
      }
    ],
    "optional": [
    ]
  },
  "best_practices": {
    "required": [
      "help_file",
      "cmd_or_entrypoint",
      "no_root"
    ],
    "optional": [
    ]
  }
}

@lachmanfrantisek
Copy link
Member Author

Second approach

  • Specify type per check
{
  "labels": {
    "required": [
      "name",
      "release_capital_deprecated",
      {
        "name": "architecture",
        "type": [
          "Container",
          "Image"
        ]
      },
      {
        "name": "com_redhat_build-host",
        "type": [
          "Container",
          "Image"
        ]
      }
    ],
    "optional": [
    ]
  },
  "best_practices": {
    "required": [
      "help_file",
      "cmd_or_entrypoint",
      "no_root"
    ],
    "optional": [
    ]
  }
}

@TomasTomecek
Copy link
Member

I like the first approach.

@phracek
Copy link
Member

phracek commented Apr 12, 2018

First approach looks better but what do you think about this:

{
  "labels": {
    "required": [
      "name",
      "release_capital_deprecated",
      "architecture": { "type": [ "Container", "Image" ] }
      "com_redhat_build-host" : {  "type": [ "Container", "Image" ] }
    ],
    "optional": [
    ]
  },
  "best_practices": {
    "required": [
      "help_file",
      "cmd_or_entrypoint",
      "no_root"
    ],
    "optional": [
    ]
  }
}

@lachmanfrantisek
Copy link
Member Author

@phracek Sadly, it's not a valid JSON.

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

No branches or pull requests

3 participants