Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Conversation

@jodh-intel
Copy link

Add new tooling to handle GitHub labels. This includes:

  • A YAML template file (the master "labels database")

    This contains the master set of labels to be used for all Kata repositories. All labels have descriptions and a category.

  • A script to generate the combined set of labels

    This merges the master set of labels with an optional repository-specific set of labels to produce a combined set of labels for a particular repository.

  • A golang tool to check and summarise the labels database

    This can also be used to sort the labels database.

Fixes #1463.

Signed-off-by: James O. D. Hunt [email protected]

@jodh-intel jodh-intel requested a review from a team as a code owner April 12, 2019 11:23
@jodh-intel
Copy link
Author

jodh-intel commented Apr 12, 2019

Labels database file format

The labels database is a YAML template file. See the README.md for further information. Note that the categories are not used by GitHub, but are useful to us as they allow grouping of labels and could also allow reports to be generated by category if we use that information in combination with what is provided by the GitHub API.

Label Summary

The information below was generated by:

$ kata-github-labels show categories --with-labels cmd/github-labels/labels.yaml.in

Note: This information is presented in a couple of other formats in sections below.

Categories (count: 29):

api ("Change related to an Application Programming Interface.", label count: 2, url: )
    api-breakage ("API was broken")
    api-change ("API change")
