Commit Graph

32055 Commits

Author SHA1 Message Date
ppreethi 86840adda5 version: Show number of commits and commit sha in ZULIP_VERSION.
We use `git describe --tags` to get information about the number of commit since
the last major version, and the sha of the current HEAD. This is added to the
ZULIP_VERSION when a deploy is done from `git`.

Modified heavily by punchagan to:
* to use git describe instead of `git log` and `wc`
* use a separate script to run the git describe command
* write the file with version info to var/ and remove it from the repo

Fixes #4685.
2019-06-07 13:39:12 -07:00
Vishnu Ks 8261c394b9 webpack: Include channel.js to email-log bundle.
During the refactoring in c27d927663
$.post was replaced with channel.post without including
channel.js in email-log webpack bundle.
2019-06-07 11:34:17 -07:00
Alexandra Ciobica 161d196759 css: Add nightmode variant for fetching more messages loading indicator
Fixes: #12522.
2019-06-07 10:45:29 -07:00
Yashashvi Dave ac0d60f577 settings_profile_fields: Extract func `set_up_choices_field_edit_form`. 2019-06-06 22:36:16 -07:00
Yashashvi Dave 1fef813914 static/js/settings_account: Clean function `append_custom_profile_fields`. 2019-06-06 22:36:16 -07:00
Yashashvi Dave f25e00bcaa zever/lib/validator: Rename function to `validate_choice_field_data`. 2019-06-06 22:36:16 -07:00
Rishi Gupta 799a5e73c0 settings: Remove spurious colons after label text. 2019-06-06 22:17:04 -07:00
Rishi Gupta 49f8b9abbe help: Add manage-inactive-streams. 2019-06-06 22:17:03 -07:00
Tim Abbott 9fbc6ab022 version: Update version and changelog for Zulip 2.0.4 release. 2019-06-06 22:04:41 -07:00
Priyank Patel b70bd6be30 tests: Add tests for the logic of typing_status.handle_text_input.
This tests was added to make sure we catch subtle bug related to
comparing new_recipient and current_recipient. When we changed the
recipient to use arrays instead of string to use new user IDs based
api we encoured this bug and out testing suite couldn't detect this.
2019-06-06 19:56:24 -07:00
Priyank Patel b8250fc61e typing: Use user IDs instead of user ids string. 2019-06-06 19:56:24 -07:00
Priyank Patel 5228403eb5 people: Refactor out user id string to array function. 2019-06-06 19:56:24 -07:00
Tim Abbott 3b502fa235 settings: Fix getting API key when using social auth.
Long-term, we want this flow to do a full re-authentication, but this
makes the frontend consistent with the backend and fixes a confusing
bug where submitting the form ended up adding a weird `?password=`
thing to the URL, in addition to not working.

Fixes #12200.
2019-06-06 17:05:34 -07:00
Tim Abbott f5375adf8f settings: Improve example for RABBITMQ_HOST.
We prefer 127.0.0.1 over localhost for RabbitMQ because of weird IPv6
issues, so we should avoid mentioning localhost as an example.
2019-06-06 16:41:15 -07:00
Tim Abbott 5748bae71d restore-backup: Run configure-rabbitmq to update RABBITMQ_PASSWORD.
Previously, if you restored onto a different production system from
the one where you took the backup, backup restoration would fail
because the generated rabbitmq passwords for the two systems would be
different, and we didn't update the restored system to use the
password from the original system.

Fixes #12114.
2019-06-06 16:38:27 -07:00
Tim Abbott 3c4030a421 restore-backup: Run zulip-puppet-apply before pg_restore.
This should ensure that we apply any special configuration for the
database system (e.g. installing `pgroonga`) before we try to restore
the database contents from the archive.

For pgroonga in particular, this is important so that we can preserve
the configuration of the extension in the `pg_restore` process.

Fixes #12345.
2019-06-06 16:34:28 -07:00
Thomas Ip d1d06af2c6 dependencies: Upgrade jQuery to 3.4.1.
API changes:
* Positional selectors (eg :first, :eq) are deprecated in 3.4.0 and
  will be removed in 4.0. Use positional methods instead.
2019-06-06 15:21:26 -07:00
Thomas Ip 5b94e1dfad jQuery: Remove unnecessary :first selectors.
See example here: https://jsbin.com/relewizita/edit?html,js,output
Basically the original statement get the first of each input, button
and select element, and then select the first of these in the next
line. We can simply query the first one in one step. The settings
menu have at most 20 of these input elements so performance should
have no impact.
2019-06-06 15:21:26 -07:00
Thomas Ip 3b90eed007 jQuery: Replace positional selectors on the first of multiple selectors.
A selector like `$('.elem1:first .elem2')` selects all `.elem2` under
the first `.elem1`. We can instead use `$('.elem1').first().find('.elem2')`.
2019-06-06 15:21:26 -07:00
Thomas Ip b72f30bd06 jQuery: Replace positional selectors at the end of multiple selectors.
A selector like `$('.elem1 .elem2:first')` selects the first descendant
with class name `.elem2` under `.elem1`. This is the same as saying
`$('.elem1 .elem2').first()`. See example here:
https://jsbin.com/bohehesari/edit?html,js,output
2019-06-06 15:21:26 -07:00
Thomas Ip 6cad1988a9 jQuery: Use positional methods on single selectors.
For selectors like `$('.element:first')`, we can simply write
`$('.element').first()`.
2019-06-06 15:21:26 -07:00
Tim Abbott 13a20a1ab5 restore-backup: Fix error on systems using S3 upload backend.
With the S3 file upload backend, we don't store uploads locally, so
the `uploads` directory in the backup will be empty, and more
importantly, LOCAL_UPLOADS_DIR will be None, which the previous code
crashed on.
2019-06-06 15:08:18 -07:00
YashRE42 869aaba6a7 overlays: Fix stream edit click-through bug.
Fixes #12369.
2019-06-06 14:57:16 -07:00
Wyatt Hoodes ccfcd6b4d8 test_runner: Fix accumulation of uniquely named test templates.
N = self.parallel templates are created, and these templates were
previously named 'zulip_test_template_<1, N>'.  However, to support
running multiple instances of `test-backend`, a unique
`random_id_range_start` was created for each template database.

There was no problem prior because the templates would simply be
used again and thus did not require any clean up. Now that there are
unique database names being created, every time `test-backend` is run
these templates can accumulate on disk.  Instead, we clean up our
templates at the end of every complete run of the test suite, or upon a
SIGINT.

Fixes: #12426
2019-06-06 14:45:32 -07:00
Wyatt Hoodes d3500867d9 test_runner: Fix small typo in comment. 2019-06-06 14:29:57 -07:00
Tim Abbott 1de4b94fbe openapi: Add validation of parameter lists against actual code.
This validation is incomplete, in large part because of the long list
of TODOs in this code.  But this test should provide a ton of support
for us in avoiding regressions as we work towards having complete API
documentation.

See https://github.com/zulip/zulip/issues/12521 for a bunch of
follow-up improvements.
2019-06-06 13:41:07 -07:00
Tim Abbott 72bc497f7d urls: Fix URL definitions with missing ^/$ symbols.
This is mostly for consistency, though I also found it while writing
code to parse our regular expressions for validation purposes.
2019-06-06 12:58:10 -07:00
Tim Abbott 58c11fd249 api: Update documentation of subscription properties endpoint.
This covers the recent field rename as well as the addition of
email_notifications.
2019-06-06 12:05:49 -07:00
Vaibhav 90a67a6b4f css: Use SCSS nesting in alerts.scss for `.alert`. 2019-06-06 11:41:35 -07:00
Vaibhav 4b315a63cc css: Cleanup alerts.scss combing rules under same selector `.alert`. 2019-06-06 11:41:35 -07:00
Vaibhav 7c51e59a35 css: Use SCSS nesting in alerts.scss for `.alert-box`. 2019-06-06 11:41:35 -07:00
Vaibhav b04e1c918a css: Reorder alerts.scss so `.alert-box .alert` are in same place. 2019-06-06 11:41:35 -07:00
Vaibhav 9f5b1f19e9 css: Use SCSS nesting in alerts.scss for `.alert`. 2019-06-06 11:41:35 -07:00
Tim Abbott 065575debf retention: Add a quick comment explaining how deletion works. 2019-06-06 11:41:07 -07:00
Mateusz Mandera 323be57151 retention: If stream has no retention policy set, use realm policy.
We add the following behavior:
If stream has message_retention_days set to -1, archiving for it is
disabled.
If stream has message_retention_days set to null, use the realm's
policy. If the realm has no policy, we don't archive for this stream.
2019-06-06 11:17:42 -07:00
Mateusz Mandera 8bef82c7f9 retention: Clean up redundant code for special handling of UserMessages.
UserMessages no longer need special handling, they can be archived by
move_models_with_message_key_to_archive and automatically cleaned up
like the other models with a message key with CASCADING=True.
2019-06-06 11:17:42 -07:00
Mateusz Mandera 0e9fa4f028 retention: Support stream-based retention policies.
We change the archiving scheme to allow having stream based retention
policies. In the first step of the archiving process, we loop over
streams and archive their expired messages and related objects.
Then we separately archive all expired personal and huddle messages and
related objects. As the last step, we scan for redundant attachments
which can now be deleted.
To achieve this, we have to rewrite a significant portion of the
retention code and rework some of the database queries.
For the sake of simplicity, we neither archive nor delete cross-realm
messages, except cross-realm stream messages – in their case they can
be processed in the same manner as ordinary stream messages.
In the query for archiving personal and huddle messages we simply
exclude those sent by cross-realm bots.
We change the tests to adapt to these modifications.
2019-06-06 11:17:42 -07:00
Mateusz Mandera aa45325b5f retention: Rename move_expired_rows to move_rows. 2019-06-06 11:17:42 -07:00
Mateusz Mandera d481ee9a40 retention: Add message_retention_days field to Stream model. 2019-06-06 11:17:42 -07:00
Mateusz Mandera d373a16910 retention: Remove realm_id check when archiving attachments.
Since we archive attachments and attachment_messages tied to a list of
ids of Messages that we just archived (so from the current realm), it's
unnecessary to check their realm in the queries. This could potentially
cause archiving of an attachment with realm_id of another realm, but
this isn't an issue, as long as we make sure we don't end up deleting
the original Attachment object incorrectly - but realm_id check is
included in delete_expired_attachments() to ensure that.
2019-06-06 11:17:42 -07:00
Rishi Gupta bbf6dc5427 user docs: Fix fake email in restrict-visibility-of-email-addresses.
Fixes regression from 2ff969c.
2019-06-05 17:55:37 -07:00
Thomas Ip c6cdcd082e dependencies: Upgrade node to 12.3.1.
API changes:
* The behaviour of Date.toLocaleTimeString() reverts to pre 8.0.0,
  this only affects automated tests. Lots of other API changes but
  we didn't use any of those.
* The internal sorting algorithm changed which causes one of our own
  compare function to miss coverage.
2019-06-05 17:15:52 -07:00
Vaibhav af5d3769a7 css: Nest `.hotspot-popover` arrows inside `.hotspot.overlay`.
No changes were required in night mode since the night-mode css
already includes the same level of nesting.
Tested visually as well.
2019-06-05 17:08:59 -07:00
Vaibhav 4c41bc1324 css: Use SCSS nesting in hotspots.scss for `.hotspot-popover`. 2019-06-05 17:08:59 -07:00
Vaibhav d43548c7ca css: Use SCSS nesting in hotspots.scss for `.hotspot-popover.arrow-*`. 2019-06-05 17:08:59 -07:00
Vaibhav 209b16e667 css: Use SCSS nesting for in hotspots.scss for `.hotspot-confirm`. 2019-06-05 17:08:59 -07:00
Vaibhav 2b6acbfe03 css: Nest hotspot inline elems inside `.hotspot-inline`.
No changes required here for night-mode.
2019-06-05 17:08:59 -07:00
Vaibhav ce34fe51cd css: Use SCSS nesting in hotspots.scss for `.hotspot-inline`. 2019-06-05 17:08:59 -07:00
Vaibhav 9db1a5458d css: Reorder hotspots.scss so `.hotspot-inline` are in same line. 2019-06-05 17:08:59 -07:00
Vaibhav 74e6b5c926 css: Use SCSS nesting in hotspots.scss for `.hotspot.overlay`. 2019-06-05 17:08:59 -07:00