jenkinsci / generic-webhook-trigger-plugin

Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
https://plugins.jenkins.io/generic-webhook-trigger
404 stars 159 forks source link

Increased Build-Time #237

Closed Pymann closed 1 year ago

Pymann commented 2 years ago

I know it sounds weird, but I experience an increased build-time, switching from ghprb(github-pullrequest-builder) to gwt(generic-webhook-trigger). We use same environment, same build, same ... except trigger. And for gwt we have exactly factor 2 of build-time. And it doesnt matter if its processor-consuming like compilation or similar, we have factor 2 for flash-processes, cloning or whatever.

Generic Webhook Trigger Plugin Version 1.83 Jenkins Master 2.334

Java Version: awt.toolkit sun.awt.X11.XToolkit executable-war /usr/share/jenkins/jenkins.war file.encoding UTF-8 file.separator / hudson.model.DirectoryBrowserSupport.CSP
java.awt.graphicsenv sun.awt.X11GraphicsEnvironment java.awt.headless true java.awt.printerjob sun.print.PSPrinterJob java.class.path /usr/share/jenkins/jenkins.war java.class.version 55.0 java.home /opt/java/openjdk java.io.tmpdir /tmp java.library.path /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib java.runtime.name OpenJDK Runtime Environment java.runtime.version 11.0.14+9 java.specification.name Java Platform API Specification java.specification.vendor Oracle Corporation java.specification.version 11 java.vendor Eclipse Adoptium java.vendor.url https://adoptium.net/ java.vendor.url.bug https://github.com/adoptium/adoptium-support/issues java.vendor.version Temurin-11.0.14+9 java.version 11.0.14 java.version.date 2022-01-18 java.vm.compressedOopsMode Zero based java.vm.info mixed mode java.vm.name OpenJDK 64-Bit Server VM java.vm.specification.name Java Virtual Machine Specification java.vm.specification.vendor Oracle Corporation java.vm.specification.version 11 java.vm.vendor Eclipse Adoptium java.vm.version 11.0.14+9

tomasbjerre commented 2 years ago

Does the job produce a large build log? Im thinking it might be this code causing it: https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/0377c0486af7960b97f2e0ccb6150a832e4fc616/src/main/java/org/jenkinsci/plugins/gwt/GenericWebhookEnvironmentContributor.java#L52

Do you log contributed variables? Perhaps try switching that off.

Pymann commented 2 years ago

Does the job produce a large build log? Im thinking it might be this code causing it:

https://github.com/jenkinsci/generic-webhook-trigger-plugin/blob/0377c0486af7960b97f2e0ccb6150a832e4fc616/src/main/java/org/jenkinsci/plugins/gwt/GenericWebhookEnvironmentContributor.java#L52

Do you log contributed variables? Perhaps try switching that off.

I will check that, thank you for fast answer.

Actually we can not see any connection there.

Pymann commented 1 year ago

