`DiscoverRunner.run_tests` has a return type of `int`. While
`Runner.run_tests` has a wildly different `Tuple[bool, List[str]]`.
This refactors it so that we have the correct return type, by passing
the additional information about failed tests through a side effect to directly
write the failed tests to a file.
Note that we have to make `failed_tests_path` optional as otherwise the method
signature will not be compatible with the supertype.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This reverts part of commit 1432067959
(#17047). The spooky warnings foretold by the comment don’t seem to
show up.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This fix excludes the bots and invitation settings tabs from having the
organization_settings_tip.hbs template being inserted in them.
Arguably we should invert the meaning of this block so the default is
that these notices don't appear, but it's hard to be sure whether we're more
likely to add a new setting panel that is normal settings or a data table.
Fixes: #19967.
Updates the instruction block to directly reference the section
header (Notifications triggers) for clarity and consistency with
other help center references to this user settings area.
`context` as `AccessDeniedError` is incompatible with
`RequestVariableMissingError`. Mypy does not allow such redefinition.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
It is really a generator of test cases from the test suite. Which should
be typed as an `Iterable` instead.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
`context_data` is only available on `SimpleTemplateResposne`, we can't
narrow `TestHttpResponse` to it because the latter is not in fact a
subtype of `HttpResponse`.
Differently, `redirect_chain` is an attribute that only appears on the
test response when the test client method is called with `follow=True`.
`TestHttpResponse` does not have that by defalut, either.
The occurence of these two cases are rare enough throughout the codebase
and we can't get around that without aggressively overloading the test client
or refactoring `_MonkeyPatchedWSGIResponse` in the upstream.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Mypy does not know the acccurate return type of `get_runner` that is
determined by the `TEST_RUNNER` setting. We need to cast it to the
correct type to use methods like `get_shallow_tested_templates`. Note
that we import conditionally to avoid adding runtime dependency on
`zerver`.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This eliminates the possibility of having `request.user` as
`RemoteZulipServer` by refactoring it as an attribute of `RequestNotes`.
So we can effectively narrow the type of `request.user` by testing
`user.is_authenticated` in most cases (except that of `SCIMClient`) in
code paths that require access to `.format_requestor_for_logs` where we
previously expect either `UserProfile` or `RemoteZulipServer` backed by
the implied polymorphism.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
In b46af40bd3,
we set this attribute because back then we might call `rate_limit_user`
on `RemoteZulipServer`.
This is no longer the case as `RemoteZulipServer` now has its own rate
limiting and we never call `rate_limit_user` without an `isinstance` check
for `UserProfile`.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This verifies that `request_for_logs` is correctly set for requests
with different types of authentication.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
`BaseNotes(str, str).get_notes` does not do anything here.
It was introduced in
53888e5a26
by unintendedly.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
We can express the same idea more simply by not passing `user` in
cases where it isn't valid for UserActivity.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Fixes some in-app and documentation references to to new user
announcements and new stream announcements that were still using
'notifications' to refer them. These were missed in the original
pass for updating this language.
A user ran into an issue while upgrading where
ContentType.objects.get(model="realmreactivationstatus",
app_label="zerver") fails due to the object being missing. The reason
for that is to be yet figured out, but the immediate solution is clear
in the sense that the migration can just quit early
if not Confirmation.objects.filter(type=REALM_REACTIVATION).exists() and
that'll effectively skip it for almost all servers (because realm
reactivations links are something that's really only useful on Zulip
Cloud).
Change submit button text of both bot and user deactivation confirm
modal from "Confirm" to "Deactivate".
Calling `launch()` function from `dialog_widget.js` because
`confirm_dialog.js` set submit button text to "Confirm".
We have officially eliminated Realm from ConfirmationObjT and replaced
it with RealmReactivationStatus.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
We are no longer creating confirmation objects associated with realms
directly. This should test for `RealmReactivationStatus` instead.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
We added RealmReactivationStatus as a possible confirmation object
in #22584. We also need to add this type to ConfirmationObjT.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
Newrelic updated the payload that's sent via the webhook incoming call
causing a bug in the newrelic webhook endpoint.
This fixes the bug by updating the endpoint to respect the new format
of the payload as well as the old format. This should be updated once
the old format is EOLed.
Fixes#22338.
We currently show stream emails for subscribed and unsubscribed
streams in stream settings overlay and don't show them for never
subscribed streams.
There is a bug where we show the empty container without email on
live update after unsubscribing and then we completely hide the
email element after we switch the stream and come back to it
again. But then we again show emails for unsubscribed streams
after reload, to preserve the beahviour of showing the emails of
unsubscribed streams.
This commit fixes this bug by not hiding stream email on live
update after unsubscribing and also showing them after switching
between different streams and makes it consistent with showing
emails for unsubscribed streams.
Fixes#22308.
We add topic auto-complete to the left sidebar menu as sometimes user
may want to merge the topic they are moving with an existing topic.
With a tweak by tabbott to remove a now incorrect comment.
Fixes#19876.
This makes it mandatory to narrow the type of the user to `UserProfile`
before calling this helper.
This effectively removes the `request.user` check. We do not call login_page
anywhere else without getting through the authentication middleware.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
The instructions for logging out are not accurate.
Fixes the instructions and replaces the iOS and Android tabs with
a single Mobile tab.
Adds a Related articles section with links to "Logging in",
"Switching between organizations", and "Deactivate your account".
The phrasing "corner of the screen" wouldn't be accurate when the user
is doing a split screen or if the window or app is not taking up the
whole screen. Also, the use of "lower/upper" and "top/bottom" is not
consistent.
This standardizes on "corner of the app" and "bottom/top" when
referring to the location of app features on Desktop, Web, or Mobile.
Improves step-by-step instructions for Desktop users by directing
users to the relevant items in the left sidebar or top menu bar
without using an obscure keyboard shortcut.
Adds tip macro with instructions for toggling the app's left sidebar
via the top menu bar.
Moves the proxy settings and custom certificate info into a warning
block instead of the main instructions flow given they are rarely
needed for Logging in.
Adds a Related Articles section to "Switching between organizations"
so that users can access the information for setting an organization
profile picture from there instead of an oddly placed warning block.
Also adds links to "Logging in", "Logging out", and "Deactivate your
account", and lists them in each other's Related articles sections.
Adds a macro with instructions for accessing the profile menu for
reusability in "Logging out" and "Switching between organizations".
Reorders tabs Web > Desktop > Mobile for consistency.
Renames the main heading of "Linking to your organization" to match up
with the sidebar index title and adds a "Related articles" section.
Fixes cross-link title in "Link to a message or conversation".
Fixes: #22590.
In the test case `test_check_if_every_integration_has_logo_that_exists`,
`urlsplit(integration.logo_url).path` gets inferred as possibly bytes
because `integration.logo_url` might be `None`.
5598b49851/stdlib/urllib/parse.pyi (L166-L169)
TODO:
We might want to ensure that every integration has a `logo_url` with an
explicit assertion in `Integrations` (as noted in the comment).
Signed-off-by: Zixuan James Li <p359101898@gmail.com>