diff --git a/.agents/skills/commit/SKILL.md b/.agents/skills/commit/SKILL.md index 842acf506..041a358cb 100644 --- a/.agents/skills/commit/SKILL.md +++ b/.agents/skills/commit/SKILL.md @@ -7,10 +7,11 @@ description: Write a git commit message and verify formatting before committing. When creating a commit for a patch: -- Run `bash tools/format.sh` if formatting has not been run since the last edits. +- Run `bash tools/pr-prep.sh` after the final edits to format the worktree and + update copyright years. - Most files should have a copyright, save files like gold files and .json files which don't take comments. -- Run `bash tools/copyright-update.sh` after the final edits to update copyrights. With no argument it updates currently changed files; with a commit argument it updates the files touched by that commit. -- Verify every changed or new file that carries a copyright header uses the current year before committing. +- Verify every changed or new file that carries a copyright header ends with + its most recent commit year before committing. - Write a short one-line summary (target: under ~60 characters). - Add a concise body (1-3 short paragraphs) focused on why the change is needed and how it resolves the issue. - Wrap all commit message lines at 72 characters or less. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c68518457..6d4fcc48a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,8 @@ Please follow [best practices](https://github.com/trein/dev-best-practices/wiki/ When your code is ready to be submitted, read github's article about how to [submit a pull request](https://help.github.com/articles/creating-a-pull-request/) to begin the code review process and follow its directions. Before creaing a pull request, please do the following to make sure the patch is ready for review: -1. Run the tools/format.sh script to format the source code according to the repository's formatting standards. +1. Run `tools/pr-prep.sh` to format the source code and update copyright years + according to the repository's standards. 1. Verify that all AuTests pass (see the [README](https://github.com/yahoo/proxy-verifier/blob/master/README.md) for instructions on how to run the AuTests). 1. Verify that all unit tests pass (see the [README](https://github.com/yahoo/proxy-verifier/blob/master/README.md) for instructions on how to run the unit tests). diff --git a/NOTICES b/NOTICES index 294cc319d..aef78d066 100644 --- a/NOTICES +++ b/NOTICES @@ -1,6 +1,6 @@ Proxy Verifier -Copyright 2020, Verizon Media +Copyright 2020-2026, Verizon Media SPDX-License-Identifier: Apache-2.0 ~~~ diff --git a/src/core/case_insensitive_utils.h b/src/core/case_insensitive_utils.h index 72be599fb..5dc3daa1c 100644 --- a/src/core/case_insensitive_utils.h +++ b/src/core/case_insensitive_utils.h @@ -1,7 +1,7 @@ /** @file * Data structures to support case-insensitive containers. * - * Copyright 2021, Verizon Media + * Copyright 2021-2026, Verizon Media * SPDX-License-Identifier: Apache-2.0 */ diff --git a/src/core/http2.h b/src/core/http2.h index 0f5f52780..3fa891354 100644 --- a/src/core/http2.h +++ b/src/core/http2.h @@ -1,7 +1,7 @@ /** @file * Common data structures and definitions for Proxy Verifier tools. * - * Copyright 2022, Verizon Media + * Copyright 2022-2026, Verizon Media * SPDX-License-Identifier: Apache-2.0 */ diff --git a/src/core/yaml_util.h b/src/core/yaml_util.h index f6ad4cad8..f0ad6fd43 100644 --- a/src/core/yaml_util.h +++ b/src/core/yaml_util.h @@ -1,6 +1,6 @@ /** @file * - * Copyright 2020, Verizon Media + * Copyright 2020-2026, Verizon Media * SPDX-License-Identifier: Apache-2.0 */ diff --git a/tests/autests/gold_tests/arguments/format_argument/format_argument.test.py b/tests/autests/gold_tests/arguments/format_argument/format_argument.test.py index c290d8e6c..34ad1500e 100644 --- a/tests/autests/gold_tests/arguments/format_argument/format_argument.test.py +++ b/tests/autests/gold_tests/arguments/format_argument/format_argument.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/arguments/keys_argument/keys_arg.test.py b/tests/autests/gold_tests/arguments/keys_argument/keys_arg.test.py index d85f09a9e..efd9371eb 100644 --- a/tests/autests/gold_tests/arguments/keys_argument/keys_arg.test.py +++ b/tests/autests/gold_tests/arguments/keys_argument/keys_arg.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/arguments/port_argument/no_port_argument.test.py b/tests/autests/gold_tests/arguments/port_argument/no_port_argument.test.py index 31396318f..3f43ed547 100644 --- a/tests/autests/gold_tests/arguments/port_argument/no_port_argument.test.py +++ b/tests/autests/gold_tests/arguments/port_argument/no_port_argument.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/arguments/repeat_argument/repeat_argument.test.py b/tests/autests/gold_tests/arguments/repeat_argument/repeat_argument.test.py index 2ffdfbceb..5631c4962 100644 --- a/tests/autests/gold_tests/arguments/repeat_argument/repeat_argument.test.py +++ b/tests/autests/gold_tests/arguments/repeat_argument/repeat_argument.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/autest-site/client.test.ext b/tests/autests/gold_tests/autest-site/client.test.ext index d4134347a..de9a9f396 100755 --- a/tests/autests/gold_tests/autest-site/client.test.ext +++ b/tests/autests/gold_tests/autest-site/client.test.ext @@ -3,7 +3,7 @@ Implement the Proxy Verifier client extensions. ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/autest-site/directive_engine.py b/tests/autests/gold_tests/autest-site/directive_engine.py index 86a2f55eb..82438c4d8 100644 --- a/tests/autests/gold_tests/autest-site/directive_engine.py +++ b/tests/autests/gold_tests/autest-site/directive_engine.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/autest-site/proxy.test.ext b/tests/autests/gold_tests/autest-site/proxy.test.ext index faeb1aeb5..7cc0caa29 100755 --- a/tests/autests/gold_tests/autest-site/proxy.test.ext +++ b/tests/autests/gold_tests/autest-site/proxy.test.ext @@ -3,7 +3,7 @@ Implement Proxy Verifier test proxy logic ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/autest-site/proxy_protocol_context.py b/tests/autests/gold_tests/autest-site/proxy_protocol_context.py index 9e54fc90c..b227aa22d 100644 --- a/tests/autests/gold_tests/autest-site/proxy_protocol_context.py +++ b/tests/autests/gold_tests/autest-site/proxy_protocol_context.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/autest-site/replay_gen.test.ext b/tests/autests/gold_tests/autest-site/replay_gen.test.ext index 717f6b958..58c4f2d66 100755 --- a/tests/autests/gold_tests/autest-site/replay_gen.test.ext +++ b/tests/autests/gold_tests/autest-site/replay_gen.test.ext @@ -3,7 +3,7 @@ Implement the replay-gen.py extension. ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/autest-site/server.test.ext b/tests/autests/gold_tests/autest-site/server.test.ext index 9aa98db78..b65d7f6af 100755 --- a/tests/autests/gold_tests/autest-site/server.test.ext +++ b/tests/autests/gold_tests/autest-site/server.test.ext @@ -3,7 +3,7 @@ Implement the Proxy Verifier test server extension. ''' # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/autest-site/socket_util.py b/tests/autests/gold_tests/autest-site/socket_util.py index 8ca32bc13..49fab9540 100755 --- a/tests/autests/gold_tests/autest-site/socket_util.py +++ b/tests/autests/gold_tests/autest-site/socket_util.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2020, Verizon Media +# Copyright 2020-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/autest-site/test_proxy.py b/tests/autests/gold_tests/autest-site/test_proxy.py index 2efba8a1d..c99757d98 100644 --- a/tests/autests/gold_tests/autest-site/test_proxy.py +++ b/tests/autests/gold_tests/autest-site/test_proxy.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/await/await.replay.yaml b/tests/autests/gold_tests/await/await.replay.yaml index 40fe8ebdf..50c0061f9 100644 --- a/tests/autests/gold_tests/await/await.replay.yaml +++ b/tests/autests/gold_tests/await/await.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/await/await.test.py b/tests/autests/gold_tests/await/await.test.py index 6d013cf37..6bbe506c7 100644 --- a/tests/autests/gold_tests/await/await.test.py +++ b/tests/autests/gold_tests/await/await.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/body/body.test.py b/tests/autests/gold_tests/body/body.test.py index f6bd8eb4a..a1e84df6f 100644 --- a/tests/autests/gold_tests/body/body.test.py +++ b/tests/autests/gold_tests/body/body.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/body_verification/body_verification.test.py b/tests/autests/gold_tests/body_verification/body_verification.test.py index 13aef1d12..42a167e50 100644 --- a/tests/autests/gold_tests/body_verification/body_verification.test.py +++ b/tests/autests/gold_tests/body_verification/body_verification.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/delay/delay.test.py b/tests/autests/gold_tests/delay/delay.test.py index 9e5f1b38c..70247914c 100644 --- a/tests/autests/gold_tests/delay/delay.test.py +++ b/tests/autests/gold_tests/delay/delay.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/delay/verify_duration.py b/tests/autests/gold_tests/delay/verify_duration.py index 679be7c22..6e075bc38 100755 --- a/tests/autests/gold_tests/delay/verify_duration.py +++ b/tests/autests/gold_tests/delay/verify_duration.py @@ -4,7 +4,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/doctest/doctest.test.py b/tests/autests/gold_tests/doctest/doctest.test.py index 13978890e..4e11dd99e 100644 --- a/tests/autests/gold_tests/doctest/doctest.test.py +++ b/tests/autests/gold_tests/doctest/doctest.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/doctest/verify_example_replay_contents.py b/tests/autests/gold_tests/doctest/verify_example_replay_contents.py index fa5da8215..586aec76b 100644 --- a/tests/autests/gold_tests/doctest/verify_example_replay_contents.py +++ b/tests/autests/gold_tests/doctest/verify_example_replay_contents.py @@ -4,7 +4,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/field_parsing/duplicate_fields.test.py b/tests/autests/gold_tests/field_parsing/duplicate_fields.test.py index ce7626588..81985ef2f 100644 --- a/tests/autests/gold_tests/field_parsing/duplicate_fields.test.py +++ b/tests/autests/gold_tests/field_parsing/duplicate_fields.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2020, Verizon Media +# Copyright 2020-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/field_parsing/empty_field.test.py b/tests/autests/gold_tests/field_parsing/empty_field.test.py index 31ea5ab94..58a04b530 100644 --- a/tests/autests/gold_tests/field_parsing/empty_field.test.py +++ b/tests/autests/gold_tests/field_parsing/empty_field.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/field_parsing/empty_proxy.test.py b/tests/autests/gold_tests/field_parsing/empty_proxy.test.py index 8eef220cc..6a8bdb030 100644 --- a/tests/autests/gold_tests/field_parsing/empty_proxy.test.py +++ b/tests/autests/gold_tests/field_parsing/empty_proxy.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2020, Verizon Media +# Copyright 2020-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/field_parsing/parse_yaml.test.py b/tests/autests/gold_tests/field_parsing/parse_yaml.test.py index d5b223fa2..729d3e5b0 100644 --- a/tests/autests/gold_tests/field_parsing/parse_yaml.test.py +++ b/tests/autests/gold_tests/field_parsing/parse_yaml.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2020, Verizon Media +# Copyright 2020-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http/http.test.py b/tests/autests/gold_tests/http/http.test.py index affc6c18b..aabd0998d 100644 --- a/tests/autests/gold_tests/http/http.test.py +++ b/tests/autests/gold_tests/http/http.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http/replay_files/multiple_transactions/file3.yaml b/tests/autests/gold_tests/http/replay_files/multiple_transactions/file3.yaml index 6dc04dbaf..025370712 100644 --- a/tests/autests/gold_tests/http/replay_files/multiple_transactions/file3.yaml +++ b/tests/autests/gold_tests/http/replay_files/multiple_transactions/file3.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http2/http2.test.py b/tests/autests/gold_tests/http2/http2.test.py index 94300c602..2950f503e 100644 --- a/tests/autests/gold_tests/http2/http2.test.py +++ b/tests/autests/gold_tests/http2/http2.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http2_abort/http2_abort.test.py b/tests/autests/gold_tests/http2_abort/http2_abort.test.py index 59787a268..09de6fc83 100644 --- a/tests/autests/gold_tests/http2_abort/http2_abort.test.py +++ b/tests/autests/gold_tests/http2_abort/http2_abort.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http2_abort/replay_files/server_goaway_after_headers.yaml b/tests/autests/gold_tests/http2_abort/replay_files/server_goaway_after_headers.yaml index af8ff5958..da15aba01 100644 --- a/tests/autests/gold_tests/http2_abort/replay_files/server_goaway_after_headers.yaml +++ b/tests/autests/gold_tests/http2_abort/replay_files/server_goaway_after_headers.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http2_abort/replay_files/server_rst_stream_after_headers.yaml b/tests/autests/gold_tests/http2_abort/replay_files/server_rst_stream_after_headers.yaml index b7373c7dd..506a848a8 100644 --- a/tests/autests/gold_tests/http2_abort/replay_files/server_rst_stream_after_headers.yaml +++ b/tests/autests/gold_tests/http2_abort/replay_files/server_rst_stream_after_headers.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http2_close_on_goaway/http2_close_on_goaway.test.py b/tests/autests/gold_tests/http2_close_on_goaway/http2_close_on_goaway.test.py index 708895382..91d4ea2b7 100644 --- a/tests/autests/gold_tests/http2_close_on_goaway/http2_close_on_goaway.test.py +++ b/tests/autests/gold_tests/http2_close_on_goaway/http2_close_on_goaway.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2024, Verizon Media +# Copyright 2024-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # Test.Summary = ''' diff --git a/tests/autests/gold_tests/http2_close_on_goaway/http2_close_on_goaway.yaml b/tests/autests/gold_tests/http2_close_on_goaway/http2_close_on_goaway.yaml index 005c6fbb2..958dcc6ad 100644 --- a/tests/autests/gold_tests/http2_close_on_goaway/http2_close_on_goaway.yaml +++ b/tests/autests/gold_tests/http2_close_on_goaway/http2_close_on_goaway.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2024, Verizon Media +# Copyright 2024-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http2_frames/http2_frames.test.py b/tests/autests/gold_tests/http2_frames/http2_frames.test.py index 56d77d3ad..0701bf79b 100644 --- a/tests/autests/gold_tests/http2_frames/http2_frames.test.py +++ b/tests/autests/gold_tests/http2_frames/http2_frames.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http2_frames/http2_multi_data_frames.test.py b/tests/autests/gold_tests/http2_frames/http2_multi_data_frames.test.py index 73bacca43..2d3c9f5df 100644 --- a/tests/autests/gold_tests/http2_frames/http2_multi_data_frames.test.py +++ b/tests/autests/gold_tests/http2_frames/http2_multi_data_frames.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http2_frames/verify_duration.py b/tests/autests/gold_tests/http2_frames/verify_duration.py index 2226ad38e..3a7a1b1bf 100755 --- a/tests/autests/gold_tests/http2_frames/verify_duration.py +++ b/tests/autests/gold_tests/http2_frames/verify_duration.py @@ -4,7 +4,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/http3/http3.test.py b/tests/autests/gold_tests/http3/http3.test.py index 43d9a91a7..39b7e110b 100644 --- a/tests/autests/gold_tests/http3/http3.test.py +++ b/tests/autests/gold_tests/http3/http3.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/https/https.test.py b/tests/autests/gold_tests/https/https.test.py index c1bac1a2d..944549b98 100644 --- a/tests/autests/gold_tests/https/https.test.py +++ b/tests/autests/gold_tests/https/https.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/https/mtls.test.py b/tests/autests/gold_tests/https/mtls.test.py index dcbeee824..b6bf6e66e 100644 --- a/tests/autests/gold_tests/https/mtls.test.py +++ b/tests/autests/gold_tests/https/mtls.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/ipv6/ipv6.test.py b/tests/autests/gold_tests/ipv6/ipv6.test.py index 884ae3e8b..e89e0cac9 100644 --- a/tests/autests/gold_tests/ipv6/ipv6.test.py +++ b/tests/autests/gold_tests/ipv6/ipv6.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/no_proxy/no_proxy.test.py b/tests/autests/gold_tests/no_proxy/no_proxy.test.py index 7000aa116..27d21e82f 100644 --- a/tests/autests/gold_tests/no_proxy/no_proxy.test.py +++ b/tests/autests/gold_tests/no_proxy/no_proxy.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/proxy-protocol/proxy_protocol.test.py b/tests/autests/gold_tests/proxy-protocol/proxy_protocol.test.py index 39d7c845b..ae5261a32 100644 --- a/tests/autests/gold_tests/proxy-protocol/proxy_protocol.test.py +++ b/tests/autests/gold_tests/proxy-protocol/proxy_protocol.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/proxy-protocol/replay_files/http_pp_v1_with_address.replay.yaml b/tests/autests/gold_tests/proxy-protocol/replay_files/http_pp_v1_with_address.replay.yaml index fb3d81773..d0836e020 100644 --- a/tests/autests/gold_tests/proxy-protocol/replay_files/http_pp_v1_with_address.replay.yaml +++ b/tests/autests/gold_tests/proxy-protocol/replay_files/http_pp_v1_with_address.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_no_pp.replay.yaml b/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_no_pp.replay.yaml index f2ed452ec..b4b19fc18 100644 --- a/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_no_pp.replay.yaml +++ b/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_no_pp.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_pp_v1.replay.yaml b/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_pp_v1.replay.yaml index 0acc8ef4b..d3590b196 100644 --- a/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_pp_v1.replay.yaml +++ b/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_pp_v1.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_pp_v2.replay.yaml b/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_pp_v2.replay.yaml index 93511ed84..100d90593 100644 --- a/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_pp_v2.replay.yaml +++ b/tests/autests/gold_tests/proxy-protocol/replay_files/http_single_transaction_pp_v2.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/proxy-protocol/replay_files/https_single_transaction_pp_v1.replay.yaml b/tests/autests/gold_tests/proxy-protocol/replay_files/https_single_transaction_pp_v1.replay.yaml index 2487df564..769c7984e 100644 --- a/tests/autests/gold_tests/proxy-protocol/replay_files/https_single_transaction_pp_v1.replay.yaml +++ b/tests/autests/gold_tests/proxy-protocol/replay_files/https_single_transaction_pp_v1.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # --- diff --git a/tests/autests/gold_tests/proxy-protocol/replay_files/https_single_transaction_pp_v2.replay.yaml b/tests/autests/gold_tests/proxy-protocol/replay_files/https_single_transaction_pp_v2.replay.yaml index 8d35962bd..3e57efe0f 100644 --- a/tests/autests/gold_tests/proxy-protocol/replay_files/https_single_transaction_pp_v2.replay.yaml +++ b/tests/autests/gold_tests/proxy-protocol/replay_files/https_single_transaction_pp_v2.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # --- diff --git a/tests/autests/gold_tests/proxy-protocol/replay_files/single_transaction_ipv6_pp_v1.replay.yaml b/tests/autests/gold_tests/proxy-protocol/replay_files/single_transaction_ipv6_pp_v1.replay.yaml index 707945a72..68fcc6bd4 100644 --- a/tests/autests/gold_tests/proxy-protocol/replay_files/single_transaction_ipv6_pp_v1.replay.yaml +++ b/tests/autests/gold_tests/proxy-protocol/replay_files/single_transaction_ipv6_pp_v1.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/proxy-protocol/replay_files/single_transaction_ipv6_pp_v2.replay.yaml b/tests/autests/gold_tests/proxy-protocol/replay_files/single_transaction_ipv6_pp_v2.replay.yaml index 4844f5fd9..c3f80497c 100644 --- a/tests/autests/gold_tests/proxy-protocol/replay_files/single_transaction_ipv6_pp_v2.replay.yaml +++ b/tests/autests/gold_tests/proxy-protocol/replay_files/single_transaction_ipv6_pp_v2.replay.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/replay_gen/replay_gen.test.py b/tests/autests/gold_tests/replay_gen/replay_gen.test.py index ee2e34a52..b1e64f1c6 100644 --- a/tests/autests/gold_tests/replay_gen/replay_gen.test.py +++ b/tests/autests/gold_tests/replay_gen/replay_gen.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/status_verification/replay_files/status_verification.yaml b/tests/autests/gold_tests/status_verification/replay_files/status_verification.yaml index b45414179..771d4553d 100644 --- a/tests/autests/gold_tests/status_verification/replay_files/status_verification.yaml +++ b/tests/autests/gold_tests/status_verification/replay_files/status_verification.yaml @@ -1,6 +1,6 @@ # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/status_verification/status_verification.test.py b/tests/autests/gold_tests/status_verification/status_verification.test.py index 4dfac3138..6daf8be4c 100644 --- a/tests/autests/gold_tests/status_verification/status_verification.test.py +++ b/tests/autests/gold_tests/status_verification/status_verification.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2023, Verizon Media +# Copyright 2023-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/strict_mode/strict_mode.test.py b/tests/autests/gold_tests/strict_mode/strict_mode.test.py index 042d6208d..bd76e5546 100644 --- a/tests/autests/gold_tests/strict_mode/strict_mode.test.py +++ b/tests/autests/gold_tests/strict_mode/strict_mode.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/gold_tests/url_verification/url_verification.test.py b/tests/autests/gold_tests/url_verification/url_verification.test.py index abdc8f097..80a01e682 100644 --- a/tests/autests/gold_tests/url_verification/url_verification.test.py +++ b/tests/autests/gold_tests/url_verification/url_verification.test.py @@ -3,7 +3,7 @@ ''' # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/autests/test-env-check.sh b/tests/autests/test-env-check.sh index c0e2a97b0..976417c92 100755 --- a/tests/autests/test-env-check.sh +++ b/tests/autests/test-env-check.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2020, Verizon Media +# Copyright 2020-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tests/unit_tests/test_chunk_parsing.cc b/tests/unit_tests/test_chunk_parsing.cc index 67a52cd75..6ac4bb338 100644 --- a/tests/unit_tests/test_chunk_parsing.cc +++ b/tests/unit_tests/test_chunk_parsing.cc @@ -1,7 +1,7 @@ /** @file * Unit tests for HttpReplay.h. * - * Copyright 2020, Verizon Media + * Copyright 2020-2026, Verizon Media * SPDX-License-Identifier: Apache-2.0 */ diff --git a/tools/clang-format.sh b/tools/clang-format.sh index 179121828..447116943 100755 --- a/tools/clang-format.sh +++ b/tools/clang-format.sh @@ -2,7 +2,7 @@ # # Simple wrapper to run clang-format on a bunch of files # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tools/copyright-update.sh b/tools/copyright-update.sh index 4f7d81f5f..d7d259c93 100755 --- a/tools/copyright-update.sh +++ b/tools/copyright-update.sh @@ -1,7 +1,7 @@ #! /usr/bin/env bash # -# Given a commit, update all the Copyrights of the changed files. -# If no commit is provided, update the currently changed files in the worktree. +# Update Copyrights to the year of each file's most recent commit. +# If a commit is provided, limit the update to files changed by that commit. # # Copyright 2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 @@ -11,31 +11,79 @@ usage="$(basename "$0") [git_commit]" fail() { - echo -e $1 + printf '%b\n' "$1" >&2 exit 1 } [ $# -le 1 ] || fail "Provide at most one git commit.\n\n${usage}" commit=${1:-} +copyright_owners='(Verizon Media|Yahoo)' +copyright_range='(Copyright [[:digit:]]{4}-)[[:digit:]]{4}' +copyright_single='(Copyright [[:digit:]]{4})' +copyright_pattern="Copyright ([[:digit:]]{4})(-([[:digit:]]{4}))?, ${copyright_owners}" tools_dir=$(dirname "$0") git_root=$(dirname "${tools_dir}") -cd "${git_root}" -current_year=$(date +%Y) +cd "${git_root}" || fail "Could not enter the git worktree: ${git_root}" -while IFS= read -r -d '' changed_file; do - [ -f "${changed_file}" ] || continue - grep -q "Copyright " "${changed_file}" || continue - sed -i'.sedbak' \ - "s/Copyright 20[[:digit:]][[:digit:]]/Copyright ${current_year}/g" \ - "${changed_file}" -done < <( - if [ -n "${commit}" ]; then - git diff-tree --no-commit-id --name-only --diff-filter=ACMRTUXB -r -z "${commit}" - else - { - git diff --name-only --diff-filter=ACMRTUXB -z HEAD -- - git ls-files --others --exclude-standard -z - } | awk 'BEGIN { RS = "\0"; ORS = "\0" } !seen[$0]++' - fi -) +if [ -n "${commit}" ]; then + git rev-parse --verify "${commit}^{commit}" >/dev/null 2>&1 || \ + fail "Could not resolve git commit: ${commit}\n\n${usage}" +fi +[ "$(git rev-parse --is-shallow-repository)" = "false" ] || \ + fail "A complete git history is required to determine copyright years." -find . -name '*.sedbak' -delete +selected_files=$(mktemp "${TMPDIR:-/tmp}/copyright-update.XXXXXX") || \ + fail "Could not create a temporary file." +cleanup() +{ + rm -f -- "${selected_files}" +} +trap cleanup EXIT +trap 'exit 1' HUP INT TERM + +if [ -n "${commit}" ]; then + git diff-tree --no-commit-id --name-only --diff-filter=ACMRTUXB -r \ + "${commit}" > "${selected_files}" +else + git ls-files > "${selected_files}" +fi + +# A single history traversal avoids invoking git once for every tracked file. +git log --format='CopyrightYear:%cd' --date=format:%Y --name-only \ + --diff-filter=ACMRTUXB HEAD -- | + awk ' + NR == FNR { + selected[$0] = 1 + next + } + /^CopyrightYear:[[:digit:]]{4}$/ { + year = substr($0, 15) + next + } + year != "" && $0 in selected && !seen[$0]++ { + print year "\t" $0 + } + ' "${selected_files}" - | + while IFS="$(printf '\t')" read -r last_commit_year tracked_file; do + [ -f "${tracked_file}" ] || continue + # Do not alter copyrights embedded in vendored sources. + copyright=$(grep -Em1 "${copyright_pattern}" "${tracked_file}") || continue + [[ "${copyright}" =~ ${copyright_pattern} ]] || continue + first_year=${BASH_REMATCH[1]} + last_header_year=${BASH_REMATCH[3]} + + backup_suffix=".copyright-update.$$" + if [ -n "${last_header_year}" ]; then + [ "${last_header_year}" != "${last_commit_year}" ] || continue + # A range retains its starting year; only its ending year changes. + sed -E -i"${backup_suffix}" \ + -e "s/${copyright_range}(, ${copyright_owners})/\\1${last_commit_year}\\2/g" \ + "${tracked_file}" + else + [ "${first_year}" != "${last_commit_year}" ] || continue + # Preserve the first year by extending a single year into a range. + sed -E -i"${backup_suffix}" \ + -e "s/${copyright_single}(, ${copyright_owners})/\\1-${last_commit_year}\\2/g" \ + "${tracked_file}" + fi + rm -f -- "${tracked_file}${backup_suffix}" + done diff --git a/tools/pr-prep.sh b/tools/pr-prep.sh new file mode 100755 index 000000000..54ba48e7f --- /dev/null +++ b/tools/pr-prep.sh @@ -0,0 +1,14 @@ +#! /usr/bin/env bash +# +# Prepare the worktree for a pull request. +# +# Copyright 2026, Verizon Media +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +tools_dir=$(dirname -- "$0") + +bash -e "${tools_dir}/format.sh" +bash -e "${tools_dir}/copyright-update.sh" diff --git a/tools/remap-config-to-url-list.py b/tools/remap-config-to-url-list.py index cd168dedd..9a33fb11c 100755 --- a/tools/remap-config-to-url-list.py +++ b/tools/remap-config-to-url-list.py @@ -2,7 +2,7 @@ # @file # -# Copyright 2021, Verizon Media +# Copyright 2021-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 # diff --git a/tools/replay-gen.py b/tools/replay-gen.py index fff67d1d4..7ba3f3a5b 100755 --- a/tools/replay-gen.py +++ b/tools/replay-gen.py @@ -2,7 +2,7 @@ # @file # -# Copyright 2022, Verizon Media +# Copyright 2022-2026, Verizon Media # SPDX-License-Identifier: Apache-2.0 #