I actually have the feeling, that the environment increases the build time. Somehow all complete Paylod from GithubsPullrequest-Webhook is put to env variables, cant it be suppressed somehow: PL_GWT_PAYLOAD_action=xxx PL_GWT_PAYLOAD_enterprise_avatar_url=xxx PL_GWT_PAYLOAD_enterprise_created_at=xxx PL_GWT_PAYLOAD_enterprise_html_url=xxx PL_GWT_PAYLOAD_enterprise_id=xxx PL_GWT_PAYLOAD_enterprise_name=xxx PL_GWT_PAYLOAD_enterprise_node_id=xxx PL_GWT_PAYLOAD_enterprise_slug=xxx PL_GWT_PAYLOAD_enterprise_updated_at=xxx PL_GWT_PAYLOAD_number=xxx PL_GWT_PAYLOAD_organization_avatar_url=xxx PL_GWT_PAYLOAD_organization_events_url=xxx PL_GWT_PAYLOAD_organization_hooks_url=xxx PL_GWT_PAYLOAD_organization_id=xxx PL_GWT_PAYLOAD_organization_issues_url=xxx PL_GWT_PAYLOAD_organization_login=xxx PL_GWT_PAYLOAD_organization_members_url=xxx PL_GWT_PAYLOAD_organization_node_id=xxx PL_GWT_PAYLOAD_organization_public_members_url=xxx PL_GWT_PAYLOAD_organization_repos_url=xxx PL_GWT_PAYLOAD_organization_url=xxx PL_GWT_PAYLOAD_pull_request_additions=xxx PL_GWT_PAYLOAD_pull_request_author_association=xxx PL_GWT_PAYLOAD_pull_request_base_label=xxx PL_GWT_PAYLOAD_pull_request_base_ref=xxx PL_GWT_PAYLOAD_pull_request_base_repo_allow_auto_merge=xxx PL_GWT_PAYLOAD_pull_request_base_repo_allow_forking=xxx PL_GWT_PAYLOAD_pull_request_base_repo_allow_merge_commit=xxx PL_GWT_PAYLOAD_pull_request_base_repo_allow_rebase_merge=xxx PL_GWT_PAYLOAD_pull_request_base_repo_allow_squash_merge=xxx PL_GWT_PAYLOAD_pull_request_base_repo_archived=xxx PL_GWT_PAYLOAD_pull_request_base_repo_archive_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_assignees_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_blobs_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_branches_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_clone_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_collaborators_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_comments_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_commits_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_compare_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_contents_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_contributors_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_created_at=xxx PL_GWT_PAYLOAD_pull_request_base_repo_default_branch=xxx PL_GWT_PAYLOAD_pull_request_base_repo_delete_branch_on_merge=xxx PL_GWT_PAYLOAD_pull_request_base_repo_deployments_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_disabled=xxx PL_GWT_PAYLOAD_pull_request_base_repo_downloads_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_events_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_fork=xxx PL_GWT_PAYLOAD_pull_request_base_repo_forks=xxx PL_GWT_PAYLOAD_pull_request_base_repo_forks_count=xxx PL_GWT_PAYLOAD_pull_request_base_repo_forks_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_full_name=xxx PL_GWT_PAYLOAD_pull_request_base_repo_git_commits_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_git_refs_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_git_tags_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_git_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_has_downloads=xxx PL_GWT_PAYLOAD_pull_request_base_repo_has_issues=xxx PL_GWT_PAYLOAD_pull_request_base_repo_has_pages=xxx PL_GWT_PAYLOAD_pull_request_base_repo_has_projects=xxx PL_GWT_PAYLOAD_pull_request_base_repo_has_wiki=xxx PL_GWT_PAYLOAD_pull_request_base_repo_hooks_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_html_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_id=xxx PL_GWT_PAYLOAD_pull_request_base_repo_issues_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_issue_comment_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_issue_events_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_is_template=xxx PL_GWT_PAYLOAD_pull_request_base_repo_keys_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_labels_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_languages_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_merges_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_milestones_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_name=xxx PL_GWT_PAYLOAD_pull_request_base_repo_node_id=xxx PL_GWT_PAYLOAD_pull_request_base_repo_notifications_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_open_issues=xxx PL_GWT_PAYLOAD_pull_request_base_repo_open_issues_count=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_avatar_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_events_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_followers_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_following_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_gists_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_html_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_id=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_login=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_node_id=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_organizations_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_received_events_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_repos_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_site_admin=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_starred_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_subscriptions_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_type=xxx PL_GWT_PAYLOAD_pull_request_base_repo_owner_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_private=xxx PL_GWT_PAYLOAD_pull_request_base_repo_pulls_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_pushed_at=xxx PL_GWT_PAYLOAD_pull_request_base_repo_releases_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_size=xxx PL_GWT_PAYLOAD_pull_request_base_repo_ssh_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_stargazers_count=xxx PL_GWT_PAYLOAD_pull_request_base_repo_stargazers_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_statuses_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_subscribers_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_subscription_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_svn_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_tags_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_teams_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_trees_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_updated_at=xxx PL_GWT_PAYLOAD_pull_request_base_repo_url=xxx PL_GWT_PAYLOAD_pull_request_base_repo_visibility=xxx PL_GWT_PAYLOAD_pull_request_base_repo_watchers=xxx PL_GWT_PAYLOAD_pull_request_base_repo_watchers_count=xxx PL_GWT_PAYLOAD_pull_request_base_sha=xxx PL_GWT_PAYLOAD_pull_request_base_user_avatar_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_events_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_followers_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_following_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_gists_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_html_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_id=xxx PL_GWT_PAYLOAD_pull_request_base_user_login=xxx PL_GWT_PAYLOAD_pull_request_base_user_node_id=xxx PL_GWT_PAYLOAD_pull_request_base_user_organizations_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_received_events_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_repos_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_site_admin=xxx PL_GWT_PAYLOAD_pull_request_base_user_starred_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_subscriptions_url=xxx PL_GWT_PAYLOAD_pull_request_base_user_type=xxx PL_GWT_PAYLOAD_pull_request_base_user_url=xxx PL_GWT_PAYLOAD_pull_request_body=xxx PL_GWT_PAYLOAD_pull_request_changed_files=xxx PL_GWT_PAYLOAD_pull_request_comments=xxx PL_GWT_PAYLOAD_pull_request_comments_url=xxx PL_GWT_PAYLOAD_pull_request_commits=xxx PL_GWT_PAYLOAD_pull_request_commits_url=xxx PL_GWT_PAYLOAD_pull_request_created_at=xxx PL_GWT_PAYLOAD_pull_request_deletions=xxx PL_GWT_PAYLOAD_pull_request_diff_url=xxx PL_GWT_PAYLOAD_pull_request_draft=xxx PL_GWT_PAYLOAD_pull_request_head_label=xxx PL_GWT_PAYLOAD_pull_request_head_ref=xxx PL_GWT_PAYLOAD_pull_request_head_repo_allow_auto_merge=xxx PL_GWT_PAYLOAD_pull_request_head_repo_allow_forking=xxx PL_GWT_PAYLOAD_pull_request_head_repo_allow_merge_commit=xxx PL_GWT_PAYLOAD_pull_request_head_repo_allow_rebase_merge=xxx PL_GWT_PAYLOAD_pull_request_head_repo_allow_squash_merge=xxx PL_GWT_PAYLOAD_pull_request_head_repo_archived=xxx PL_GWT_PAYLOAD_pull_request_head_repo_archive_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_assignees_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_blobs_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_branches_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_clone_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_collaborators_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_comments_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_commits_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_compare_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_contents_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_contributors_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_created_at=xxx PL_GWT_PAYLOAD_pull_request_head_repo_default_branch=xxx PL_GWT_PAYLOAD_pull_request_head_repo_delete_branch_on_merge=xxx PL_GWT_PAYLOAD_pull_request_head_repo_deployments_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_disabled=xxx PL_GWT_PAYLOAD_pull_request_head_repo_downloads_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_events_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_fork=xxx PL_GWT_PAYLOAD_pull_request_head_repo_forks=xxx PL_GWT_PAYLOAD_pull_request_head_repo_forks_count=xxx PL_GWT_PAYLOAD_pull_request_head_repo_forks_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_full_name=xxx PL_GWT_PAYLOAD_pull_request_head_repo_git_commits_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_git_refs_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_git_tags_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_git_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_has_downloads=xxx PL_GWT_PAYLOAD_pull_request_head_repo_has_issues=xxx PL_GWT_PAYLOAD_pull_request_head_repo_has_pages=xxx PL_GWT_PAYLOAD_pull_request_head_repo_has_projects=xxx PL_GWT_PAYLOAD_pull_request_head_repo_has_wiki=xxx PL_GWT_PAYLOAD_pull_request_head_repo_hooks_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_html_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_id=xxx PL_GWT_PAYLOAD_pull_request_head_repo_issues_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_issue_comment_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_issue_events_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_is_template=xxx PL_GWT_PAYLOAD_pull_request_head_repo_keys_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_labels_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_languages_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_merges_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_milestones_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_name=xxx PL_GWT_PAYLOAD_pull_request_head_repo_node_id=xxx PL_GWT_PAYLOAD_pull_request_head_repo_notifications_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_open_issues=xxx PL_GWT_PAYLOAD_pull_request_head_repo_open_issues_count=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_avatar_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_events_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_followers_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_following_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_gists_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_html_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_id=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_login=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_node_id=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_organizations_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_received_events_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_repos_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_site_admin=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_starred_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_subscriptions_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_type=xxx PL_GWT_PAYLOAD_pull_request_head_repo_owner_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_private=xxx PL_GWT_PAYLOAD_pull_request_head_repo_pulls_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_pushed_at=xxx PL_GWT_PAYLOAD_pull_request_head_repo_releases_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_size=xxx PL_GWT_PAYLOAD_pull_request_head_repo_ssh_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_stargazers_count=xxx PL_GWT_PAYLOAD_pull_request_head_repo_stargazers_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_statuses_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_subscribers_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_subscription_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_svn_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_tags_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_teams_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_trees_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_updated_at=xxx PL_GWT_PAYLOAD_pull_request_head_repo_url=xxx PL_GWT_PAYLOAD_pull_request_head_repo_visibility=xxx PL_GWT_PAYLOAD_pull_request_head_repo_watchers=xxx PL_GWT_PAYLOAD_pull_request_head_repo_watchers_count=xxx PL_GWT_PAYLOAD_pull_request_head_sha=xxx PL_GWT_PAYLOAD_pull_request_head_user_avatar_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_events_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_followers_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_following_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_gists_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_html_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_id=xxx PL_GWT_PAYLOAD_pull_request_head_user_login=xxx PL_GWT_PAYLOAD_pull_request_head_user_node_id=xxx PL_GWT_PAYLOAD_pull_request_head_user_organizations_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_received_events_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_repos_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_site_admin=xxx PL_GWT_PAYLOAD_pull_request_head_user_starred_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_subscriptions_url=xxx PL_GWT_PAYLOAD_pull_request_head_user_type=xxx PL_GWT_PAYLOAD_pull_request_head_user_url=xxx PL_GWT_PAYLOAD_pull_request_html_url=xxx PL_GWT_PAYLOAD_pull_request_id=xxx PL_GWT_PAYLOAD_pull_request_issue_url=xxx PL_GWT_PAYLOAD_pull_request_locked=xxx PL_GWT_PAYLOAD_pull_request_maintainer_can_modify=xxx PL_GWT_PAYLOAD_pull_request_mergeable_state=xxx PL_GWT_PAYLOAD_pull_request_merged=xxx PL_GWT_PAYLOAD_pull_request_merge_commit_sha=xxx PL_GWT_PAYLOAD_pull_request_node_id=xxx PL_GWT_PAYLOAD_pull_request_number=xxx PL_GWT_PAYLOAD_pull_request_patch_url=xxx PL_GWT_PAYLOAD_pull_request_review_comments=xxx PL_GWT_PAYLOAD_pull_request_review_comments_url=xxx PL_GWT_PAYLOAD_pull_request_review_comment_url=xxx PL_GWT_PAYLOAD_pull_request_state=xxx PL_GWT_PAYLOAD_pull_request_statuses_url=xxx PL_GWT_PAYLOAD_pull_request_title=xxx PL_GWT_PAYLOAD_pull_request_updated_at=xxx PL_GWT_PAYLOAD_pull_request_url=xxx PL_GWT_PAYLOAD_pull_request_user_avatar_url=xxx PL_GWT_PAYLOAD_pull_request_user_events_url=xxx PL_GWT_PAYLOAD_pull_request_user_followers_url=xxx PL_GWT_PAYLOAD_pull_request_user_following_url=xxx PL_GWT_PAYLOAD_pull_request_user_gists_url=xxx PL_GWT_PAYLOAD_pull_request_user_html_url=xxx PL_GWT_PAYLOAD_pull_request_user_id=xxx PL_GWT_PAYLOAD_pull_request_user_ldap_dn=xxx PL_GWT_PAYLOAD_pull_request_user_login=xxx PL_GWT_PAYLOAD_pull_request_user_node_id=xxx PL_GWT_PAYLOAD_pull_request_user_organizations_url=xxx PL_GWT_PAYLOAD_pull_request_user_received_events_url=xxx PL_GWT_PAYLOAD_pull_request_user_repos_url=xxx PL_GWT_PAYLOAD_pull_request_user_site_admin=xxx PL_GWT_PAYLOAD_pull_request_user_starred_url=xxx PL_GWT_PAYLOAD_pull_request_user_subscriptions_url=xxx PL_GWT_PAYLOAD_pull_request_user_type=xxx PL_GWT_PAYLOAD_pull_request_user_url=xxx PL_GWT_PAYLOAD_pull_requestlinks_comments_href=xxx PL_GWT_PAYLOAD_pull_requestlinks_commits_href=xxx PL_GWT_PAYLOAD_pull_requestlinks_html_href=xxx PL_GWT_PAYLOAD_pull_requestlinks_issue_href=xxx PL_GWT_PAYLOAD_pull_requestlinks_review_comments_href=xxx PL_GWT_PAYLOAD_pull_request__links_review_comment_href=xxx PL_GWT_PAYLOAD_pull_requestlinks_self_href=xxx PL_GWT_PAYLOAD_pull_request__links_statuses_href=xxx PL_GWT_PAYLOAD_repository_allow_forking=xxx PL_GWT_PAYLOAD_repository_archived=xxx PL_GWT_PAYLOAD_repository_archive_url=xxx PL_GWT_PAYLOAD_repository_assignees_url=xxx PL_GWT_PAYLOAD_repository_blobs_url=xxx PL_GWT_PAYLOAD_repository_branches_url=xxx PL_GWT_PAYLOAD_repository_clone_url=xxx PL_GWT_PAYLOAD_repository_collaborators_url=xxx PL_GWT_PAYLOAD_repository_comments_url=xxx PL_GWT_PAYLOAD_repository_commits_url=xxx PL_GWT_PAYLOAD_repository_compare_url=xxx PL_GWT_PAYLOAD_repository_contents_url=xxx PL_GWT_PAYLOAD_repository_contributors_url=xxx PL_GWT_PAYLOAD_repository_created_at=xxx PL_GWT_PAYLOAD_repository_default_branch=xxx PL_GWT_PAYLOAD_repository_deployments_url=xxx PL_GWT_PAYLOAD_repository_disabled=xxx PL_GWT_PAYLOAD_repository_downloads_url=xxx PL_GWT_PAYLOAD_repository_events_url=xxx PL_GWT_PAYLOAD_repository_fork=xxx PL_GWT_PAYLOAD_repository_forks=xxx PL_GWT_PAYLOAD_repository_forks_count=xxx PL_GWT_PAYLOAD_repository_forks_url=xxx PL_GWT_PAYLOAD_repository_full_name=xxx PL_GWT_PAYLOAD_repository_git_commits_url=xxx PL_GWT_PAYLOAD_repository_git_refs_url=xxx PL_GWT_PAYLOAD_repository_git_tags_url=xxx PL_GWT_PAYLOAD_repository_git_url=xxx PL_GWT_PAYLOAD_repository_has_downloads=xxx PL_GWT_PAYLOAD_repository_has_issues=xxx PL_GWT_PAYLOAD_repository_has_pages=xxx PL_GWT_PAYLOAD_repository_has_projects=xxx PL_GWT_PAYLOAD_repository_has_wiki=xxx PL_GWT_PAYLOAD_repository_hooks_url=xxx PL_GWT_PAYLOAD_repository_html_url=xxx PL_GWT_PAYLOAD_repository_id=xxx PL_GWT_PAYLOAD_repository_issues_url=xxx PL_GWT_PAYLOAD_repository_issue_comment_url=xxx PL_GWT_PAYLOAD_repository_issue_events_url=xxx PL_GWT_PAYLOAD_repository_is_template=xxx PL_GWT_PAYLOAD_repository_keys_url=xxx PL_GWT_PAYLOAD_repository_labels_url=xxx PL_GWT_PAYLOAD_repository_languages_url=xxx PL_GWT_PAYLOAD_repository_merges_url=xxx PL_GWT_PAYLOAD_repository_milestones_url=xxx PL_GWT_PAYLOAD_repository_name=xxx PL_GWT_PAYLOAD_repository_node_id=xxx PL_GWT_PAYLOAD_repository_notifications_url=xxx PL_GWT_PAYLOAD_repository_open_issues=xxx PL_GWT_PAYLOAD_repository_open_issues_count=xxx PL_GWT_PAYLOAD_repository_owner_avatar_url=xxx PL_GWT_PAYLOAD_repository_owner_events_url=xxx PL_GWT_PAYLOAD_repository_owner_followers_url=xxx PL_GWT_PAYLOAD_repository_owner_following_url=xxx PL_GWT_PAYLOAD_repository_owner_gists_url=xxx PL_GWT_PAYLOAD_repository_owner_html_url=xxx PL_GWT_PAYLOAD_repository_owner_id=xxx PL_GWT_PAYLOAD_repository_owner_login=xxx PL_GWT_PAYLOAD_repository_owner_node_id=xxx PL_GWT_PAYLOAD_repository_owner_organizations_url=xxx PL_GWT_PAYLOAD_repository_owner_received_events_url=xxx PL_GWT_PAYLOAD_repository_owner_repos_url=xxx PL_GWT_PAYLOAD_repository_owner_site_admin=xxx PL_GWT_PAYLOAD_repository_owner_starred_url=xxx PL_GWT_PAYLOAD_repository_owner_subscriptions_url=xxx PL_GWT_PAYLOAD_repository_owner_type=xxx PL_GWT_PAYLOAD_repository_owner_url=xxx PL_GWT_PAYLOAD_repository_private=xxx PL_GWT_PAYLOAD_repository_pulls_url=xxx PL_GWT_PAYLOAD_repository_pushed_at=xxx PL_GWT_PAYLOAD_repository_releases_url=xxx PL_GWT_PAYLOAD_repository_size=xxx PL_GWT_PAYLOAD_repository_ssh_url=xxx PL_GWT_PAYLOAD_repository_stargazers_count=xxx PL_GWT_PAYLOAD_repository_stargazers_url=xxx PL_GWT_PAYLOAD_repository_statuses_url=xxx PL_GWT_PAYLOAD_repository_subscribers_url=xxx PL_GWT_PAYLOAD_repository_subscription_url=xxx PL_GWT_PAYLOAD_repository_svn_url=xxx PL_GWT_PAYLOAD_repository_tags_url=xxx PL_GWT_PAYLOAD_repository_teams_url=xxx PL_GWT_PAYLOAD_repository_trees_url=xxx PL_GWT_PAYLOAD_repository_updated_at=xxx PL_GWT_PAYLOAD_repository_url=xxx PL_GWT_PAYLOAD_repository_visibility=xxx PL_GWT_PAYLOAD_repository_watchers=xxx PL_GWT_PAYLOAD_repository_watchers_count=xxx PL_GWT_PAYLOAD_sender_avatar_url=xxx PL_GWT_PAYLOAD_sender_events_url=xxx PL_GWT_PAYLOAD_sender_followers_url=xxx PL_GWT_PAYLOAD_sender_following_url=xxx PL_GWT_PAYLOAD_sender_gists_url=xxx PL_GWT_PAYLOAD_sender_html_url=xxx PL_GWT_PAYLOAD_sender_id=xxx PL_GWT_PAYLOAD_sender_ldap_dn=xxx PL_GWT_PAYLOAD_sender_login=xxx PL_GWT_PAYLOAD_sender_node_id=xxx PL_GWT_PAYLOAD_sender_organizations_url=xxx PL_GWT_PAYLOAD_sender_received_events_url=xxx PL_GWT_PAYLOAD_sender_repos_url=xxx PL_GWT_PAYLOAD_sender_site_admin=xxx PL_GWT_PAYLOAD_sender_starred_url=xxx PL_GWT_PAYLOAD_sender_subscriptions_url=xxx PL_GWT_PAYLOAD_sender_type=xxx PL_GWT_PAYLOAD_sender_url=xxx PL_GWT_PR_ID=xxx

