-
Improvement
-
Resolution: Fixed
-
Minor
The current API in scm-api allows to re-index a branch source using the method SCMSourceOwner.onSCMSourceUpdated().
Currently we are using this method to force a reindexing when a webhook event is received:
for (final SCMSourceOwner owner : SCMSourceOwners.all()) { for (SCMSource source : owner.getSCMSources()) { if (source instanceof GitHubSCMSource) { GitHubSCMSource gitHubSCMSource = (GitHubSCMSource) source; if (gitHubSCMSource.getRepoOwner().equals(changedRepository.getUserName()) && gitHubSCMSource.getRepository().equals(changedRepository.getRepositoryName())) { owner.onSCMSourceUpdated(gitHubSCMSource); } } } }
We need to improve this because when Jenkins receives an event from a webhook we want to be able to determinate:
- if we have to re-index my GitHub Organization
- if we have to re-index all my branches and pull requests in a GitHub repository
- Or simplify if we have to schedule a build because there is a new commit in a pull requests
- is related to
-
JENKINS-34727 WebHook events are not always successfully triggering Jenkins pipeline
-
- Resolved
-
-
JENKINS-36121 Github Branch Source plugin trips api rate limit
-
- Closed
-
[JENKINS-34600] Improve the performance of scheduling a build
Description |
Original:
The current API in {{scm-api}} allows to re-index a branch source using the method {{SCMSourceOwner.onSCMSourceUpdated()}}}. Currently we are using this method to force a reindexing when a webhook event is received: {code:java} for (final SCMSourceOwner owner : SCMSourceOwners.all()) { for (SCMSource source : owner.getSCMSources()) { if (source instanceof GitHubSCMSource) { GitHubSCMSource gitHubSCMSource = (GitHubSCMSource) source; if (gitHubSCMSource.getRepoOwner().equals(changedRepository.getUserName()) && gitHubSCMSource.getRepository().equals(changedRepository.getRepositoryName())) { owner.onSCMSourceUpdated(gitHubSCMSource); } } } } {code} |
New:
The current API in {{scm-api}} allows to re-index a branch source using the method {{SCMSourceOwner.onSCMSourceUpdated()}}. Currently we are using this method to force a reindexing when a webhook event is received: {code:java} for (final SCMSourceOwner owner : SCMSourceOwners.all()) { for (SCMSource source : owner.getSCMSources()) { if (source instanceof GitHubSCMSource) { GitHubSCMSource gitHubSCMSource = (GitHubSCMSource) source; if (gitHubSCMSource.getRepoOwner().equals(changedRepository.getUserName()) && gitHubSCMSource.getRepository().equals(changedRepository.getRepositoryName())) { owner.onSCMSourceUpdated(gitHubSCMSource); } } } } {code} |
Summary | Original: Improve the performance of schedule a build | New: Improve the performance of scheduling a build |
Description |
Original:
The current API in {{scm-api}} allows to re-index a branch source using the method {{SCMSourceOwner.onSCMSourceUpdated()}}. Currently we are using this method to force a reindexing when a webhook event is received: {code:java} for (final SCMSourceOwner owner : SCMSourceOwners.all()) { for (SCMSource source : owner.getSCMSources()) { if (source instanceof GitHubSCMSource) { GitHubSCMSource gitHubSCMSource = (GitHubSCMSource) source; if (gitHubSCMSource.getRepoOwner().equals(changedRepository.getUserName()) && gitHubSCMSource.getRepository().equals(changedRepository.getRepositoryName())) { owner.onSCMSourceUpdated(gitHubSCMSource); } } } } {code} |
New:
The current API in {{scm-api}} allows to re-index a branch source using the method {{SCMSourceOwner.onSCMSourceUpdated()}}. Currently we are using this method to force a reindexing when a webhook event is received: {code:java} for (final SCMSourceOwner owner : SCMSourceOwners.all()) { for (SCMSource source : owner.getSCMSources()) { if (source instanceof GitHubSCMSource) { GitHubSCMSource gitHubSCMSource = (GitHubSCMSource) source; if (gitHubSCMSource.getRepoOwner().equals(changedRepository.getUserName()) && gitHubSCMSource.getRepository().equals(changedRepository.getRepositoryName())) { owner.onSCMSourceUpdated(gitHubSCMSource); } } } } {code} We need to improve this because when Jenkins receives an event from a webhook we want to be able to determinate: # if we have to re-index all my GitHub Organization # if we have to re-index all my branches and pull requests in a GitHub repository # Or simplify if we have to schedule a build because there is a new commit in a pull requests |
Description |
Original:
The current API in {{scm-api}} allows to re-index a branch source using the method {{SCMSourceOwner.onSCMSourceUpdated()}}. Currently we are using this method to force a reindexing when a webhook event is received: {code:java} for (final SCMSourceOwner owner : SCMSourceOwners.all()) { for (SCMSource source : owner.getSCMSources()) { if (source instanceof GitHubSCMSource) { GitHubSCMSource gitHubSCMSource = (GitHubSCMSource) source; if (gitHubSCMSource.getRepoOwner().equals(changedRepository.getUserName()) && gitHubSCMSource.getRepository().equals(changedRepository.getRepositoryName())) { owner.onSCMSourceUpdated(gitHubSCMSource); } } } } {code} We need to improve this because when Jenkins receives an event from a webhook we want to be able to determinate: # if we have to re-index all my GitHub Organization # if we have to re-index all my branches and pull requests in a GitHub repository # Or simplify if we have to schedule a build because there is a new commit in a pull requests |
New:
The current API in {{scm-api}} allows to re-index a branch source using the method {{SCMSourceOwner.onSCMSourceUpdated()}}. Currently we are using this method to force a reindexing when a webhook event is received: {code:java} for (final SCMSourceOwner owner : SCMSourceOwners.all()) { for (SCMSource source : owner.getSCMSources()) { if (source instanceof GitHubSCMSource) { GitHubSCMSource gitHubSCMSource = (GitHubSCMSource) source; if (gitHubSCMSource.getRepoOwner().equals(changedRepository.getUserName()) && gitHubSCMSource.getRepository().equals(changedRepository.getRepositoryName())) { owner.onSCMSourceUpdated(gitHubSCMSource); } } } } {code} We need to improve this because when Jenkins receives an event from a webhook we want to be able to determinate: # if we have to re-index my GitHub Organization # if we have to re-index all my branches and pull requests in a GitHub repository # Or simplify if we have to schedule a build because there is a new commit in a pull requests |
Assignee | New: Manuel Recena Soto [ recena ] |
Labels | New: api performance |
Link |
New:
This issue is related to |
Workflow | Original: JNJira [ 170761 ] | New: JNJira + In-Review [ 184027 ] |
Link |
New:
This issue is related to |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Closed [ 6 ] |