From 62a1e9dd9c9f539e9d2f1ba1036d9cc7bd6defc6 Mon Sep 17 00:00:00 2001 From: Ryan Edward Kozak Date: Mon, 5 Aug 2024 08:07:39 -0700 Subject: [PATCH] Fix Open Source Copyright Headers (#507) Summary: Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/507 The open source automated [repository](https://www.internalfb.com/intern/opensource/github/repo/1770409709999349/) checkup has been flagging certain files as needing a copyright header. I've excluded the `go.mod` and `go.sum` file, and added the other headers where appropriate as per this test: https://www.internalfb.com/phabricator/paste/view/P1510438766 Fixes the following: ``` COPYRIGHT_HEADERS_EXIST: Copyright Headers **************************************** FIX IT! https://our.intern.facebook.com/intern/opensource/github/repo/1770409709999349/repo_settings/header_exemptions/ Every project specific source file must contain a doc block with an appropriate copyright header. Unrelated files must be listed as exceptions in the Copyright Headers Exceptions page in the repo dashboard. A copyright header clearly indicates that the code is owned by Meta. Every open source file must start with a comment containing "Meta Platforms, Inc. and affiliates" https://github.com/facebookincubator/TTPForge/blob/main/go.mod: The first 16 lines of 'go.mod' do not contain the patterns: (Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook) Copyright https://github.com/facebookincubator/TTPForge/blob/main/go.sum: The first 16 lines of 'go.sum' do not contain the patterns: (Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook) Copyright https://github.com/facebookincubator/TTPForge/blob/main/integration-tests.sh: The first 16 lines of 'integration-tests.sh' do not contain the patterns: (Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook) Copyright https://github.com/facebookincubator/TTPForge/blob/main/run-all-ttp-tests.sh: The first 16 lines of 'run-all-ttp-tests.sh' do not contain the patterns: (Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook) Copyright https://github.com/facebookincubator/TTPForge/blob/main/cmd/test-resources/repos/another-repo/some-ttps/cleanup-tests/test.sh: The first 16 lines of 'cmd/test-resources/repos/another-repo/some-ttps/cleanup-tests/test.sh' do not contain the patterns: (Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook) Copyright https://github.com/facebookincubator/TTPForge/blob/main/cmd/test-resources/repos/test-repo/ttps/steps/hello-world.sh: The first 16 lines of 'cmd/test-resources/repos/test-repo/ttps/steps/hello-world.sh' do not contain the patterns: (Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook) Copyright ``` Differential Revision: D60686691 fbshipit-source-id: ed574ac6de234c062a21a4beccfc4d1e3b8db404 --- .../some-ttps/cleanup-tests/test.sh | 18 ++++++++++++++++++ .../repos/test-repo/ttps/steps/hello-world.sh | 18 ++++++++++++++++++ integration-tests.sh | 18 ++++++++++++++++++ run-all-ttp-tests.sh | 18 ++++++++++++++++++ 4 files changed, 72 insertions(+) diff --git a/cmd/test-resources/repos/another-repo/some-ttps/cleanup-tests/test.sh b/cmd/test-resources/repos/another-repo/some-ttps/cleanup-tests/test.sh index ccc95ec1..401567e6 100755 --- a/cmd/test-resources/repos/another-repo/some-ttps/cleanup-tests/test.sh +++ b/cmd/test-resources/repos/another-repo/some-ttps/cleanup-tests/test.sh @@ -1,2 +1,20 @@ #!/bin/bash + +# Copyright © 2023-present, Meta Platforms, Inc. and affiliates +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + echo "$1" diff --git a/cmd/test-resources/repos/test-repo/ttps/steps/hello-world.sh b/cmd/test-resources/repos/test-repo/ttps/steps/hello-world.sh index 23bf47c0..6c57b6e4 100755 --- a/cmd/test-resources/repos/test-repo/ttps/steps/hello-world.sh +++ b/cmd/test-resources/repos/test-repo/ttps/steps/hello-world.sh @@ -1,3 +1,21 @@ #!/bin/bash +# Copyright © 2023-present, Meta Platforms, Inc. and affiliates +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + echo "Hello World" diff --git a/integration-tests.sh b/integration-tests.sh index e40b6853..3b57f80c 100755 --- a/integration-tests.sh +++ b/integration-tests.sh @@ -1,4 +1,22 @@ #!/bin/bash + +# Copyright © 2023-present, Meta Platforms, Inc. and affiliates +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + # This runs the commands from the README.md # Will shortly add `ttpforge test` invocation # to run all the examples diff --git a/run-all-ttp-tests.sh b/run-all-ttp-tests.sh index f0a20148..996e143f 100755 --- a/run-all-ttp-tests.sh +++ b/run-all-ttp-tests.sh @@ -1,4 +1,22 @@ #!/bin/bash + +# Copyright © 2023-present, Meta Platforms, Inc. and affiliates +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + set -e # Validate path to TTPForge binary