tomasbjerre commented 1 year ago

There is a configuration called printContributedVariables that can ne set to false to avoid printing that.

Also resolving everything is slow compared to just resolving the values you need. Use a more specific jsonpath.

Pymann commented 1 year ago

But then I would need 10Variables and more... But I will check that. And I still wonder why its necessary, that you put complete json to env, seperated with underscore? I didnt ask for that =)

Pymann commented 1 year ago

Whatever, the filled env caused the increase build time.

I recommend: if you put jpath "$" to variable, you will save whole payload to to the variable. But plugin puts additionally all json-keys seperated with underscore per hierarchy to env. Nobody asked for that. I recommend to remove this behaviour. I dont think anybody could need.

tomasbjerre commented 1 year ago

Here is where this was added: https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/7

But I agree that the $ variable perhaps should be treated as a special case and not contribute all leafs.

It has been like this for a long time now and with around 30k installations such a change may cause problems for users.

Pymann commented 1 year ago

This is easy to answer: Put an option per variable to switch it on and off ;-)

tomasbjerre commented 1 year ago

I'd like avoid adding options unless it is really necessary.

I a user specifies a JSONPath it will be one of these cases:

If a user specifies a leaf, only that leaf will be contributed.

If a user specifies a branch, all leafs within that branch will be contributed. I don't see why anyone would specify a branch and not want all leafs. I don't see how an option would help here.

