From 095e0f044d49883a3b1ec2b5d0127bd728688e9c Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Fri, 22 May 2026 18:33:38 +0200 Subject: [PATCH] CAMEL-23582: camel-github2 - align Exchange header constant names with Camel naming convention (#23454) Renames the producer-side Exchange header string values in GitHub2Constants from non-Camel prefixed values (GitHubPullRequest, GitHubInResponseTo, GitHubPullRequestHeadCommitSHA, GitHubIssueTitle) to CamelGitHub, following the convention used across the rest of the Camel component catalog and matching the pattern established in CAMEL-23526 (camel-cxf), CAMEL-23522 (camel-mail), CAMEL-23461 (camel-aws-bedrock), CAMEL-23532 (camel-vertx-websocket / camel-atmosphere-websocket / camel-iggy), and CAMEL-23576 (camel-jira). The Java field names (GITHUB_PULLREQUEST, GITHUB_INRESPONSETO, GITHUB_PULLREQUEST_HEAD_COMMIT_SHA, GITHUB_ISSUE_TITLE) are unchanged so routes referencing the constants symbolically continue to work; routes using the literal string values must be updated (documented in the 4.21 upgrade guide). The producer Javadocs that quote these header names are updated for consistency. The consumer-side constants (GITHUB_COMMIT_AUTHOR, GITHUB_COMMIT_COMMITTER, GITHUB_COMMIT_SHA, GITHUB_COMMIT_URL, GITHUB_EVENT_PAYLOAD) were already Camel-prefixed and are unchanged, as is the GITHUB_CLIENT registry-lookup key. Note: CAMEL-23582 originally also scoped camel-github, but that deprecated component was removed in Camel 4.21 (commit "Remove camel-github component") before this rename, so only camel-github2 is addressed here. The generated Endpoint DSL accessor gitHubPullRequestHeadCommitSHA() has been renamed to gitHubPullRequestHeadCommitSha() as a consequence of aligning the SHA acronym casing; the other accessors keep their names but return the new Camel-prefixed values. Tracker: CAMEL-23577 Reported by Claude Code on behalf of Andrea Cosentino Signed-off-by: Andrea Cosentino --- .../camel/catalog/components/github2.json | 8 ++-- .../camel/component/github2/github2.json | 8 ++-- .../component/github2/GitHub2Constants.java | 8 ++-- .../producer/ClosePullRequestProducer.java | 4 +- .../github2/producer/CreateIssueProducer.java | 4 +- .../producer/PullRequestCommentProducer.java | 6 +-- .../producer/PullRequestFilesProducer.java | 2 +- .../producer/PullRequestStateProducer.java | 4 +- .../pages/camel-4x-upgrade-guide-4_18.adoc | 41 +++++++++++++++++++ .../dsl/GitHub2EndpointBuilderFactory.java | 12 +++--- 10 files changed, 69 insertions(+), 28 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/github2.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/github2.json index 4717f4d510b92..25c2eed9d8fb8 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/github2.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/github2.json @@ -33,10 +33,10 @@ "oauthToken": { "index": 6, "kind": "property", "displayName": "Oauth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "GitHub OAuth token. Must be configured on either component or endpoint." } }, "headers": { - "GitHubPullRequest": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "org.kohsuke.github.GHPullRequest or Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The pull request", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_PULLREQUEST" }, - "GitHubInResponseTo": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The id of the comment to reply to", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_INRESPONSETO" }, - "GitHubPullRequestHeadCommitSHA": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The sha of the head of the pull request", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_PULLREQUEST_HEAD_COMMIT_SHA" }, - "GitHubIssueTitle": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The title of the issue", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_ISSUE_TITLE" }, + "CamelGitHubPullRequest": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "org.kohsuke.github.GHPullRequest or Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The pull request", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_PULLREQUEST" }, + "CamelGitHubInResponseTo": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The id of the comment to reply to", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_INRESPONSETO" }, + "CamelGitHubPullRequestHeadCommitSha": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The sha of the head of the pull request", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_PULLREQUEST_HEAD_COMMIT_SHA" }, + "CamelGitHubIssueTitle": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The title of the issue", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_ISSUE_TITLE" }, "CamelGitHubCommitAuthor": { "index": 4, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The commit author", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_COMMIT_AUTHOR" }, "CamelGitHubCommitCommitter": { "index": 5, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The committer name", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_COMMIT_COMMITTER" }, "CamelGitHubCommitSha": { "index": 6, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The commit sha", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_COMMIT_SHA" }, diff --git a/components/camel-github2/src/generated/resources/META-INF/org/apache/camel/component/github2/github2.json b/components/camel-github2/src/generated/resources/META-INF/org/apache/camel/component/github2/github2.json index 4717f4d510b92..25c2eed9d8fb8 100644 --- a/components/camel-github2/src/generated/resources/META-INF/org/apache/camel/component/github2/github2.json +++ b/components/camel-github2/src/generated/resources/META-INF/org/apache/camel/component/github2/github2.json @@ -33,10 +33,10 @@ "oauthToken": { "index": 6, "kind": "property", "displayName": "Oauth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "GitHub OAuth token. Must be configured on either component or endpoint." } }, "headers": { - "GitHubPullRequest": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "org.kohsuke.github.GHPullRequest or Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The pull request", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_PULLREQUEST" }, - "GitHubInResponseTo": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The id of the comment to reply to", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_INRESPONSETO" }, - "GitHubPullRequestHeadCommitSHA": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The sha of the head of the pull request", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_PULLREQUEST_HEAD_COMMIT_SHA" }, - "GitHubIssueTitle": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The title of the issue", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_ISSUE_TITLE" }, + "CamelGitHubPullRequest": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "org.kohsuke.github.GHPullRequest or Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The pull request", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_PULLREQUEST" }, + "CamelGitHubInResponseTo": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The id of the comment to reply to", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_INRESPONSETO" }, + "CamelGitHubPullRequestHeadCommitSha": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The sha of the head of the pull request", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_PULLREQUEST_HEAD_COMMIT_SHA" }, + "CamelGitHubIssueTitle": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The title of the issue", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_ISSUE_TITLE" }, "CamelGitHubCommitAuthor": { "index": 4, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The commit author", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_COMMIT_AUTHOR" }, "CamelGitHubCommitCommitter": { "index": 5, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The committer name", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_COMMIT_COMMITTER" }, "CamelGitHubCommitSha": { "index": 6, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The commit sha", "constantName": "org.apache.camel.component.github2.GitHub2Constants#GITHUB_COMMIT_SHA" }, diff --git a/components/camel-github2/src/main/java/org/apache/camel/component/github2/GitHub2Constants.java b/components/camel-github2/src/main/java/org/apache/camel/component/github2/GitHub2Constants.java index 43f272887d4ba..140b48118a239 100644 --- a/components/camel-github2/src/main/java/org/apache/camel/component/github2/GitHub2Constants.java +++ b/components/camel-github2/src/main/java/org/apache/camel/component/github2/GitHub2Constants.java @@ -23,13 +23,13 @@ public interface GitHub2Constants { String GITHUB_CLIENT = "github2Client"; @Metadata(description = "The pull request", javaType = "org.kohsuke.github.GHPullRequest or Integer") - String GITHUB_PULLREQUEST = "GitHubPullRequest"; + String GITHUB_PULLREQUEST = "CamelGitHubPullRequest"; @Metadata(label = "producer", description = "The id of the comment to reply to", javaType = "Long") - String GITHUB_INRESPONSETO = "GitHubInResponseTo"; + String GITHUB_INRESPONSETO = "CamelGitHubInResponseTo"; @Metadata(description = "The sha of the head of the pull request", javaType = "String") - String GITHUB_PULLREQUEST_HEAD_COMMIT_SHA = "GitHubPullRequestHeadCommitSHA"; + String GITHUB_PULLREQUEST_HEAD_COMMIT_SHA = "CamelGitHubPullRequestHeadCommitSha"; @Metadata(label = "producer", description = "The title of the issue", javaType = "String") - String GITHUB_ISSUE_TITLE = "GitHubIssueTitle"; + String GITHUB_ISSUE_TITLE = "CamelGitHubIssueTitle"; @Metadata(label = "consumer", description = "The commit author", javaType = "String") String GITHUB_COMMIT_AUTHOR = "CamelGitHubCommitAuthor"; diff --git a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/ClosePullRequestProducer.java b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/ClosePullRequestProducer.java index 0946dfde12296..74e44192fcf05 100644 --- a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/ClosePullRequestProducer.java +++ b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/ClosePullRequestProducer.java @@ -23,8 +23,8 @@ import org.kohsuke.github.GHPullRequest; /** - * Producer endpoint that closes a pull request. The endpoint requires the "GitHubPullRequest" header, identifying the - * pull request number (integer). + * Producer endpoint that closes a pull request. The endpoint requires the "CamelGitHubPullRequest" header, identifying + * the pull request number (integer). */ public class ClosePullRequestProducer extends AbstractGitHub2Producer { diff --git a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/CreateIssueProducer.java b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/CreateIssueProducer.java index ae469b9269380..333495ea6b35f 100644 --- a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/CreateIssueProducer.java +++ b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/CreateIssueProducer.java @@ -23,8 +23,8 @@ import org.kohsuke.github.GHIssue; /** - * Producer endpoint that creates an issue. The endpoint requires the "GitHubIssueTitle" header, which sets the GitHub - * issue title. The issue body content is set from the exchange message body. + * Producer endpoint that creates an issue. The endpoint requires the "CamelGitHubIssueTitle" header, which sets the + * GitHub issue title. The issue body content is set from the exchange message body. */ public class CreateIssueProducer extends AbstractGitHub2Producer { diff --git a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestCommentProducer.java b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestCommentProducer.java index 41696e19a2a6c..2e83d14fa56ea 100644 --- a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestCommentProducer.java +++ b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestCommentProducer.java @@ -28,9 +28,9 @@ /** * Producer endpoint that adds a comment on a GitHub pull request. * - * The endpoint requires the "GitHubPullRequest" header, identifying the pull request number (integer). If the - * "GitHubInResponseTo" header is provided (identifying a comment ID), the comment will be a reply to that comment (if - * supported). + * The endpoint requires the "CamelGitHubPullRequest" header, identifying the pull request number (integer). If the + * "CamelGitHubInResponseTo" header is provided (identifying a comment ID), the comment will be a reply to that comment + * (if supported). */ public class PullRequestCommentProducer extends AbstractGitHub2Producer { diff --git a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestFilesProducer.java b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestFilesProducer.java index 8d657ede90722..b8c8a938105f3 100644 --- a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestFilesProducer.java +++ b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestFilesProducer.java @@ -27,7 +27,7 @@ import org.kohsuke.github.GHPullRequestFileDetail; /** - * Producer endpoint that gets the list of files in a pull request. The endpoint requires the "GitHubPullRequest" + * Producer endpoint that gets the list of files in a pull request. The endpoint requires the "CamelGitHubPullRequest" * header, identifying the pull request number (integer). */ public class PullRequestFilesProducer extends AbstractGitHub2Producer { diff --git a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestStateProducer.java b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestStateProducer.java index bb7c5e12d8737..76d7ea5d8d1a5 100644 --- a/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestStateProducer.java +++ b/components/camel-github2/src/main/java/org/apache/camel/component/github2/producer/PullRequestStateProducer.java @@ -27,8 +27,8 @@ /** * Producer endpoint that sets the commit status. * - * The endpoint requires the "GitHubPullRequestHeadCommitSHA" header, identifying the commit SHA on which the state will - * be recorded. + * The endpoint requires the "CamelGitHubPullRequestHeadCommitSha" header, identifying the commit SHA on which the state + * will be recorded. */ public class PullRequestStateProducer extends AbstractGitHub2Producer { diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc index 373517f09bd00..ecbe4a88a13de 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc @@ -361,6 +361,47 @@ As a consequence, the generated Endpoint DSL header accessors on +=== camel-github2 - potential breaking change + +The producer-side Exchange header constants in `GitHub2Constants` have been +renamed to follow the Camel naming convention used across the rest of the +component catalog. The Java field names are unchanged; only the header string +values have changed: + +[options="header"] +|=== +| Constant | Previous value | New value +| `GitHub2Constants.GITHUB_PULLREQUEST` | `GitHubPullRequest` | `CamelGitHubPullRequest` +| `GitHub2Constants.GITHUB_INRESPONSETO` | `GitHubInResponseTo` | `CamelGitHubInResponseTo` +| `GitHub2Constants.GITHUB_PULLREQUEST_HEAD_COMMIT_SHA` | `GitHubPullRequestHeadCommitSHA` | `CamelGitHubPullRequestHeadCommitSha` +| `GitHub2Constants.GITHUB_ISSUE_TITLE` | `GitHubIssueTitle` | `CamelGitHubIssueTitle` +|=== + +The consumer-side constants (`GITHUB_COMMIT_AUTHOR`, `GITHUB_COMMIT_COMMITTER`, +`GITHUB_COMMIT_SHA`, `GITHUB_COMMIT_URL`, `GITHUB_EVENT_PAYLOAD`) were already +`Camel`-prefixed (`CamelGitHubCommitAuthor`, etc.) and are unchanged, as is the +`GITHUB_CLIENT` registry-lookup key (`github2Client`). + +Routes that reference the constants symbolically (for example +`setHeader(GitHub2Constants.GITHUB_PULLREQUEST, ...)`) continue to work without +changes. Routes that set the header by its literal string value (for example +`setHeader("GitHubPullRequest", ...)`) must be updated to use the new value +(`setHeader("CamelGitHubPullRequest", ...)`). + +As a consequence, the generated Endpoint DSL header accessor +`gitHubPullRequestHeadCommitSHA()` on `GitHub2HeaderNameBuilder` has been +renamed to `gitHubPullRequestHeadCommitSha()`. The remaining accessors +(`gitHubPullRequest()`, `gitHubInResponseTo()`, `gitHubIssueTitle()`) keep +their names but now return the new `Camel`-prefixed values. + +NOTE: The deprecated `camel-github` component (predecessor of `camel-github2`) +is not affected by this change on the 4.18.x line; it remains present in +4.18.x as deprecated and was only removed on the 4.21 development branch. + + + + + === camel-web3j - potential breaking change The Exchange header constants in `Web3jConstants` have been renamed to follow the diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GitHub2EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GitHub2EndpointBuilderFactory.java index 700af199dfc9b..b479792a51048 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GitHub2EndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GitHub2EndpointBuilderFactory.java @@ -1182,7 +1182,7 @@ public static class GitHub2HeaderNameBuilder { * @return the name of the header {@code GitHubPullRequest}. */ public String gitHubPullRequest() { - return "GitHubPullRequest"; + return "CamelGitHubPullRequest"; } /** * The id of the comment to reply to. @@ -1194,7 +1194,7 @@ public String gitHubPullRequest() { * @return the name of the header {@code GitHubInResponseTo}. */ public String gitHubInResponseTo() { - return "GitHubInResponseTo"; + return "CamelGitHubInResponseTo"; } /** * The sha of the head of the pull request. @@ -1204,10 +1204,10 @@ public String gitHubInResponseTo() { * Group: common * * @return the name of the header {@code - * GitHubPullRequestHeadCommitSHA}. + * GitHubPullRequestHeadCommitSha}. */ - public String gitHubPullRequestHeadCommitSHA() { - return "GitHubPullRequestHeadCommitSHA"; + public String gitHubPullRequestHeadCommitSha() { + return "CamelGitHubPullRequestHeadCommitSha"; } /** * The title of the issue. @@ -1219,7 +1219,7 @@ public String gitHubPullRequestHeadCommitSHA() { * @return the name of the header {@code GitHubIssueTitle}. */ public String gitHubIssueTitle() { - return "GitHubIssueTitle"; + return "CamelGitHubIssueTitle"; } /** * The commit author.