architecture-committee ("Needs input from the Architecture Committee.", label count: 1, url: https://github.com/kata-containers/community#architecture-committee)
    needs-decision ("Requires input from the Architecture Committee")
area ("Code component / general part of product affected.", label count: 8, url: )
    area/api ("Application Programming Interface")
    area/cli ("Command Line Interface (flags/options and arguments)")
    area/comms ("Communications (gRPC, Yamux, etc)")
    area/config ("Configuration")
    area/logging ("Logging")
    area/networking ("Networking")
    area/storage ("Storage")
    area/tracing ("Tracing")
backport ("Code that needs to be applied to other branches, generally older stable ones.", label count: 1, url: )
    backport ("Code needs to be applied to older (stable) releases")
behaviour ("How the issue affect the operation of the system. A more precise version of regression.", label count: 7, url: )
    crash ("Causes part of the system to crash")
    data-loss ("System loses information")
    hang ("System appears to stop operating or freeze")
    performance ("System runs too slowly")
    resource-hog ("System uses too many resources (such as memory)")
    resource-leak ("System does not free resources (such as memory)")
    unreliable ("Part of the system is not stable")
cleanup ("Refactoring, restructuring or general tidy-up needed.", label count: 3, url: )
    cleanup ("General tidy-up")
    deprecate ("Highlight a feature that will soon be removed")
    refactor ("Remove duplication, improve organisation, etc")
customer ("Related to a customer.", label count: 1, url: )
    customer ("Relates to a customer")
design ("Requires formal review on the approach to solving the problem.", label count: 2, url: )
    needs-design-doc ("Needs a document explaining the design")
    needs-design-review ("Needs a formal design review of the approach")
detail ("Need further information from the user or author.", label count: 1, url: )
    needs-more-info ("Blocked until user or author provides further details")
documentation ("Needs more documentation.", label count: 1, url: )
    needs-docs ("Needs some new or updated documentation")
environment ("Related to particular system environment.", label count: 2, url: )
    architecture-specific ("Affects subset of architectures")
    os-specific ("Affects subset of operating system / distro versions")
help ("Request for technical help / extra resource. Also used for assisted workflow.", label count: 1, url: )
    needs-help ("Request for extra help (technical, resource, etc)")
label-admin ("Relates to the administration of labels.", label count: 1, url: )
    needs-new-label ("New label required to categorise this issue")
limitation ("Issue cannot be resolved (too hard/impossible, would be too slow, insufficient resources, etc).", label count: 1, url: https://github.com/kata-containers/documentation/blob/master/Limitations.md)
    limitation ("Issue cannot be resolved")
new-contributor ("Small, self-contained tasks suitable for newcomers.", label count: 1, url: https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md)
    good-first-issue ("Small and simple task for new contributors")
priority ("Relative urgency (time-critical).", label count: 3, url: )
    high-priority ("Very urgent issue (resolve quickly)")
    highest-priority ("Critically urgent issue (must be resolved as soon as possible)")
    medium-priority ("Urgent issue (resolve before unprioritised issues)")
question ("Needs input from the team.", label count: 2, url: )
    question ("Requires an answer")
    rfc ("Requires input from the team")
rebase ("Code conflicts need to be resolved.", label count: 1, url: )
    needs-rebase ("PR contains conflicts which need resolving")
related ("Related project. Base set can be generated from https://github.com/kata-containers/runtime/blob/master/versions.yaml.", label count: 8, url: )
    related/containerd ("Containerd")
    related/cri ("CRI")
    related/crio ("CRIO")
    related/docker ("Docker")
    related/firecracker ("Firecracker")
    related/k8s ("Kubernetes")
    related/qemu ("QEMU")
    related/runc ("Runc")
release ("Related to production of new versions.", label count: 1, url: )
    release-gating ("Release must wait for this to be resolved before release")
resolution ("Issue is not (or no longer) valid for some reason. Label specifies reason for closing.", label count: 6, url: )
    cannot-reproduce ("Issue cannot be recreated")
    duplicate ("Same issue as one already reported")
    invalid ("Issue does not make sense")
    stale ("Issue or PR was not updated in a timely fashion")
    wont-fix ("Issue will not be fixed (not a good use of limited resources)")
    wrong-repo ("Raised in incorrect repository")
security ("Potential or actual vulnerability / CVE.", label count: 1, url: https://github.com/kata-containers/community/blob/master/VMT/VMT.md)
    security ("Potential or actual security issue")
severity ("Relative importance (mission-critical).", label count: 3, url: )
    high-severity ("Very important issue")
    highest-severity ("Extremely important issue")
    medium-severity ("Important issue")
sizing ("Estimate of the complexity of the task (story points).", label count: 5, url: )
    size/huge ("Largest and most complex task (probably needs breaking into small pieces)")
    size/large ("Task of significant size")
    size/medium ("Average sized task")
    size/small ("Small and simple task")
    size/tiny ("Smallest and simplest task")
sub-type ("More specific detail on the type category.", label count: 1, url: )
    regression ("Behaviour inadvertently reverted to older behaviour")
team ("Team that needs to analyse the issue.", label count: 7, url: )
    team/ci ("Need Continuous Integration Team input")
    team/developer ("Need Developer Team input")
    team/documentation ("Need Documentation Team input")
    team/kernel ("Need Kernel Team input")
    team/metrics ("Need Metrics Team input")
    team/packaging ("Need Packaging Team input")
    team/test ("Need Test Team input")
test ("New tests needed.", label count: 2, url: )
    needs-integration-tests ("Needs new system/integration tests to validate behaviour in the tests repository")
    needs-unit-tests ("Needs new unit tests to validate behaviour in this repository")
type ("High-level summary of the issue.", label count: 3, url: )
    bug ("Incorrect behaviour")
    enhancement ("Improvement to an existing feature")
    feature ("New functionality")
vendor ("Related to handling imported code.", label count: 1, url: https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md#re-vendor-prs)
    needs-revendor ("Needs imported code to be re-vendored")

Label Categories

The table below was generated by:

$ kata-github-labels show categories --with-labels --format md cmd/github-labels/labels.yaml.in
NAME DESCRIPTION URL LABELS
api Change related to an Application Programming Interface. api-breakage,api-change
architecture-committee Needs input from the Architecture Committee. https://github.com/kata-containers/community#architecture-committee needs-decision
area Code component / general part of product affected. area/api,area/cli,area/comms,area/config,area/logging,area/networking,area/storage,area/tracing
backport Code that needs to be applied to other branches, generally older stable ones. backport
behaviour How the issue affect the operation of the system. A more precise version of regression. crash,data-loss,hang,performance,resource-hog,resource-leak,unreliable
cleanup Refactoring, restructuring or general tidy-up needed. cleanup,deprecate,refactor
customer Related to a customer. customer
design Requires formal review on the approach to solving the problem. needs-design-doc,needs-design-review
detail Need further information from the user or author. needs-more-info
documentation Needs more documentation. needs-docs
environment Related to particular system environment. architecture-specific,os-specific
help Request for technical help / extra resource. Also used for assisted workflow. needs-help
label-admin Relates to the administration of labels. needs-new-label
limitation Issue cannot be resolved (too hard/impossible, would be too slow, insufficient resources, etc). https://github.com/kata-containers/documentation/blob/master/Limitations.md limitation
new-contributor Small, self-contained tasks suitable for newcomers. https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md good-first-issue
priority Relative urgency (time-critical). high-priority,highest-priority,medium-priority
question Needs input from the team. question,rfc
rebase Code conflicts need to be resolved. needs-rebase
related Related project. Base set can be generated from https://github.com/kata-containers/runtime/blob/master/versions.yaml. related/containerd,related/cri,related/crio,related/docker,related/firecracker,related/k8s,related/qemu,related/runc
release Related to production of new versions. release-gating
resolution Issue is not (or no longer) valid for some reason. Label specifies reason for closing. cannot-reproduce,duplicate,invalid,stale,wont-fix,wrong-repo
security Potential or actual vulnerability / CVE. https://github.com/kata-containers/community/blob/master/VMT/VMT.md security
severity Relative importance (mission-critical). high-severity,highest-severity,medium-severity
sizing Estimate of the complexity of the task (story points). size/huge,size/large,size/medium,size/small,size/tiny
sub-type More specific detail on the type category. regression
team Team that needs to analyse the issue. team/ci,team/developer,team/documentation,team/kernel,team/metrics,team/packaging,team/test
test New tests needed. needs-integration-tests,needs-unit-tests
type High-level summary of the issue. bug,enhancement,feature
vendor Related to handling imported code. https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md#re-vendor-prs needs-revendor

Labels

The table below was generated by:

$ kata-github-labels show labels --format md cmd/github-labels/labels.yaml.in
NAME DESCRIPTION CATEGORY COLOUR FROM
api-breakage API was broken api ff0000
api-change API change api DEFAULT_COLOUR
architecture-specific Affects subset of architectures environment DEFAULT_COLOUR
area/api Application Programming Interface area DEFAULT_COLOUR
area/cli Command Line Interface (flags/options and arguments) area DEFAULT_COLOUR
area/comms Communications (gRPC, Yamux, etc) area DEFAULT_COLOUR
area/config Configuration area DEFAULT_COLOUR
area/logging Logging area DEFAULT_COLOUR
area/networking Networking area DEFAULT_COLOUR
area/storage Storage area DEFAULT_COLOUR
area/tracing Tracing area DEFAULT_COLOUR
backport Code needs to be applied to older (stable) releases backport DEFAULT_COLOUR
bug Incorrect behaviour type DEFAULT_COLOUR
cannot-reproduce Issue cannot be recreated resolution DEFAULT_COLOUR
cleanup General tidy-up cleanup DEFAULT_COLOUR
crash Causes part of the system to crash behaviour DEFAULT_COLOUR
customer Relates to a customer customer DEFAULT_COLOUR
data-loss System loses information behaviour DEFAULT_COLOUR
deprecate Highlight a feature that will soon be removed cleanup DEFAULT_COLOUR
duplicate Same issue as one already reported resolution DEFAULT_COLOUR
enhancement Improvement to an existing feature type DEFAULT_COLOUR
feature New functionality type DEFAULT_COLOUR
good-first-issue Small and simple task for new contributors new-contributor DEFAULT_COLOUR
hang System appears to stop operating or freeze behaviour DEFAULT_COLOUR
high-priority Very urgent issue (resolve quickly) priority ff7f00 P2
high-severity Very important issue severity 00d7ff
highest-priority Critically urgent issue (must be resolved as soon as possible) priority ff0000 P1
highest-severity Extremely important issue severity 00ffff
invalid Issue does not make sense resolution DEFAULT_COLOUR
limitation Issue cannot be resolved limitation DEFAULT_COLOUR
medium-priority Urgent issue (resolve before unprioritised issues) priority ffff00 P3
medium-severity Important issue severity 0000ff
needs-decision Requires input from the Architecture Committee architecture-committee DEFAULT_COLOUR
needs-design-doc Needs a document explaining the design design DEFAULT_COLOUR
needs-design-review Needs a formal design review of the approach design DEFAULT_COLOUR
needs-docs Needs some new or updated documentation documentation DEFAULT_COLOUR
needs-help Request for extra help (technical, resource, etc) help DEFAULT_COLOUR
needs-integration-tests Needs new system/integration tests to validate behaviour in the tests repository test DEFAULT_COLOUR
needs-more-info Blocked until user or author provides further details detail DEFAULT_COLOUR
needs-new-label New label required to categorise this issue label-admin DEFAULT_COLOUR
needs-rebase PR contains conflicts which need resolving rebase DEFAULT_COLOUR
needs-revendor Needs imported code to be re-vendored vendor DEFAULT_COLOUR
needs-unit-tests Needs new unit tests to validate behaviour in this repository test DEFAULT_COLOUR
os-specific Affects subset of operating system / distro versions environment DEFAULT_COLOUR
performance System runs too slowly behaviour DEFAULT_COLOUR
question Requires an answer question DEFAULT_COLOUR
refactor Remove duplication, improve organisation, etc cleanup DEFAULT_COLOUR
regression Behaviour inadvertently reverted to older behaviour sub-type DEFAULT_COLOUR
related/containerd Containerd related DEFAULT_COLOUR
related/cri CRI related DEFAULT_COLOUR
related/crio CRIO related DEFAULT_COLOUR
related/docker Docker related DEFAULT_COLOUR
related/firecracker Firecracker related DEFAULT_COLOUR
related/k8s Kubernetes related DEFAULT_COLOUR
related/qemu QEMU related DEFAULT_COLOUR
related/runc Runc related DEFAULT_COLOUR
release-gating Release must wait for this to be resolved before release release DEFAULT_COLOUR
resource-hog System uses too many resources (such as memory) behaviour DEFAULT_COLOUR
resource-leak System does not free resources (such as memory) behaviour DEFAULT_COLOUR
rfc Requires input from the team question DEFAULT_COLOUR
security Potential or actual security issue security ff0000
size/huge Largest and most complex task (probably needs breaking into small pieces) sizing DEFAULT_COLOUR
size/large Task of significant size sizing DEFAULT_COLOUR
size/medium Average sized task sizing DEFAULT_COLOUR
size/small Small and simple task sizing DEFAULT_COLOUR
size/tiny Smallest and simplest task sizing DEFAULT_COLOUR
stale Issue or PR was not updated in a timely fashion resolution DEFAULT_COLOUR
team/ci Need Continuous Integration Team input team DEFAULT_COLOUR
team/developer Need Developer Team input team DEFAULT_COLOUR
team/documentation Need Documentation Team input team DEFAULT_COLOUR
team/kernel Need Kernel Team input team DEFAULT_COLOUR
team/metrics Need Metrics Team input team DEFAULT_COLOUR
team/packaging Need Packaging Team input team DEFAULT_COLOUR
team/test Need Test Team input team DEFAULT_COLOUR
unreliable Part of the system is not stable behaviour DEFAULT_COLOUR
wont-fix Issue will not be fixed (not a good use of limited resources) resolution DEFAULT_COLOUR
wrong-repo Raised in incorrect repository resolution DEFAULT_COLOUR

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from 9063fd8 to ed04688 Compare April 12, 2019 12:11
Copy link
Contributor

@grahamwhaley grahamwhaley left a comment

Choose a reason for hiding this comment

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

minor feedback, nothing major.
looking good, although I do have 'label shock', and may need a lay down....

cidir=$(dirname "$0")
source "${cidir}/lib.sh"

tests_dir="${GOPATH}/src/github.com/kata-containers/tests"
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this is not a change in functionality, but I wonder if the path should be relative to say ${cidir}, rather than hard wired to the gopath github repo. Hard wiring can make it hard to test changes if you happen to have a different local layout etc. (I have run into such things before, which is where a number of this sort of idioms we have in a lot of scripts came from:

export tests_repo="${tests_repo:-github.com/kata-containers/tests}"
export tests_repo_dir="$GOPATH/src/$tests_repo"

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

#

TARGET = kata-github-labels
SOURCES = $(shell find . 2>&1 | grep -E '.*\.go$$')
Copy link
Contributor

Choose a reason for hiding this comment

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

heh, maybe add a -type f to the find, just in case somebody has a subdir called stuffyou.go or something :-) heh. I know how paranoid you are.....
/me winces at find in a Makefile.... shudder......

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Author

Choose a reason for hiding this comment

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

... ftr, that Makefile is similar / almost identical to a bunch of other makefiles in our repos. PRs welcome! ;)

The script validates the combined labels database by performing a number of
checks including running the `kata-github-labels` tool (described in the
[Checking and summarising the labels database](#checking-and-summarising-the-labels-database) section)
in its checking mode.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/its//

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

githubTableSeparator,
"URL",
githubTableSeparator)
fmt.Printf("|-|-|-|\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't know if it will help or not, but for the checkmetrics tool table results I used https://github.com/olekukonko/tablewriter#example-5---markdown-format - and it looks like it can do markdown output with some tweaks.

Copy link
Author

Choose a reason for hiding this comment

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

It might be overkill tbh, but I'll take a look...


yq read "$file" >/dev/null

yamllint --strict "$file"
Copy link
Contributor

Choose a reason for hiding this comment

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

above we check if we have yq installed - should we do similar (but maybe have to abort) if we don't find yamllint?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed - I want to keep this PR as minimal as possible so it just dies if yamllint isn't installed for now - it will be installed on the CI systems.

Containers GitHub repositories.

Each repository can optionally contain a top-level `labels.yaml` that
specifies a list of repository-specific labels. This labels in the
Copy link
Contributor

Choose a reason for hiding this comment

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

s/This labels/The labels/

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

A label may also specify a colour definition.

If a label specifies a category, it must be a category from the list of
categories specified in this file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can a repo define its own categories as well?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

- name: wrong-repo
description: Raised in incorrect repository
category: resolution
color: DEFAULT_COLOUR
Copy link
Contributor

Choose a reason for hiding this comment

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

I think my eyes have label blur 😱 That's a lot of categories and labels. OK, so, looking at some of the defacto-ish projects that have formalised their labels (k8s, rkt, docker), it is not a dissimilar list or size - but kudos to the first (or will that be 2nd) person who reads and digests the whole list ;-)

Copy link
Author

Choose a reason for hiding this comment

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

Feel free to comment on particular labels. I'm sure there are issues and we can argue about individual labels or categories on the PR.

Oh, and spare a thought for the poor author who had to put this whole thing together... and yes, it all took a lot of my time ;)


info "Checking labels for repo ${repo} using temporary combined database ${tmp}"

bash -f "${tests_dir}/cmd/github-labels/github-labels.sh" "generate" "${repo}" "${tmp}"
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick - the script is set -e, so if this fails, then we'll leave the tmpfile around. We could trap hook its deletion. picky, I know.

Copy link
Author

Choose a reason for hiding this comment

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

That's by design - the info call specifically mentions the temporary file so that if the script fails, you can inspect it to see wtf caused the problem. The file is tiny so I don't think we'll ENOSPC the CI systems ;)

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch 4 times, most recently from b939875 to 6918e6c Compare April 15, 2019 07:45
@jodh-intel
Copy link
Author

I've regenerated #1466 (comment) using the new CLI syntax.

@egernst, @kata-containers/architecture-committee, @mimeriza - ptal.

@jodh-intel
Copy link
Author

/retest

@jodh-intel
Copy link
Author

@grahamwhaley - I'm now using tablewriter for the GFM tables.

@jodh-intel
Copy link
Author

@klynnrif - ptal at the new README.

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from 6918e6c to f05058e Compare April 15, 2019 11:31
@jodh-intel
Copy link
Author

/retest

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from f05058e to a485bc4 Compare April 15, 2019 13:13
@jodh-intel
Copy link
Author

/retest

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from a485bc4 to 9a58efc Compare April 15, 2019 13:20
@jodh-intel
Copy link
Author

/retest

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch 2 times, most recently from 4ff154a to 70f32c0 Compare April 15, 2019 14:17
@jodh-intel
Copy link
Author

sigh...

/retest


check_labels()
{
[ $(uname -s) != Linux ] && info "Cannot only check labels under Linux" && return
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Cannot/Can ?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @chavafg - fixed.

return fmt.Errorf("invalid category %v found for label %+v", catName, l)
}

// update
Copy link
Contributor

Choose a reason for hiding this comment

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

comment needed?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch 2 times, most recently from 52937ff to dc322d3 Compare April 15, 2019 15:35
@jodh-intel
Copy link
Author

/tetest

@jodh-intel
Copy link
Author

/retest even! :)

Copy link

@klynnrif klynnrif left a comment

Choose a reason for hiding this comment

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

Scrubbed for grammar, structure, and flow. A few suggested rewrites. Thanks!

The Kata Project uses a number of GitHub repositories. To allow issues and PRs
to be handled consistently between repositories a standard set of issue labels
are used. These labels are stored in YAML format in the master [labels
database template](labels.yaml.in). This file is human-readable and

Choose a reason for hiding this comment

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

Lines 14-16 suggested rewrite:
... This file is human-readable, machine-readable, and self-describing (see the file for the introductory description).

machine-readable and self-describing (take a look at the file for the
introductory description).

Additionally, each repository can contain a set of additional

Choose a reason for hiding this comment

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

Lines 18-19 suggested rewrite:
Each repository can contain a set of additional (repository-specific) labels, which are stored in a top-level YAML template...


# Generating the combined labels database

The combined labels database is generated by running the

Choose a reason for hiding this comment

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

Lines 27-30 suggested rewrite (unless I changed the meaning):
You can run the github_labels.sh script with the generate parameter to generate the combined labels database. This passes the repository in order to generate the combined labels database and the name of a file to write the combined database:

Copy link
Author

Choose a reason for hiding this comment

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

I've changed your wording slightly to:

You can run the github_labels.sh script with the generate argument to
create the combined labels database. The additional arguments specify the
repository (in order to generate the combined labels database) and the name of
a file to write the combined database:

$ ./github-labels.sh generate github.com/kata-containers/runtime /tmp/combined.yaml
```

The script validates the combined labels database by performing a number of

Choose a reason for hiding this comment

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

Lines 36-39 suggested rewrite:
This script validates the combined labels database by performing a number of checks, including running the kata-github-labels tool in checking mode. See the Checking and summarising the labels database section for more information.


# Checking and summarising the labels database

The [`kata-github-labels`](github-labels.go) tool is used to check and

Choose a reason for hiding this comment

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

Lines 43-44 suggested rewrite:
The kata-github-labels tool checks and summarizes the labels database for each repository.

```
## Check only

To only perform checks on specified labels database:

Choose a reason for hiding this comment

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

Line 63 suggested rewrite:
Performs checks on a specified labels database:
OR
Performs checks on specified labels databases:


## Full details

To list all available options:

Choose a reason for hiding this comment

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

Line 71 suggested rewrite:
Lists all available options:


## Show categories

To show all information about categories:

Choose a reason for hiding this comment

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

Lines 56 suggested rewrite:
Shows all information about categories:


## Show labels

To display a summary of the labels:

Choose a reason for hiding this comment

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

Line 48 suggested rewrite:
Displays a summary of the labels:

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from dc322d3 to 9c2ccd5 Compare April 17, 2019 09:02
@jodh-intel
Copy link
Author

/test

@jodh-intel
Copy link
Author

/retest

@egernst
Copy link
Member

egernst commented Apr 22, 2019

01:10:09 usage: yamllint [-h] [-c CONFIG_FILE] [-d CONFIG_DATA]
01:10:09                 [-f {parsable,standard}] [-v]
01:10:09                 FILE_OR_DIR [FILE_OR_DIR ...]
01:10:09 yamllint: error: unrecognized arguments: --strict
01:10:09 Build step 'Execute shell' marked build as failure

@grahamwhaley
Copy link
Contributor

@egernst I think @jodh-intel noted that the yamllint --strict issue was a version thing - let's confirm that @jodh-intel @GabyCT @chavafg - and then, do we have our usual style of 'build from source if need be' fix in flight ?

chronic sudo -E zypper -n install -t pattern "Basis-Devel" && sudo -E zypper -n install python zlib-devel

echo "Install YAML validator"
chronic sudo -E zypper -n install yamllint
Copy link
Contributor

Choose a reason for hiding this comment

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

@jodh-intel that does not exist on sles or opensuse, this is the CI error

'yamllint' not found in package names. Trying capabilities.

Copy link
Member

Choose a reason for hiding this comment

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

stepping back.... the intention is to test that our label tooling is adequate. There really shouldn't be a need to test this on a per-distro basis -- just in a single job would be enough.

Is there a way to skip this for openSUSE? WDYT?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

now python3-pip not found on SLES:
04:18:37 Package 'python3-pip' not found.

Copy link
Author

Choose a reason for hiding this comment

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

@marcov, @GabyCT - I don't have access to a SLES system. Can you tell me the name of the pip package for sles? python2-pip or python-pip maybe?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jodh-intel

$ zypper -n install python2-pip

Copy link
Author

Choose a reason for hiding this comment

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

@egernst - You are correct. At this stage, we're just checking the single db file so this check could be summarised as:

  • Only run this when one of the db files changes.

But in the future, the plan is to add extra checks on the labels on the PR and maybe even its associated issue too. In fact, we may end up adding labels. At that point it would become a:

  • Run exactly once per PR.

That implies of course that it should not run on every CI system.

I think we're still waiting for the ability to run arbitrary periodic jobs under Jenkins but this should be considered as currently it will be running "too many times".

Until we can move it though, does anyone know how to install pip on SLES 12? If I don't find out by Monday, I'll have to disable for SLES which would be a shame as all the distros should have the ability to run all tests in principle.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jodh-intel

$ zypper -n install python2-pip

Copy link
Author

Choose a reason for hiding this comment

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

Grr - browser cache fail. Branch updated to use python2-pip for sles now.

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from 2bd1098 to 34fda58 Compare April 25, 2019 09:00
@jodh-intel
Copy link
Author

/retest

Move a variable to the top-level for a future change.

Signed-off-by: James O. D. Hunt <[email protected]>
@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch 2 times, most recently from a5a3dd8 to cc98c02 Compare April 26, 2019 13:51
@jodh-intel
Copy link
Author

/retest

@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from cc98c02 to fd7cf13 Compare April 26, 2019 14:36
@jodh-intel
Copy link
Author

/retest

James O. D. Hunt added 3 commits April 26, 2019 15:54
Install `yamllint` for the SUSE-based distros. This is already done for
all the other distros.

Signed-off-by: James O. D. Hunt <[email protected]>
Add new tooling to handle GitHub labels. This includes:

- A YAML template file (the master "labels database")

  This contains the master set of labels to be used for all Kata
  repositories. All labels have descriptions and a category.

- A script to generate the combined set of labels

  This merges the master set of labels with an optional
  repository-specific set of labels to produce a combined set of labels
  for a particular repository.

- A golang tool to check and summarise the labels database

  This can also be used to sort the labels database.

Fixes kata-containers#1463.

Signed-off-by: James O. D. Hunt <[email protected]>
Correct bad formatting caused by using spaces rather than tabs.

Signed-off-by: James O. D. Hunt <[email protected]>
@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from fd7cf13 to 57e6ad6 Compare April 26, 2019 14:55
@jodh-intel
Copy link
Author

Right. Updated for the bazillionth time for OpenSUSE and SLES. Let's see how this goes...

/me gets a 🔫 and a bottle of 🍾 ready to cover all outcomes...

@jodh-intel
Copy link
Author

/retest and ... run....!

@jodh-intel
Copy link
Author

Travis (OSX only) timed out, so restarted.
The metrics CI dribbled out the following:

16:15:27 Cloning the remote Git repository
16:15:27 FATAL: java.io.IOException: Unexpected termination of the channel
16:15:27 java.io.EOFException
16:15:27 	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)
16:15:27 	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)
16:15:27 	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
16:15:27 	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)
16:15:27 	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
16:15:27 	at hudson.remoting.Command.readFrom(Command.java:140)
16:15:27 	at hudson.remoting.Command.readFrom(Command.java:126)
16:15:27 	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
16:15:27 	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
16:15:27 Caused: java.io.IOException: Unexpected termination of the channel
16:15:27 	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
16:15:27 Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to x86_packet02
16:15:27 		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
16:15:27 		at hudson.remoting.Request.call(Request.java:202)
16:15:27 		at hudson.remoting.Channel.call(Channel.java:956)
16:15:27 		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
16:15:27 		at sun.reflect.GeneratedMethodAccessor533.invoke(Unknown Source)
16:15:27 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:15:27 		at java.lang.reflect.Method.invoke(Method.java:498)
16:15:27 		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
16:15:27 		at com.sun.proxy.$Proxy392.execute(Unknown Source)
16:15:27 		at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1135)
16:15:27 		at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1175)
16:15:27 		at hudson.scm.SCM.checkout(SCM.java:504)
16:15:27 		at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
16:15:27 		at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
16:15:27 		at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
16:15:27 		at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
16:15:27 		at hudson.model.Run.execute(Run.java:1816)
16:15:27 		at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
16:15:27 		at hudson.model.ResourceController.execute(ResourceController.java:97)
16:15:27 		at hudson.model.Executor.run(Executor.java:429)
16:15:27 Caused: hudson.remoting.RequestAbortedException
16:15:27 	at hudson.remoting.Request.abort(Request.java:340)
16:15:27 	at hudson.remoting.Channel.terminate(Channel.java:1040)
16:15:27 	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:94)

