Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.2', '8.3', '8.4']

name: php-lint

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

strategy:
matrix:
php-versions: ['8.1']
php-versions: ['8.2']
server-versions: ['master']

services:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

strategy:
matrix:
php-versions: ['8.1']
php-versions: ['8.2']
server-versions: ['master']

services:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:

strategy:
matrix:
php-versions: ['8.1']
server-versions: ['master', 'stable30']
php-versions: ['8.2']
server-versions: ['master', 'stable32']

steps:
- name: Set app env
Expand Down Expand Up @@ -89,6 +89,7 @@ jobs:
mkdir data
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
./occ app:enable --force ${{ env.APP_NAME }}
./occ app:disable files_external

- name: Check PHPUnit script is defined
id: check_phpunit
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
ocp-version: ['^29', '^30', '^31', 'dev-master']
php-version: ['8.1', '8.2', '8.3']
ocp-version: ['^32', 'dev-master']
php-version: ['8.2', '8.3', '8.4']


name: Psalm check on PHP ${{ matrix.php-version }} and OCP ${{ matrix.ocp-version }}
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<bugs>https://github.com/nextcloud/integration_github/issues</bugs>
<screenshot>https://github.com/nextcloud/integration_github/raw/main/img/screenshot1.jpg</screenshot>
<dependencies>
<nextcloud min-version="29" max-version="32"/>
<nextcloud min-version="32" max-version="33"/>
</dependencies>
<background-jobs>
<job>OCA\Github\BackgroundJob\CheckGithubNotificationsJob</job>
Expand Down
75 changes: 41 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,17 @@ public function oauthRedirect(string $code, string $state): RedirectResponse {
$this->config->deleteUserValue($this->userId, Application::APP_ID, 'oauth_origin');
if ($oauthOrigin === 'settings') {
return new RedirectResponse(
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts']) .
'?githubToken=success'
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts'])
. '?githubToken=success'
);
} elseif ($oauthOrigin === 'dashboard') {
return new RedirectResponse(
$this->urlGenerator->linkToRoute('dashboard.dashboard.index')
);
}
return new RedirectResponse(
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts']) .
'?githubToken=success'
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts'])
. '?githubToken=success'
);
}
}
Expand All @@ -217,8 +217,8 @@ public function oauthRedirect(string $code, string $state): RedirectResponse {
$result = $this->l->t('Error during OAuth exchanges');
}
return new RedirectResponse(
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts']) .
'?githubToken=error&message=' . urlencode($result)
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts'])
. '?githubToken=error&message=' . urlencode($result)
);
}

Expand Down
7 changes: 6 additions & 1 deletion lib/Search/GithubSearchIssuesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\Search\IExternalProvider;
use OCP\Search\IProvider;
use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
use OCP\Search\SearchResultEntry;

class GithubSearchIssuesProvider implements IProvider {
class GithubSearchIssuesProvider implements IProvider, IExternalProvider {

public function __construct(
private IAppManager $appManager,
Expand Down Expand Up @@ -157,4 +158,8 @@ protected function getThumbnailUrl(array $entry): string {
$userName = $entry['project_owner_login'] ?? '';
return $this->urlGenerator->linkToRoute('integration_github.githubAPI.getAvatar', ['githubLogin' => $userName]);
}

public function isExternalProvider(): bool {
return true;
}
}
7 changes: 6 additions & 1 deletion lib/Search/GithubSearchReposProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\Search\IExternalProvider;
use OCP\Search\IProvider;
use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
use OCP\Search\SearchResultEntry;

class GithubSearchReposProvider implements IProvider {
class GithubSearchReposProvider implements IProvider, IExternalProvider {

public function __construct(
private IAppManager $appManager,
Expand Down Expand Up @@ -142,4 +143,8 @@ protected function getThumbnailUrl(array $entry): string {
$userName = $entry['owner']['login'] ?? '';
return $this->urlGenerator->linkToRoute('integration_github.githubAPI.getAvatar', ['githubLogin' => $userName]);
}

public function isExternalProvider(): bool {
return true;
}
}
8 changes: 6 additions & 2 deletions lib/Service/GithubAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,16 @@ private function getItemLink(array $notification): string {
$url = $notification['subject']['url'] ?? '';
$url = str_replace('api.github.com', 'github.com', $url);
$url = str_replace('/repos/', '/', $url);
return preg_replace('/\/[0-9]+/', '', $url);
/** @var string $result */
$result = preg_replace('/\/[0-9]+/', '', $url);
return $result;
} elseif ($subjectType !== 'Discussion') {
$url = $notification['subject']['url'] ?? '';
$url = str_replace('api.github.com', 'github.com', $url);
$url = str_replace('/repos/', '/', $url);
return str_replace('/pulls/', '/pull/', $url);
/** @var string $result */
$result = str_replace('/pulls/', '/pull/', $url);
return $result;
}
// this is a discussion
$repoFullName = $notification['repository']['full_name'] ?? '';
Expand Down
Loading
Loading