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

chore(deps): Add 3rd party license file and CI checks #17344

Merged
merged 5 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ jobs:
- name: Check cargo deny advisories/licenses
if: needs.changes.outputs.dependencies == 'true' || needs.changes.outputs.deny == 'true'
run: make check-deny
- name: Install the 3rd-party license tool
Copy link
Member

Choose a reason for hiding this comment

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

Usually we have this installation in the bootstrap file. Would it make sense to put this there?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could go either way. It's only needed for this one check, so 🤷🏻

Copy link
Member

Choose a reason for hiding this comment

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

True, though the bootstrap scripts are also run as part of make environment which installs needed development tools.

if: needs.changes.outputs.dependencies == 'true'
run: cargo install --git https://github.com/DataDog/rust-license-tool
- name: Check that the 3rd-party license file is up to date
if: needs.changes.outputs.dependencies == 'true'
run: make check-licenses
- name: Check Cue docs
if: needs.changes.outputs.cue == 'true'
run: make check-docs
Expand Down
619 changes: 618 additions & 1 deletion LICENSE-3rdparty.csv

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ check: ## Run prerequisite code checks
check-all: ## Check everything
check-all: check-fmt check-clippy check-docs
check-all: check-version check-examples check-component-features
check-all: check-scripts check-deny check-component-docs
check-all: check-scripts check-deny check-component-docs check-licenses

.PHONY: check-component-features
check-component-features: ## Check that all component features are setup properly
Expand All @@ -435,6 +435,10 @@ check-docs: ## Check that all /docs file are valid
check-fmt: ## Check that all files are formatted properly
${MAYBE_ENVIRONMENT_EXEC} cargo vdev check fmt

.PHONY: check-licenses
check-licenses: ## Check that the 3rd-party license file is up to date
${MAYBE_ENVIRONMENT_EXEC} cargo vdev check licenses

.PHONY: check-markdown
check-markdown: ## Check that markdown is styled properly
${MAYBE_ENVIRONMENT_EXEC} cargo vdev check markdown
Expand Down
28 changes: 28 additions & 0 deletions license-tool.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[overrides]
"backon" = { origin = "https://github.com/Xuanwo/backon" }
"bollard-stubs" = { origin = "https://github.com/fussybeaver/bollard" }
"openssl-macros" = { origin = "https://github.com/sfackler/rust-openssl" }
"serde_nanos" = { origin = "https://github.com/caspervonb/serde_nanos" }
Comment on lines +2 to +5
Copy link
Member

Choose a reason for hiding this comment

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

Why are these needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

The sources don't actually include either a repository or homepage line in their respective metadata, so we can't automatically determine where they are actually hosted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Worth PRing these few upstream to reduce the manual work here?

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, probably.


# These can go away once Vector starts using a release of the VRL crate with a
# library field set up.
"vrl" = { license = "MPL-2.0" }
"vrl-compiler" = { license = "MPL-2.0" }
"vrl-core" = { license = "MPL-2.0" }
"vrl-diagnostic" = { license = "MPL-2.0" }
"vrl-parser" = { license = "MPL-2.0" }
"vrl-tests" = { license = "MPL-2.0" }

# `ring` has a custom license that is mostly "ISC-style" but parts of it also fall under OpenSSL licensing.
"ring-0.16.20" = { license = "ISC AND Custom" }

# `rustls-webpki` doesn't specify their license in the metadata, but the file contains the ISC terms.
"rustls-webpki-0.100.1" = { license = "ISC" }

# `webpki` doesn't specify their license in the metadata, but the file contains the ISC terms.
"webpki-0.21.4" = { license = "ISC" }
"webpki-0.22.0" = { license = "ISC" }

# `zerocopy` et al don't specify their licenses in the metadata, but the file contains the 2-clause BSD terms.
"zerocopy-0.6.1" = { license = "BSD-2-Clause" }
"zerocopy-derive-0.3.2" = { license = "BSD-2-Clause" }
14 changes: 14 additions & 0 deletions vdev/src/commands/build/licenses.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use anyhow::Result;

use crate::app;

/// Rebuild the 3rd-party license file.
#[derive(clap::Args, Debug)]
#[command()]
pub struct Cli {}

impl Cli {
pub fn exec(self) -> Result<()> {
app::exec("rust-license-tool", ["write"], true)
}
}
1 change: 1 addition & 0 deletions vdev/src/commands/build/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
crate::cli_subcommands! {
"Build, generate or regenerate components..."
component_docs,
mod licenses,
manifests,
mod publish_metadata,
release_cue,
Expand Down
14 changes: 14 additions & 0 deletions vdev/src/commands/check/licenses.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use anyhow::Result;

use crate::app;

/// Check that the 3rd-party license file is up to date
#[derive(clap::Args, Debug)]
#[command()]
pub struct Cli {}

impl Cli {
pub fn exec(self) -> Result<()> {
app::exec("rust-license-tool", ["check"], true)
}
}
1 change: 1 addition & 0 deletions vdev/src/commands/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ crate::cli_subcommands! {
events,
mod examples,
mod fmt,
mod licenses,
mod markdown,
mod rust,
mod scripts,
Expand Down