If the user specifies the $ sign I think the user will only want the JSON and do whatever with that. So I changed this part so that it no longer contributes all leafs.

gongsu832 commented 1 year ago

$ variable not contributing all leafs breaks our Jenkins job as we do rely on it. And we didn't observe any increased time because of the $ variable. Can we please bring this back? Maybe with a different variable like $$?

Pymann commented 1 year ago

Why dont you crawl the payload yourself and set the environment vars? Should be easy-function. Or you declare variables with defined jpathes, of those you need.

gongsu832 commented 1 year ago

We could but if it's already flattened why repeat the work? At best it seemed a bit imprudent to suddenly retract a function simply because it appeared to cause problem in one use case.

Our Jenkins job is mostly driven by home grown scripts and as we add more features to the job we often need to look for the leafs we need. So it's more convenient for us to have all the leafs already available and just pick the right ones we need and use them in our scripts instead of keeping adding more variables in the web UI.

tomasbjerre commented 1 year ago

I do think this change is a bit controversial. If it is a problem for many users, perhaps it is best to change back.

I do think you can still do what you want. If you set the variable to payload and have it resolve $. You can have pipeline code like:

def jsonObj = readJSON text: payload

And you can get whatever values you want from jsonObj.

The variable names will be different so you will need to adjust you pipeline code to them.

gongsu832 commented 1 year ago

@tomasbjerre Thanks for the suggestion and yes that's probably what we will have to do eventually if this function is never brought back. But that means we have to write code that we didn't have to write before and all our scripts using the flattened leafs will have to change and we have to retest all the scripts. It's too much of a disruption for us. So our current plan is to stick to 1.84 for as long as we can.

tomasbjerre commented 1 year ago

I'm reverting this change and adding an option:

image

Released that now.

gongsu832 commented 1 year ago

@tomasbjerre Thank you for the support! Very much appreciated.