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
3 changes: 2 additions & 1 deletion src/Service/SlackService.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function sendRepositoryDiscoveryMessage(DocumentationJar $jar): ResponseI
$docsLink = $this->docsService->generateLinkToDocs($jar);
$deploymentsUrl = $this->router->generate('admin_docs_deployments', [], RouterInterface::ABSOLUTE_URL);
$webhookDocsUrl = $this->docsService->getDocsServer() . '/permalink/h2document:webhook';
$gitUrl = $jar->getRepositoryUrl();

$message = [
'channel' => '#typo3-documentation',
Expand All @@ -59,7 +60,7 @@ public function sendRepositoryDiscoveryMessage(DocumentationJar $jar): ResponseI
. "\u{2022} A documentation maintainer will review and approve the repository\n"
. "\u{2022} Once approved, docs will be rendered and deployed to <{$docsLink}|docs.typo3.org>\n"
. "\u{2022} This is handled by volunteers \u{2014} please be patient\n\n"
. ":hammer_and_wrench: *Maintainers:* <{$deploymentsUrl}|Review pending deployments>\n"
. ":hammer_and_wrench: *Maintainers:* <{$deploymentsUrl}|Review pending deployments> | <{$gitUrl}|:git:>\n"
. ":information_source: *Extension authors:* <{$webhookDocsUrl}|How does this work?>",
'fallback' => "Repository {$repoKey} is awaiting documentation approval at {$deploymentsUrl}",
'footer' => sprintf("TYPO3 Intercept \u{00b7} <{%s}|(?)>", self::SOURCE_URL),
Expand Down
3 changes: 3 additions & 0 deletions tests/Functional/Service/SlackServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function testSendRepositoryDiscoveryMessageContainsExpectedPayload(): voi
$jar->setVendor('acme');
$jar->setName('my-extension');
$jar->setPackageName('acme/my-extension');
$jar->setRepositoryUrl('https://github.com/acme/my-extension.git');
$jar->setTypeShort('p');
$jar->setTargetBranchDirectory('main');

Expand Down Expand Up @@ -90,5 +91,7 @@ public function testSendRepositoryDiscoveryMessageContainsExpectedPayload(): voi

// Must opt into mrkdwn rendering for the text field
self::assertContains('text', $attachment['mrkdwn_in']);

self::assertStringContainsString('<https://github.com/acme/my-extension.git|:git:', $attachment['text']);
}
}