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

CI: Add check for SPDX license headers#242

Merged
grahamwhaley merged 1 commit intokata-containers:masterfrom
jodh-intel:check-spdx-license-headers
Apr 18, 2018
Merged

CI: Add check for SPDX license headers#242
grahamwhaley merged 1 commit intokata-containers:masterfrom
jodh-intel:check-spdx-license-headers

Conversation

@jodh-intel
Copy link
Copy Markdown

Add a check to ensure that all files where possible contain the
required SPDX license header.

Fixes #240.

Signed-off-by: James O. D. Hunt james.o.hunt@intel.com

@jodh-intel
Copy link
Copy Markdown
Author

/cc @grahamwhaley.

@jodh-intel jodh-intel force-pushed the check-spdx-license-headers branch from cbe2405 to be93644 Compare April 17, 2018 13:54
--exclude="vendor/*" \
--exclude="VERSION" \
--exclude="*.md" \
-EL "\<${pattern}\>" \
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This list of excludes works reasonably well, but I wonder if we want to add .pullapprove.yml to it too? We could of course instead add the SPDX header to that file ;)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about exclude yml and toml files in general?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I guess we could, although for example the versions database does have the SPDX tag:

But yes, we'd need to add it to configuration.toml (and probably should ;)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I vote maybe we should add them if that does not upset any of the relevant processing tools or bots

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ok - added.

Copy link
Copy Markdown
Member

@jcvenegas jcvenegas 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 exclude yaml and toml files too

files=$(git diff-tree \
--name-only \
--no-commit-id \
--diff-filter="ACMRUX" \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACMRUX ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, it's a bit opaque :) I've updated the file to make it a bit clearer ;)

--exclude="vendor/*" \
--exclude="VERSION" \
--exclude="*.md" \
-EL "\<${pattern}\>" \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about exclude yml and toml files in general?

@jodh-intel jodh-intel force-pushed the check-spdx-license-headers branch 3 times, most recently from 23769da to 2e479d4 Compare April 17, 2018 15:39
Copy link
Copy Markdown
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.

Even if we are going to fix all the .yaml and other files that are either missing or have a non-SPDX header, I think this will still work fine, so:
lgtm

@grahamwhaley
Copy link
Copy Markdown
Contributor

and thanks @jodh-intel for writing that :-)

Add a check to ensure that all files where possible contain the
required SPDX license header.

Fixes kata-containers#240.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
@GabyCT
Copy link
Copy Markdown
Contributor

GabyCT commented Apr 17, 2018

lgtm

Approved with PullApprove

@jcvenegas
Copy link
Copy Markdown
Member

@GabyCT @chavafg "jenkins-ci-ubuntu-16-04 Expected — Waiting for status to be reported" I see ubuntu did not reported, is this a known issue?

@chavafg
Copy link
Copy Markdown
Contributor

chavafg commented Apr 17, 2018

Don't know what happened. The job finished successfully: http://kata-jenkins-ci.westus2.cloudapp.azure.com/job/kata-containers-tests-ubuntu-16-04-PR/325/
Restarted the job.

@jodh-intel
Copy link
Copy Markdown
Author

@grahamwhaley - assuming this was a CI hiccup, do you want to merge?

@grahamwhaley
Copy link
Copy Markdown
Contributor

afaict, the CI did pass - at least as well as any other PR. @chavafg , looking at a few of the logs for the 16.04 builds, they seem to have a number of error-ish type lines (around yaml not found and coverage not reported etc.). I wonder if we can make the scripts a little smarter to reduce some of the noise in the future?
merging..

@grahamwhaley grahamwhaley merged commit a7ee85b into kata-containers:master Apr 18, 2018
@bergwolf
Copy link
Copy Markdown
Member

It seems that this PR is breaking all CIs. I'm seeing

ERROR: Required license identifier ('SPDX-License-Identifier: Apache-2.0') missing from following files:

for PRs that do not add any new files. Do we want to block all PRs until the switch is done?

@grahamwhaley
Copy link
Copy Markdown
Contributor

@bergwolf (or anybody) - do you have a link to a PR that has the failing CI so we can have a look?

@bergwolf
Copy link
Copy Markdown
Member

@grahamwhaley
Copy link
Copy Markdown
Contributor

Ah, I'm afraid the tool did exactly what it was meant to. The bit you did not paste is:

virtcontainers/agent.go
virtcontainers/api.go
virtcontainers/api_test.go
virtcontainers/hyperstart_agent.go
virtcontainers/implementation.go
virtcontainers/interfaces.go
virtcontainers/kata_agent.go
virtcontainers/noop_agent.go
virtcontainers/pkg/vcmock/mock.go
virtcontainers/pkg/vcmock/mock_test.go
virtcontainers/pkg/vcmock/sandbox.go
virtcontainers/pkg/vcmock/types.go
virtcontainers/sandbox.go

From the files in the PR: https://github.com/bergwolf/kata-runtime/blob/6eb92805dd13ba4bd9e37cbe8a48f1b53c363065/virtcontainers/agent.go#L1-L15

See kata-containers/runtime#227
The correct fix might be to update/fix the license headers in those files...

@bergwolf
Copy link
Copy Markdown
Member

@grahamwhaley That's what I meant by "block all PRs until the switch is done", because it is now required to update the license header for any PR that touches the improperly licensed files.

I think the sequence to move forward is to send separate PRs to fix the license headers and get them merged first, and then merge this PR to make sure new any added files are properly licensed.

Right now, it seems that we are merging tests first and catching up with implementations.

@bergwolf
Copy link
Copy Markdown
Member

And CI for any PR in runtime repo will fail until kata-containers/runtime#227 is fixed.

@grahamwhaley
Copy link
Copy Markdown
Contributor

Well, I understand :-) Yes, we are currently checking any files that are modified as well as newly added.
options:

  1. fix the files that are touched in PRs right now whilst we prep the PR for vc SPDX headers
  2. temporarily change the check so it only checks newly added files
  3. turn the check off completely
  4. write and land the vc SPDX update PR asap

I favour maybe a combination of 2 and 4, if we cannot do 4 very quickly... I can jump on (4) in a few hours time....

@bergwolf
Copy link
Copy Markdown
Member

@grahamwhaley I'm in favor of any option that can unblock other PRs quickly ;) Thanks!

@grahamwhaley
Copy link
Copy Markdown
Contributor

See kata-containers/runtime#231

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.

6 participants