For get and filter queries of NamedUserGroup, realm_for_sharding
field is used instead of realm field, as directly using
realm_for_sharding field on NamedUserGroup makes the query faster
than using realm present on the base UserGroup table.
Adds general help description text for the tool that generates
cropped message screenshots for corporate pages.
Notes some of the known issues when updating these screenshots
after there have been UI changes, such as partial dates showing
and truncated channel/topic names in screenshots.
Fixes the screenshots on the for/education page to have the
canonical last name for the example user Elena Garcia.
Updates year in dates for screenshot content to align with when
the screenshots were taken.
Adjusts the width of the viewport for changes in the message
header bar in the web app. Also closes any alert banner at the
top of the app before navigating to the narrow so that doesn't
impact the cropped screenshot area that's computed later.
Finally, sets hover on the new conversation button so that none
of the message action buttons are visible in the message feed
when the screenshot is taken.
Previously, only one bot can be created using the
generate-integration-docs-screenshot script for each integration. This
was because the bot's email was constructed using the integration's
name.
Thus, the bot-name commandline option would not work if a bot already
exists for the integration.
Now, we create the email by cleaning the bot-name value, if passed.
Previously, the integration's name was directly being used.
Due to this, the GitHub Sponsors integration which is in the same module
as the GitHub integration could not be used with the
`generate-integration-docs-screenshot` script, as it would be unable to
locate the fixtures.
Add a `fixtureless_group` of arguments to allow passing in the message,
topic and channel via the commandline.
By default, the script uses the screenshot config from
`integrations.py`.
Example screenshots can now be generated for fixtureless integrations,
by sending mock messages using the topic and message text included in
the screenshot config added in the previous commit.
This is in preparation of adding support for generating screenshots of
fixtureless integrations, which would need to get image_path, without
involving fixture_path.
This is in preparation to differentiate the current config dataclass
(used for webhooks) from the FixturelessScreenshotConfig that will be
added for non-webhook integrations in the following commits.
- Removed the BaseScreenshotConfig dataclass, and merge it with
ScreenshotConfig dataclass.
- Simplified get_fixture_and_image_paths.
- Simplified generate_screenshot_from_config in the screenshot script.
- Deleted send_bot_mock_message.
- Simplified the loading of commandline options into the config dict.
- Split the logic into two new functions. This is in preparation to
later commits that will parse commandline options for non-webhook
integrations by re-using the created functions.
Group argparse arguments into common and webhook-specific options.
The common group contains arguments that apply to both webhook and
non-webhook integrations. It is not assigned a description.
A fixtureless, non-webhook group will be added later, when its arguments
are created.
to `fixture-name` to match the name of the corresponding field in the
ScreenshotConfig dataclass.
This is in preparation to loading all the options into a config dict
in a single step in a later commit.
Rename `group` to `batch_group`.
It's a mutually exclusive group that lets the user decide whether to
generate screenshots one at a time or in a batch.
This is valuable so that one is forced to explicitly make a decision
on what is correct when adding new callers. Past experience tells us that
not having to explicitly show the decision leads to people introducing
security bugs in PRs that the maintainer has to catch in review, and our
goal for access control code should be that security bugs are hard to write.
Fixes#33688.
Add a common function for webhooks to convert multipart strings to dict.
This facilitates loading a multipart/form-data fixture as a file string,
and converting it.
This will allow testing integrations that use multipart/form-data,
and generating their example screenshots using a script.
Note that this only supports text fields, accommodation for binary files
is not included at the moment.
This commit updates screenshots for the "for/business" and
"for/open-source" pages, and adds the script for generating
their screenshots at "screenshots/companies.json."
Fixes part of #30128
This commit extends the script used to generate thread
screenshots to be able to create invite_only streams,
add starred messages, create user groups, add edited
notice to messages, and send messages from notification
bots.
The window width is updated, and background for the
screenshots is changed to white.
It is also updated so that user-avatars mapping
occurs within the script itself.
This is a prep commit to #30128
This commit utilizes the script added for auto-generating
screenshots of message threads to generate screenshots
for the "/for/recovery" page.
This commit adds the message data for generating the
screenshots.
Previously, we manually generated screenshots on /for/research
and other landing pages, which makes them difficult to maintain.
This PR adds a script - generate-user-messages-screenshot, which
expects the path of the filename containing the thread conversation
and path where screenshot needs to be generated, and generates
screenshot at the mentioned location.
Fixes#30016
This commit relocates all the scripts in the tools directory which
are used for auto-generating screenshots to the new
tools/screenshots directory to avoid cluttering the tools/ root.