Restarting to make my eyes stop bleeding...

@grahamwhaley
Copy link
Contributor

@jodh-intel I've said it before, I'll say it again. I guess I'll just have to keep saying it ... all the java stack dump stuff is not any of the tests we are running, on any of the CI jobs - it is the jenkins agent way of saying it got miffed at the machine under test going belly up - so, you only need to post the top line of the java dump, and the few pertinent lines before it :-)

@jodh-intel
Copy link
Author

@grahamwhaley - I know it's not us, but I'm alerting all to the problem ;)

Pasting the entire thing anyhow seems sensible given we do see variation in the java barfs. For example, there was that uber-verbose ENOSPC one I seem to recall we saw recently.

James O. D. Hunt added 2 commits April 26, 2019 17:08
Refactor the check for `yamllint` to allow it to be used by other
functions in the future.

Signed-off-by: James O. D. Hunt <[email protected]>
Add a `--labels` option to `static-checks.sh` to allow the combined
labels database to be checked.

Signed-off-by: James O. D. Hunt <[email protected]>
@jodh-intel jodh-intel force-pushed the add-github-labels-tooling branch from 57e6ad6 to af421d0 Compare April 26, 2019 16:09
@jodh-intel
Copy link
Author

/retest

@jodh-intel
Copy link
Author

omg! It's working! 😄

@egernst
Copy link
Member

egernst commented Apr 26, 2019

/me rekicks opensuse after seeing CPU hotplug failure...

@GabyCT GabyCT merged commit 40232ed into kata-containers:master Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add github labels tooling

6 participants