Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-26164

When syncing Github repositories, if the repository is archived and webhook cannot be added it would be helpful to differentiate this from 'Failed'

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • DVCS Connector
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      When syncing Github repositories, if the repository is archived and webhook cannot be added it would be helpful to differentiate this from 'Failed'. If a repository is archived it is read only in Github so it will not be able to have the webhook added. This is expected behavior but currently Jira flags this as just the generic 'Failed' which is misleading.

      In the logs we are able to see the follow exception thrown for these repositories:

      2024-11-20 17:19:57,707-0500 Caesium-1-2 WARN ServiceRunner     [c.a.j.p.dvcs.service.HookServiceImpl] Failed to refresh webhooks for repository id 12 (<Github Repo URL>) - java.lang.RuntimeException: org.eclipse.egit.github.core.client.RequestException: Repository was archived so is read-only. (403)
      2024-11-20 17:19:57,710-0500 Caesium-1-2 ERROR ServiceRunner     [c.a.j.p.d.s.hooks.migration.HookMigrationJobRunner] Failed to set secret to webhook for repository <Github Repo> with ID [12]
      java.lang.RuntimeException: java.lang.RuntimeException: org.eclipse.egit.github.core.client.RequestException: Repository was archived so is read-only. (403)
      	at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.refreshWebhooks(GithubCommunicator.java:454)
      	at com.atlassian.jira.plugins.dvcs.service.remote.CachingCommunicator.refreshWebhooks(CachingCommunicator.java:119)
      	at com.atlassian.jira.plugins.dvcs.service.remote.DvcsCommunicatorWithStatsImpl.refreshWebhooks(DvcsCommunicatorWithStatsImpl.java:56)
      	at com.atlassian.jira.plugins.dvcs.service.HookServiceImpl.refreshWebhooks(HookServiceImpl.java:47)
      	at com.atlassian.jira.plugins.dvcs.scheduler.hooks.migration.HookMigrationJobRunner.runJob(HookMigrationJobRunner.java:173)
      	at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService$JobRunnerWithStats.runJob(CaesiumSchedulerService.java:724)
      	at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:134)
      	at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:106)
      	at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:90)
      	at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:526)
      	at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJob(CaesiumSchedulerService.java:520)
      	at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeClusteredJobWithRecoveryGuard(CaesiumSchedulerService.java:547)
      	at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:423)
      	at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:66)
      	at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:60)
      	at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:35)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: java.lang.RuntimeException: org.eclipse.egit.github.core.client.RequestException: Repository was archived so is read-only. (403)
      	at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.createInternal(GithubCommunicator.java:499)
      	at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.createChangesetHook(GithubCommunicator.java:472)
      	at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.refreshWebhooks(GithubCommunicator.java:441)
      	... 16 more
      Caused by: org.eclipse.egit.github.core.client.RequestException: Repository was archived so is read-only. (403)
      	at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:622)
      	at org.eclipse.egit.github.core.client.GitHubClient.sendJson(GitHubClient.java:713)
      	at org.eclipse.egit.github.core.client.GitHubClient.post(GitHubClient.java:832)
      	at com.atlassian.jira.plugins.dvcs.spi.github.GithubClientWithTimeout.lambda$post$1(GithubClientWithTimeout.java:82)
      	at com.atlassian.jira.plugins.dvcs.spi.github.GithubClientWithTimeout.executeRequest(GithubClientWithTimeout.java:128)
      	at com.atlassian.jira.plugins.dvcs.spi.github.GithubClientWithTimeout.post(GithubClientWithTimeout.java:82)
      	at org.eclipse.egit.github.core.service.RepositoryService.createHook(RepositoryService.java:944)
      	at com.atlassian.jira.plugins.dvcs.spi.github.GithubCommunicator.createInternal(GithubCommunicator.java:497)
      	... 18 more
      

      It would be helpful if in situations like this the DVCS plugin could differentiate this type of situation (which is expected) from a generic failure so as not to show the misleading error message.

            [JSWSERVER-26164] When syncing Github repositories, if the repository is archived and webhook cannot be added it would be helpful to differentiate this from 'Failed'

            There are no comments yet on this issue.

              Unassigned Unassigned
              d382421eef02 Andy Rusnak
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: