The user associated to a pull request is always its creator, however,
when closing a pull request, this can be the wrong actor. The paylod
contains the actor in the `sender` value, use this instead.
This does not include any screenshot configs, just defining the format,
and loading FIXTURELESS_SCREENSHOT_CONFIG from the file.
Co-authored-by: Lauryn Menard <lauryn@zulip.com>
GitLab has both integrations and webhooks, and our documentation
should direct users to the webhooks set up for integrating with
Zulip.
Adds a link to GitLab's create a webhook documentation as well.
The payload might contain colons and commas within keys and
values entered by the user. Simply splitting the fields using
", " is therefore unreliable and can lead to incorrect parsing.
Hence, this commit updates the logic for splitting fields in
the pretty data of the Jotform payload.
Fixes#32461.
Adds a URL parameter to the webhook to track the region of the Opsgenie
instance (US/EU), and uses that to construct the alert URL in the
message.
Fixes#34947.
To use the appropriate context properties.
This commit does not touch the integration docs that do not use the
new integration doc format, as this update will be included in their
format update sweep.
The subdomain and host parts are already used within zulip_url, api_url,
this commit adds them as context properties themselves, so that they
can be used in email addresses and URLs without the URI scheme,
increasing uniformity.
The new context properties `display_host` and `display_subdomain` are
usable in the Help, API docs and Policies.
Occurrences of `*.zulipchat.com` have been updated to use them.
This commit updates the Slack incoming webhook endpoint to use the same
Slack reformatting functions (`convert_to_zulip_markdown` and
`replace_links`) that are used for Slack data import and cleaning up any
duplicative functions.
This was previously not possible because the Slack reformatting regex in
`slack_message_conversion.py` could not handle these cases:
- Formatting applied to non-ASCII characters (e.g., emoji).
- Formatted strings separated by exactly one character.
- Formatted strings appearing immediately after a new line.
Fixes part of #31162.
The Slack text regexes match specific characters before and after the
formatted string to ensure that they only match at word boundaries.
However, because the capture groups consume each matching character,
including the characters used to determine word boundaries, two
formatted strings separated by a single matching character result in one
string not being matched, as the trailing whitespace is already
consumed and cannot also match as the leading pre-match whitespace for
the next character.
Switch to a look-ahead regex for the trailing word boundary
characters. This is zero-width, and as such the next match can still
also consume the same characters.
This also fixes Slack webhook integrations'
`test_message_with_complex_formatted_mentions` which was previously
expecting false output.
Fixes part of #30827.
This prep commit modifies the Slack text regex in
`slack_message_conversion.py` to use the `re.MULTILINE` flag capture
formatted strings that are adjacent to newline or end of line.
These kinds of strings are likely not uncommon to be generated by Slack
exporter itself and our Slack message block and attachment formatters
(`render_blocks` and `render_attachments`) also produces them.
This also fixes Slack webhook integration's
`test_message_with_complex_formatted_texts` which was previously
expecting false output.
Fixes part of #30827.
The Jira plugin integration doc will be moved in the next commit, to
"static/generated/integrations/jira/doc.md", as the directory name of
the integration is "jira" in zulip/python-zulip-api.
- Jira integration doc (previously) - "zerver/webhooks/jira/doc.md"
- Jira plugin integration doc (next commit) -
"static/generated/integrations/jira/doc.md"
Both of these will use the same path "jira/doc.md" as their
integration.doc value, and the actual file is loaded based on the order
of template directories listed in computed_settings.py.
Hence, use a custom path for the Jira integration doc to avoid this
collision.
This commit renames "(no topic)" to "" when used as
topic name, while sending or scheduling messages.
This is particularly helpful for older clients where
sending messages with empty topic input box resulted
in messages being sent to "(no topic)" topic.
Now, it will be sent in empty string topic and will
appear in the "general chat" topic.
This helps older clients to somewhat align with the UX
of the clients supporting empty string topic.
- Made the branch-filtering checks uniform across all the integrations,
by adding a helper function to git.py, and re-using it.
- Instead of checking if the name of the branch that generated the
event is a substring of the "branches" parameter, we now check if
there's an exact match.
For example, if there are two branches named "main" and
"release/v1.0-main", and the user wants to track pushes to only the
"release/v1.0-main" branch, they wouldn't have been able to
previously, it will always track pushes to both branches. There was no
way to filter out the smaller named branch when there were overlaps.
Edited the git-append-branches.md macro to match the previous
git-branches-additional-feature.md macro, and moved it inside the
webhook-url-with-bot-email.md macro, as it's only ever used
immediately after that macro.
Updated the Git-related integrations that support branch filtering:
- Removed the branch-filtering configuration option, and its macro.
- Added a new macro that integrates the branch-filtering instruction
with the Generate-URL step.
The new macro `generate-webhook-url-with-branch-filtering` builds off of
the `generate-webhook-url-basic` macro, adding only the branch filtering
instruction. But, it does not re-use the macro, instead duplicates it,
to avoid the newline break that would be added otherwise.
This commit updates the GitHub webhook integration to include the
old issue number in the transfer message sent for the new repository,
alongside the old repository's full name.
On transferring an issue to another repository, GitHub sends
- a "transferred" event to the old repository's webhook URL,
- and an "opened event", containing links to the old issue,
to the new repository's webhook URL.
This commit adds support for both events independently.
Fixes: #33450.
The integrations - GoSquared, Greenhouse, OpsGenie and Zendesk - have
been using `000.png` as their example screenshots, renamed them to
match the default name `001.png`, to avoid passing them as arguments.
The context property was previously being used in the macro
`git-webhook-url-with-branches` which has been removed as it is not in
use any longer.
The context property was now being used only in 2 integration docs, both
of which used it only in a single location, and directly used their own
names as the channel name. Making the context property unnecessary.