Skip to content

[TASK] Add GIT URI to Slack webhook - #313

Merged
andreaskienast merged 2 commits into
TYPO3GmbH:developfrom
garvinhicking:patch-1
Aug 25, 2026
Merged

[TASK] Add GIT URI to Slack webhook#313
andreaskienast merged 2 commits into
TYPO3GmbH:developfrom
garvinhicking:patch-1

Conversation

@garvinhicking

Copy link
Copy Markdown
Contributor

Currently only a composer key is emitted in the slack hook. However, a URI to the actua GIT repository would be helpful, because:

1.) A composer package may not have been released (yet) of an extension 2.) A TER package may not have been released (yet) of an extension 3.) The composer key and the Github Repo vendor/name may differ

This commit is unverified. I am crossing my fingers that $jar->getRepositoryUrl() really holds what I expect it to. :-D

Currently only a composer key is emitted in the slack hook. However, a URI to the actua GIT repository would be helpful, because:

1.) A composer package may not have been released (yet) of an extension
2.) A TER package may not have been released (yet) of an extension
3.) The composer key and the Github Repo vendor/name may differ

This commit is unverified. I am crossing my fingers that `$jar->getRepositoryUrl()` really holds what I expect it to. :-D
@CybotTM

CybotTM commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

The failing test is a fixture gap, not your change. SlackServiceTest builds a DocumentationJar without a repository URL, and $repositoryUrl is a non-nullable typed property, so the first read throws. One line in tests/Functional/Service/SlackServiceTest.php fixes it:

         $jar->setPackageName('acme/my-extension');
+        $jar->setRepositoryUrl('https://github.com/acme/my-extension.git');
         $jar->setTypeShort('p');

Plus an assertion, so the new link is covered:

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

Assisted by claude-code:claude-opus-5 — Session

@garvinhicking

Copy link
Copy Markdown
Contributor Author

@CybotTM Thanks a lot! I implemented your suggestion, sounds sane to me.

@andreaskienast Can you rerun the test?

@andreaskienast
andreaskienast merged commit 1910d72 into TYPO3GmbH:develop Aug 25, 2026
3 checks passed
andreaskienast pushed a commit that referenced this pull request Aug 25, 2026
The repository discovery message prints its footer link verbatim in
Slack: `TYPO3 Intercept ·
<{https://github.com/TYPO3GmbH/site-intercept/blob/develop/src/Service/SlackService.php}|(?)>`.

Cause:
[f055d02](f055d02)
moved the URL into `self::SOURCE_URL` and rewrote the footer as a
`sprintf()` format. The braces are PHP interpolation syntax: they
disappear in the previous `"TYPO3 Intercept · <{$sourceUrl}|(?)>"`, but
stay literal in a format string, and Slack parses `<url|label>` only
with a bare URL. The footer link rendered fine before that commit.

Fix: drop the braces from the format string. `(?)` is a link again.

Tests: the two existing footer assertions match substrings
(`github.com/TYPO3GmbH/site-intercept`, `SlackService.php`) and pass on
the broken markup, which is why this went unnoticed. The test now also
requires every `<url|label>` target in `text` and in `footer` to be a
bare absolute URL. Verified by reverting the fix — the new assertion
fails on `{https://…}` and passes with it.

Note on local verification: the functional suite boots the test kernel,
which needs the private `t3g/lib-test-helper`, so I ran the assertions
locally against a directly instantiated `SlackService` with test
doubles. CI runs the committed test.

Unrelated to #313, which adds a repository link to the message text —
that PR fails on a separate fixture gap
(`DocumentationJar::$repositoryUrl` is never set in the test).

_Assisted by claude-code:claude-opus-5 —
[Session](https://claude.ai/code/session_014H1xwaAmrQRWUA3vx8bJcD)_

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
andreaskienast pushed a commit that referenced this pull request Aug 25, 2026
Currently only a composer key is emitted in the slack hook. However, a
URI to the actua GIT repository would be helpful, because:

1.) A composer package may not have been released (yet) of an extension
2.) A TER package may not have been released (yet) of an extension 3.)
The composer key and the Github Repo vendor/name may differ

This commit is unverified. I am crossing my fingers that
`$jar->getRepositoryUrl()` really holds what I expect it to. :-D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants