From e52a83c643f9f760491da928d5597743150e7e54 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Sep 2025 15:03:33 +0000 Subject: [PATCH 1/6] Initial plan From caa3c062bd29a75ad0d032560512efe3839c5aba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Sep 2025 15:08:08 +0000 Subject: [PATCH 2/6] Initial repository exploration and plan for replacing tibdex/github-app-token Co-authored-by: v1v <2871786+v1v@users.noreply.github.com> --- .../EcsLayoutWithCustomMdcSerializerTest.java | 24 +++++++++++++++++++ ...utWithNotExistCustomMdcSerializerTest.java | 24 +++++++++++++++++++ .../log4j2/MdcSerializerResolverTest.java | 24 +++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java index 2cda0eaf..9df1467c 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java @@ -1,3 +1,27 @@ +/*- + * #%L + * Java ECS logging + * %% + * Copyright (C) 2019 - 2025 Elastic and contributors + * %% + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * #L% + */ package co.elastic.logging.log4j2; import static co.elastic.logging.log4j2.CustomMdcSerializer.CUSTOM_MDC_SERIALIZER_TEST_KEY; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java index 170660e9..4733073b 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java @@ -1,3 +1,27 @@ +/*- + * #%L + * Java ECS logging + * %% + * Copyright (C) 2019 - 2025 Elastic and contributors + * %% + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * #L% + */ package co.elastic.logging.log4j2; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java index 906fe9e6..de53f62a 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java @@ -1,3 +1,27 @@ +/*- + * #%L + * Java ECS logging + * %% + * Copyright (C) 2019 - 2025 Elastic and contributors + * %% + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * #L% + */ package co.elastic.logging.log4j2; import org.junit.jupiter.api.Test; From 4a4cae2847862036a19082366ac01c5ca9bdb4e4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Sep 2025 15:10:13 +0000 Subject: [PATCH 3/6] Replace tibdex/github-app-token with actions/create-github-app-token in all workflows Co-authored-by: v1v <2871786+v1v@users.noreply.github.com> --- .github/workflows/addToProject.yml | 13 +++++-------- .github/workflows/labeler.yml | 17 +++++++---------- .github/workflows/pre-post-release.yml | 17 +++++++---------- .github/workflows/updatecli.yml | 13 +++++-------- 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/.github/workflows/addToProject.yml b/.github/workflows/addToProject.yml index 0feaa078..ca4d20bd 100644 --- a/.github/workflows/addToProject.yml +++ b/.github/workflows/addToProject.yml @@ -15,15 +15,12 @@ jobs: steps: - name: Get token id: get_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + uses: actions/create-github-app-token@v1 with: - app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} - private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} - permissions: >- - { - "organization_projects": "write", - "issues": "read" - } + app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permission-organization-projects: write + permission-issues: read - name: Assign issues with milestones to project uses: elastic/assign-one-project-github-action@1.2.2 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index a62d5f27..596e17d9 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -17,17 +17,14 @@ jobs: - name: Get token id: get_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + uses: actions/create-github-app-token@v1 with: - app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} - private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} - permissions: >- - { - "members": "read", - "organization_projects": "write", - "issues": "read", - "pull_requests": "write" - } + app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permission-members: read + permission-organization-projects: write + permission-issues: read + permission-pull-requests: write - name: Add agent-java label run: gh issue edit "${NUMBER}" --add-label "agent-java" --repo "${{ github.repository }}" diff --git a/.github/workflows/pre-post-release.yml b/.github/workflows/pre-post-release.yml index cd6a9c6c..42137891 100644 --- a/.github/workflows/pre-post-release.yml +++ b/.github/workflows/pre-post-release.yml @@ -54,17 +54,14 @@ jobs: steps: - name: Get token id: get_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + uses: actions/create-github-app-token@v1 with: - app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} - private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} - permissions: >- - { - "contents": "write", - "pull_requests": "write" - } - repositories: >- - ["ecs-logging-java"] + app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permission-contents: write + permission-pull-requests: write + repositories: | + ecs-logging-java - uses: actions/checkout@v5 with: diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index e888cd77..c3dff0fc 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -19,15 +19,12 @@ jobs: - name: Get token id: get_token - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + uses: actions/create-github-app-token@v1 with: - app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} - private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} - permissions: >- - { - "contents": "write", - "pull_requests": "write" - } + app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permission-contents: write + permission-pull-requests: write - uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 with: From 53595ba0b85f8b63ec994486c2166672a0c7d76d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 22 Sep 2025 12:57:05 +0200 Subject: [PATCH 4/6] Apply suggestions from code review --- .github/workflows/addToProject.yml | 2 +- .github/workflows/labeler.yml | 2 +- .github/workflows/pre-post-release.yml | 2 +- .github/workflows/updatecli.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/addToProject.yml b/.github/workflows/addToProject.yml index ca4d20bd..3047172b 100644 --- a/.github/workflows/addToProject.yml +++ b/.github/workflows/addToProject.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Get token id: get_token - uses: actions/create-github-app-token@v1 + uses: actions/create-github-app-token@v2 with: app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 596e17d9..1f55f8f7 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -17,7 +17,7 @@ jobs: - name: Get token id: get_token - uses: actions/create-github-app-token@v1 + uses: actions/create-github-app-token@v2 with: app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} diff --git a/.github/workflows/pre-post-release.yml b/.github/workflows/pre-post-release.yml index 42137891..1ddf5b54 100644 --- a/.github/workflows/pre-post-release.yml +++ b/.github/workflows/pre-post-release.yml @@ -54,7 +54,7 @@ jobs: steps: - name: Get token id: get_token - uses: actions/create-github-app-token@v1 + uses: actions/create-github-app-token@v2 with: app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} diff --git a/.github/workflows/updatecli.yml b/.github/workflows/updatecli.yml index c3dff0fc..142acd73 100644 --- a/.github/workflows/updatecli.yml +++ b/.github/workflows/updatecli.yml @@ -19,7 +19,7 @@ jobs: - name: Get token id: get_token - uses: actions/create-github-app-token@v1 + uses: actions/create-github-app-token@v2 with: app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} From 57fe0a62986640bd2d840ce428274c6815643dfa Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 22 Sep 2025 12:57:28 +0200 Subject: [PATCH 5/6] Update .github/workflows/pre-post-release.yml --- .github/workflows/pre-post-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-post-release.yml b/.github/workflows/pre-post-release.yml index 1ddf5b54..7867b4a8 100644 --- a/.github/workflows/pre-post-release.yml +++ b/.github/workflows/pre-post-release.yml @@ -54,7 +54,7 @@ jobs: steps: - name: Get token id: get_token - uses: actions/create-github-app-token@v2 + uses: actions/create-github-app-token@v2 with: app-id: ${{ secrets.OBS_AUTOMATION_APP_ID }} private-key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} From 7514da8efe2d7866094b1ceaf87545fd39ae2c48 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:02:48 +0000 Subject: [PATCH 6/6] Remove unrelated license headers from Java test files Co-authored-by: v1v <2871786+v1v@users.noreply.github.com> --- .../EcsLayoutWithCustomMdcSerializerTest.java | 24 ------------------- ...utWithNotExistCustomMdcSerializerTest.java | 24 ------------------- .../log4j2/MdcSerializerResolverTest.java | 24 ------------------- 3 files changed, 72 deletions(-) diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java index 9df1467c..2cda0eaf 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithCustomMdcSerializerTest.java @@ -1,27 +1,3 @@ -/*- - * #%L - * Java ECS logging - * %% - * Copyright (C) 2019 - 2025 Elastic and contributors - * %% - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * #L% - */ package co.elastic.logging.log4j2; import static co.elastic.logging.log4j2.CustomMdcSerializer.CUSTOM_MDC_SERIALIZER_TEST_KEY; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java index 4733073b..170660e9 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/EcsLayoutWithNotExistCustomMdcSerializerTest.java @@ -1,27 +1,3 @@ -/*- - * #%L - * Java ECS logging - * %% - * Copyright (C) 2019 - 2025 Elastic and contributors - * %% - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * #L% - */ package co.elastic.logging.log4j2; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java index de53f62a..906fe9e6 100644 --- a/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java +++ b/log4j2-ecs-layout/src/test/java/co/elastic/logging/log4j2/MdcSerializerResolverTest.java @@ -1,27 +1,3 @@ -/*- - * #%L - * Java ECS logging - * %% - * Copyright (C) 2019 - 2025 Elastic and contributors - * %% - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * #L% - */ package co.elastic.logging.log4j2; import org.junit.jupiter.api.Test;